Skip to content

Commit

Permalink
Added a way to handle functions that are not supported by the system JSC
Browse files Browse the repository at this point in the history
Reviewed By: javache

Differential Revision: D4110660

fbshipit-source-id: 27c99cae96b57f70ddc1d310c6d5343d7c3c8892
  • Loading branch information
dcaspi authored and Facebook Github Bot committed Nov 2, 2016
1 parent 44025f4 commit 8287e3e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion React/Executors/RCTJSCWrapper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@

#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) {
return;
Expand Down Expand Up @@ -60,8 +70,8 @@ void __attribute__((visibility("hidden"),weak)) RCTCustomJSCInit(__unused void *
.JSValueIsUndefined = JSValueIsUndefined,
.JSValueIsNull = JSValueIsNull,
.JSEvaluateScript = JSEvaluateScript,
.JSEvaluateBytecodeBundle = NULL,
.JSBytecodeFileFormatVersion = JSNoBytecodeFileFormatVersion,
.JSEvaluateBytecodeBundle = (JSEvaluateBytecodeBundleFuncType)UnimplementedJSEvaluateBytecodeBundle,
.JSContext = [JSContext class],
.JSValue = [JSValue class],
};
Expand Down

0 comments on commit 8287e3e

Please sign in to comment.