Permalink
Browse files

Add error message when calling sync methods from the Chrome debugger

Reviewed By: yungsters

Differential Revision: D5123286

fbshipit-source-id: a7ac3fcc0b18e8d9562d99eb60268a3d98b3d647
  • Loading branch information...
javache authored and facebook-github-bot committed May 25, 2017
1 parent fc45471 commit 7837bdbf7c08a3874283a35dc1702134a58ff916
Showing with 6 additions and 0 deletions.
  1. +6 −0 Libraries/BatchedBridge/NativeModules.js
@@ -80,6 +80,12 @@ function genMethod(moduleID: number, methodID: number, type: MethodType) {
};
} else if (type === 'sync') {
fn = function(...args: Array<any>) {
if (__DEV__) {
invariant(global.nativeCallSyncHook, 'Calling synchronous methods on native ' +
'modules is not supported in Chrome.\n\n Consider providing alternative ' +
'methods to expose this method in debug mode, e.g. by exposing constants ' +
'ahead-of-time.');
}
return global.nativeCallSyncHook(moduleID, methodID, args);
};
} else {

0 comments on commit 7837bdb

Please sign in to comment.