Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion iphone/TitaniumKit/TitaniumKit/Sources/API/KrollModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ - (JSValue *)binding:(NSString *)moduleID

// FIXME: Extract a Proxy protocol for ObjcProxy/TiProxy and place methods like boundBridge:withKrollObject: on it!
if ([module isKindOfClass:[ObjcModule class]]) {
return [module JSValueInContext:context];
return [(ObjcModule *)module JSValueInContext:context];
}
KrollObject *ko = [[self executionContext] registerProxy:module]; // This basically retains the module for the lifetime of the bridge
return [JSValue valueWithJSValueRef:[ko jsobject] inContext:context];
Expand Down
1 change: 1 addition & 0 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/ScriptModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import "KrollBridge.h"
#import "KrollContext.h"
#import "TiExceptionHandler.h"
#import "TiHost.h"

@implementation ScriptModule

Expand Down
12 changes: 7 additions & 5 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiBlob.m
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ - (BOOL)writeTo:(NSString *)destination error:(NSError **)error
writeData = data;
break;
}
default: {
break;
}
}
if (writeData != nil) {
return [writeData writeToFile:destination atomically:YES];
Expand Down Expand Up @@ -481,8 +484,7 @@ - (JSValue *)toArrayBuffer

// Now make an ArrayBuffer with the copied bytes
JSContext *context = JSContext.currentContext;
JSValueRef *exception;
JSObjectRef arrayBuffer = JSObjectMakeArrayBufferWithBytesNoCopy(context.JSGlobalContextRef, arrayBytes, len, jsArrayBufferFreeDeallocator, nil, exception);
JSObjectRef arrayBuffer = JSObjectMakeArrayBufferWithBytesNoCopy(context.JSGlobalContextRef, arrayBytes, len, jsArrayBufferFreeDeallocator, nil, NULL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why passing NULL here instead of initializing the exception to NULL and passing the reference like you did below?

return [JSValue valueWithJSValueRef:arrayBuffer inContext:context];
}

Expand All @@ -499,9 +501,9 @@ - (JSValue *)arrayBuffer
[theData getBytes:arrayBytes length:len];

// Now make an ArrayBuffer with the copied bytes
JSValueRef *exception;
JSObjectRef arrayBuffer = JSObjectMakeArrayBufferWithBytesNoCopy(context.JSGlobalContextRef, arrayBytes, len, jsArrayBufferFreeDeallocator, nil, exception);
if (exception) {
JSValueRef exception = NULL;
JSObjectRef arrayBuffer = JSObjectMakeArrayBufferWithBytesNoCopy(context.JSGlobalContextRef, arrayBytes, len, jsArrayBufferFreeDeallocator, nil, &exception);
if (exception != NULL) {
[promise reject:@[ [JSValue valueWithJSValueRef:exception inContext:context] ]];
} else {
JSValue *buffer = [JSValue valueWithJSValueRef:arrayBuffer inContext:context];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ - (void)reportException:(NSException *)exception
[currentDelegate handleUncaughtException:exception];
return;
}
[prevUncaughtExceptionHandler handleUncaughtException:exception];
[(id<TiExceptionHandlerDelegate>)prevUncaughtExceptionHandler handleUncaughtException:exception];
}

- (void)reportScriptError:(TiScriptError *)scriptError
Expand Down
2 changes: 2 additions & 0 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ void DoProxyDelegateReadValuesWithKeysFromProxy(UIView<TiProxyDelegate> *target,
- (void)fireEvent:(NSString *)type withObject:(id)obj withSource:(id)source;
- (void)fireEvent:(NSString *)type withObject:(id)obj withSource:(id)source propagate:(BOOL)yn;

- (void)applyProperties:(id)args;

/**
Returns a dictionary of all properties set on the proxy object.
@return The dictionary containing all properties.
Expand Down
2 changes: 1 addition & 1 deletion iphone/TitaniumKit/TitaniumKit/Sources/API/TiUIView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ - (CAShapeLayer *)shadowLayer
[self assignShadowPropertyFromLayer:_shadowLayer toLayer:self.layer];
[_shadowLayer removeFromSuperlayer];
RELEASE_TO_NIL(_shadowLayer);
_shadowLayer = self.layer;
_shadowLayer = (CAShapeLayer *)self.layer;
} else if ((array.count > 1) && (!_shadowLayer || _shadowLayer == self.layer)) {
_shadowLayer = [[CAShapeLayer alloc] init];
_shadowLayer.fillColor = UIColor.clearColor.CGColor;
Expand Down
Loading