Add error message when calling sync methods from the Chrome debugger
Reviewed By: yungsters Differential Revision: D5123286 fbshipit-source-id: a7ac3fcc0b18e8d9562d99eb60268a3d98b3d647
This commit is contained in:
parent
fc45471af2
commit
7837bdbf7c
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue