[ReactNative] Fix Chrome debugger

This commit is contained in:
Alex Kotliarskyi 2015-04-20 14:35:45 -07:00
parent 2434512847
commit a8a1798449
2 changed files with 4 additions and 4 deletions

View File

@ -136,7 +136,7 @@ typedef void (^WSMessageCallback)(NSError *error, NSDictionary *reply);
- (void)executeApplicationScript:(NSString *)script sourceURL:(NSURL *)URL onComplete:(RCTJavaScriptCompleteBlock)onComplete
{
NSDictionary *message = @{@"method": NSStringFromSelector(_cmd), @"url": [URL absoluteString], @"inject": _injectedObjects};
NSDictionary *message = @{@"method": @"executeApplicationScript", @"url": [URL absoluteString], @"inject": _injectedObjects};
[self sendMessage:message context:nil waitForReply:^(NSError *error, NSDictionary *reply) {
onComplete(error);
}];
@ -146,7 +146,7 @@ typedef void (^WSMessageCallback)(NSError *error, NSDictionary *reply);
{
RCTAssert(onComplete != nil, @"callback was missing for exec JS call");
NSDictionary *message = @{
@"method": NSStringFromSelector(_cmd),
@"method": @"executeJSCall",
@"moduleName": name,
@"moduleMethod": method,
@"arguments": arguments

View File

@ -41,13 +41,13 @@ var messageHandlers = {
window.localStorage.setItem('sessionID', message.id);
window.location.reload();
},
'executeApplicationScript:sourceURL:onComplete:': function(message, sendReply) {
'executeApplicationScript': function(message, sendReply) {
for (var key in message.inject) {
window[key] = JSON.parse(message.inject[key]);
}
loadScript(message.url, sendReply.bind(null, null));
},
'executeJSCall:method:arguments:context:callback:': function(message, sendReply) {
'executeJSCall': function(message, sendReply) {
var returnValue = [[], [], [], [], []];
try {
if (window && window.require) {