Skip to content

Commit

Permalink
Merge pull request #1828 from cxfeng1/ios-feature-20161208
Browse files Browse the repository at this point in the history
* [ios] -1 will be converted wrong in 32bit devices, so we should con…
  • Loading branch information
acton393 authored Dec 7, 2016
2 parents 104b197 + bfd16a0 commit 0d41b52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ - (JSValue *)callJSMethod:(NSString *)method args:(NSArray *)args

- (void)registerCallNative:(WXJSCallNative)callNative
{
NSInteger (^callNativeBlock)(JSValue *, JSValue *, JSValue *) = ^(JSValue *instance, JSValue *tasks, JSValue *callback){
JSValue* (^callNativeBlock)(JSValue *, JSValue *, JSValue *) = ^JSValue*(JSValue *instance, JSValue *tasks, JSValue *callback){
NSString *instanceId = [instance toString];
NSArray *tasksArray = [tasks toArray];
NSString *callbackId = [callback toString];

WXLogDebug(@"Calling native... instance:%@, tasks:%@, callback:%@", instanceId, tasksArray, callbackId);
return callNative(instanceId, tasksArray, callbackId);
return [JSValue valueWithInt32:(int32_t)callNative(instanceId, tasksArray, callbackId) inContext:[JSContext currentContext]];
};

_jsContext[@"callNative"] = callNativeBlock;
Expand All @@ -151,7 +151,7 @@ - (void)registerCallAddElement:(WXJSCallAddElement)callAddElement

WXLogDebug(@"callAddElement...%@, %@, %@, %ld", instanceIdString, parentRef, componentData, (long)insertIndex);

return callAddElement(instanceIdString, parentRef, componentData, insertIndex);
return [JSValue valueWithInt32:(int32_t)callAddElement(instanceIdString, parentRef, componentData, insertIndex) inContext:[JSContext currentContext]];
};

_jsContext[@"callAddElement"] = callAddElementBlock;
Expand Down

0 comments on commit 0d41b52

Please sign in to comment.