diff --git a/ReactCommon/jschelpers/JSCWrapper.cpp b/ReactCommon/jschelpers/JSCWrapper.cpp index 27942a5b0..0da38ae84 100644 --- a/ReactCommon/jschelpers/JSCWrapper.cpp +++ b/ReactCommon/jschelpers/JSCWrapper.cpp @@ -51,6 +51,10 @@ static const JSCWrapper* s_customWrapper = nullptr; static JSCWrapper s_systemWrapper = {}; +bool isCustomJSCWrapperSet() { + return s_customWrapper != nullptr; +} + const JSCWrapper* customJSCWrapper() { #if USE_GLOG CHECK(s_customWrapper != nullptr) << "Accessing custom JSC wrapper before it's set"; @@ -60,7 +64,6 @@ const JSCWrapper* customJSCWrapper() { void setCustomJSCWrapper(const JSCWrapper* wrapper) { #if USE_GLOG - CHECK(wrapper != nullptr) << "Can't set null wrapper"; CHECK(s_customWrapper == nullptr) << "Can't set custom JSC wrapper multiple times"; #endif s_customWrapper = wrapper; diff --git a/ReactCommon/jschelpers/JSCWrapper.h b/ReactCommon/jschelpers/JSCWrapper.h index 0bfd3693b..5bc0e206e 100644 --- a/ReactCommon/jschelpers/JSCWrapper.h +++ b/ReactCommon/jschelpers/JSCWrapper.h @@ -127,6 +127,7 @@ bool isCustomJSCPtr(T *x) { return (uintptr_t)x & 0x1; } +bool isCustomJSCWrapperSet(); void setCustomJSCWrapper(const JSCWrapper* wrapper); // This will return a single value for the whole life of the process.