Skip to content

Commit

Permalink
Execute PHHandler js functions using the parent JSContext
Browse files Browse the repository at this point in the history
Fixes kasper#70; using the parent JSContext allows sharing the
default exceptionHandler
  • Loading branch information
pascalw committed Jan 24, 2016
1 parent 9ff93b5 commit 005b9c0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions Phoenix/PHHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ - (void) manageCallback:(JSValue *)callback {

- (void) callWithArguments:(NSArray *)arguments {

// Create a new scope for callback
JSValue *callback = self.callback.value;
JSContext *scope = [[JSContext alloc] initWithVirtualMachine:callback.context.virtualMachine];
JSValue *function = [JSValue valueWithObject:callback inContext:scope];

JSValue *function = self.callback.value;
[function callWithArguments:arguments];
}

Expand Down

0 comments on commit 005b9c0

Please sign in to comment.