From 84ad5d3d3c797f7003f97a3c1e267e7b6056d34e Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Mon, 26 Feb 2018 19:42:07 -0800 Subject: [PATCH] Explicitly handle null props in bindings Reviewed By: fkgozali, mdvacca Differential Revision: D7080813 fbshipit-source-id: 7c9706df719a39e11a3d99c2de38af992b62dabf --- ReactCommon/jschelpers/JSCWrapper.h | 1 + ReactCommon/jschelpers/JavaScriptCore.h | 1 + ReactCommon/jschelpers/systemJSCWrapper.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/ReactCommon/jschelpers/JSCWrapper.h b/ReactCommon/jschelpers/JSCWrapper.h index 19cc720f9..cc2bc1ee1 100644 --- a/ReactCommon/jschelpers/JSCWrapper.h +++ b/ReactCommon/jschelpers/JSCWrapper.h @@ -139,6 +139,7 @@ struct JSCWrapper { JSC_WRAPPER_METHOD(JSValueToObject); JSC_WRAPPER_METHOD(JSValueToStringCopy); JSC_WRAPPER_METHOD(JSValueUnprotect); + JSC_WRAPPER_METHOD(JSValueIsNull); // Sampling profiler JSC_WRAPPER_METHOD(JSSamplingProfilerEnabled); diff --git a/ReactCommon/jschelpers/JavaScriptCore.h b/ReactCommon/jschelpers/JavaScriptCore.h index 056da7167..ff3dfd3b5 100644 --- a/ReactCommon/jschelpers/JavaScriptCore.h +++ b/ReactCommon/jschelpers/JavaScriptCore.h @@ -122,6 +122,7 @@ jsc_poison(JSStringCopyCFString JSStringCreateWithCharacters JSStringCreateWithC #define JSC_JSValueToObject(...) __jsc_wrapper(JSValueToObject, __VA_ARGS__) #define JSC_JSValueToStringCopy(...) __jsc_wrapper(JSValueToStringCopy, __VA_ARGS__) #define JSC_JSValueUnprotect(...) __jsc_wrapper(JSValueUnprotect, __VA_ARGS__) +#define JSC_JSValueIsNull(...) __jsc_wrapper(JSValueIsNull, __VA_ARGS__) jsc_poison(JSValueCreateJSONString JSValueGetType JSValueGetTypedArrayType JSValueIsArray JSValueIsBoolean JSValueIsDate JSValueIsEqual JSValueIsInstanceOfConstructor diff --git a/ReactCommon/jschelpers/systemJSCWrapper.cpp b/ReactCommon/jschelpers/systemJSCWrapper.cpp index b27209233..45e0597ef 100644 --- a/ReactCommon/jschelpers/systemJSCWrapper.cpp +++ b/ReactCommon/jschelpers/systemJSCWrapper.cpp @@ -119,6 +119,7 @@ const JSCWrapper* systemJSCWrapper() { .JSValueToObject = JSValueToObject, .JSValueToStringCopy = JSValueToStringCopy, .JSValueUnprotect = JSValueUnprotect, + .JSValueIsNull = JSValueIsNull, .JSSamplingProfilerEnabled = JSSamplingProfilerEnabled, .JSPokeSamplingProfiler =