From e97ffc469c29bc4a0a2b03e9a1969bb19ab88158 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 25 Jan 2017 11:33:06 -0800 Subject: [PATCH] Use NoAutomaticPrototype everywhere Reviewed By: michalgr Differential Revision: D4462794 fbshipit-source-id: 53585741c1d35ca31e3429f2de56455ea5dea902 --- ReactCommon/cxxreact/JSCExecutor.cpp | 4 +++- ReactCommon/jschelpers/JSCHelpers.cpp | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ReactCommon/cxxreact/JSCExecutor.cpp b/ReactCommon/cxxreact/JSCExecutor.cpp index 65a7e719b..c23e53e48 100644 --- a/ReactCommon/cxxreact/JSCExecutor.cpp +++ b/ReactCommon/cxxreact/JSCExecutor.cpp @@ -240,7 +240,9 @@ void JSCExecutor::initOnJSVMThread() throw(JSException) { JSClassRef globalClass = nullptr; { SystraceSection s("JSClassCreate"); - globalClass = JSC_JSClassCreate(useCustomJSC, &kJSClassDefinitionEmpty); + JSClassDefinition definition = kJSClassDefinitionEmpty; + definition.attributes |= kJSClassAttributeNoAutomaticPrototype; + globalClass = JSC_JSClassCreate(useCustomJSC, &definition); } { SystraceSection s("JSGlobalContextCreateInGroup"); diff --git a/ReactCommon/jschelpers/JSCHelpers.cpp b/ReactCommon/jschelpers/JSCHelpers.cpp index f99d76076..db6609a91 100644 --- a/ReactCommon/jschelpers/JSCHelpers.cpp +++ b/ReactCommon/jschelpers/JSCHelpers.cpp @@ -30,7 +30,8 @@ JSValueRef functionCaller( } JSClassRef createFuncClass(JSContextRef ctx) { - auto definition = kJSClassDefinitionEmpty; + JSClassDefinition definition = kJSClassDefinitionEmpty; + definition.attributes |= kJSClassAttributeNoAutomaticPrototype; // Need to duplicate the two different finalizer blocks, since there's no way // for it to capture this static information. if (isCustomJSCPtr(ctx)) { @@ -107,7 +108,7 @@ void installGlobalProxy( const char* name, JSObjectGetPropertyCallback callback) { JSClassDefinition proxyClassDefintion = kJSClassDefinitionEmpty; - proxyClassDefintion.className = "_FBProxyClass"; + proxyClassDefintion.attributes |= kJSClassAttributeNoAutomaticPrototype; proxyClassDefintion.getProperty = callback; const bool isCustomJSC = isCustomJSCPtr(ctx);