Skip to content

Commit e97ffc4

Browse files
javachefacebook-github-bot
authored andcommitted
Use NoAutomaticPrototype everywhere
Reviewed By: michalgr Differential Revision: D4462794 fbshipit-source-id: 53585741c1d35ca31e3429f2de56455ea5dea902
1 parent 517abba commit e97ffc4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ReactCommon/cxxreact/JSCExecutor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,9 @@ void JSCExecutor::initOnJSVMThread() throw(JSException) {
240240
JSClassRef globalClass = nullptr;
241241
{
242242
SystraceSection s("JSClassCreate");
243-
globalClass = JSC_JSClassCreate(useCustomJSC, &kJSClassDefinitionEmpty);
243+
JSClassDefinition definition = kJSClassDefinitionEmpty;
244+
definition.attributes |= kJSClassAttributeNoAutomaticPrototype;
245+
globalClass = JSC_JSClassCreate(useCustomJSC, &definition);
244246
}
245247
{
246248
SystraceSection s("JSGlobalContextCreateInGroup");

ReactCommon/jschelpers/JSCHelpers.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ JSValueRef functionCaller(
3030
}
3131

3232
JSClassRef createFuncClass(JSContextRef ctx) {
33-
auto definition = kJSClassDefinitionEmpty;
33+
JSClassDefinition definition = kJSClassDefinitionEmpty;
34+
definition.attributes |= kJSClassAttributeNoAutomaticPrototype;
3435
// Need to duplicate the two different finalizer blocks, since there's no way
3536
// for it to capture this static information.
3637
if (isCustomJSCPtr(ctx)) {
@@ -107,7 +108,7 @@ void installGlobalProxy(
107108
const char* name,
108109
JSObjectGetPropertyCallback callback) {
109110
JSClassDefinition proxyClassDefintion = kJSClassDefinitionEmpty;
110-
proxyClassDefintion.className = "_FBProxyClass";
111+
proxyClassDefintion.attributes |= kJSClassAttributeNoAutomaticPrototype;
111112
proxyClassDefintion.getProperty = callback;
112113

113114
const bool isCustomJSC = isCustomJSCPtr(ctx);

0 commit comments

Comments
 (0)