Added a way to handle functions that are not supported by the system JSC
Reviewed By: javache Differential Revision: D4110660 fbshipit-source-id: 27c99cae96b57f70ddc1d310c6d5343d7c3c8892
This commit is contained in:
parent
44025f4931
commit
8287e3e83f
|
@ -16,6 +16,16 @@
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
|
// Crash the app (with a descriptive stack trace) if a function that is not
|
||||||
|
// supported by the system JSC is called.
|
||||||
|
#define UNIMPLEMENTED_SYSTEM_JSC_FUNCTION(FUNC_NAME) \
|
||||||
|
static void Unimplemented##FUNC_NAME(void* args...) { \
|
||||||
|
assert(false);\
|
||||||
|
}
|
||||||
|
|
||||||
|
UNIMPLEMENTED_SYSTEM_JSC_FUNCTION(JSEvaluateBytecodeBundle)
|
||||||
|
|
||||||
|
#undef UNIMPLEMENTED_SYSTEM_JSC_FUNCTION
|
||||||
|
|
||||||
void __attribute__((visibility("hidden"),weak)) RCTCustomJSCInit(__unused void *handle) {
|
void __attribute__((visibility("hidden"),weak)) RCTCustomJSCInit(__unused void *handle) {
|
||||||
return;
|
return;
|
||||||
|
@ -60,8 +70,8 @@ static RCTJSCWrapper *RCTSetUpSystemLibraryPointers()
|
||||||
.JSValueIsUndefined = JSValueIsUndefined,
|
.JSValueIsUndefined = JSValueIsUndefined,
|
||||||
.JSValueIsNull = JSValueIsNull,
|
.JSValueIsNull = JSValueIsNull,
|
||||||
.JSEvaluateScript = JSEvaluateScript,
|
.JSEvaluateScript = JSEvaluateScript,
|
||||||
.JSEvaluateBytecodeBundle = NULL,
|
|
||||||
.JSBytecodeFileFormatVersion = JSNoBytecodeFileFormatVersion,
|
.JSBytecodeFileFormatVersion = JSNoBytecodeFileFormatVersion,
|
||||||
|
.JSEvaluateBytecodeBundle = (JSEvaluateBytecodeBundleFuncType)UnimplementedJSEvaluateBytecodeBundle,
|
||||||
.JSContext = [JSContext class],
|
.JSContext = [JSContext class],
|
||||||
.JSValue = [JSValue class],
|
.JSValue = [JSValue class],
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue