Use NoAutomaticPrototype everywhere

Reviewed By: michalgr

Differential Revision: D4462794

fbshipit-source-id: 53585741c1d35ca31e3429f2de56455ea5dea902
This commit is contained in:
Pieter De Baets 2017-01-25 11:33:06 -08:00 committed by Facebook Github Bot
parent 517abba6bb
commit e97ffc469c
2 changed files with 6 additions and 3 deletions

View File

@ -240,7 +240,9 @@ void JSCExecutor::initOnJSVMThread() throw(JSException) {
JSClassRef globalClass = nullptr; JSClassRef globalClass = nullptr;
{ {
SystraceSection s("JSClassCreate"); SystraceSection s("JSClassCreate");
globalClass = JSC_JSClassCreate(useCustomJSC, &kJSClassDefinitionEmpty); JSClassDefinition definition = kJSClassDefinitionEmpty;
definition.attributes |= kJSClassAttributeNoAutomaticPrototype;
globalClass = JSC_JSClassCreate(useCustomJSC, &definition);
} }
{ {
SystraceSection s("JSGlobalContextCreateInGroup"); SystraceSection s("JSGlobalContextCreateInGroup");

View File

@ -30,7 +30,8 @@ JSValueRef functionCaller(
} }
JSClassRef createFuncClass(JSContextRef ctx) { 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 // Need to duplicate the two different finalizer blocks, since there's no way
// for it to capture this static information. // for it to capture this static information.
if (isCustomJSCPtr(ctx)) { if (isCustomJSCPtr(ctx)) {
@ -107,7 +108,7 @@ void installGlobalProxy(
const char* name, const char* name,
JSObjectGetPropertyCallback callback) { JSObjectGetPropertyCallback callback) {
JSClassDefinition proxyClassDefintion = kJSClassDefinitionEmpty; JSClassDefinition proxyClassDefintion = kJSClassDefinitionEmpty;
proxyClassDefintion.className = "_FBProxyClass"; proxyClassDefintion.attributes |= kJSClassAttributeNoAutomaticPrototype;
proxyClassDefintion.getProperty = callback; proxyClassDefintion.getProperty = callback;
const bool isCustomJSC = isCustomJSCPtr(ctx); const bool isCustomJSC = isCustomJSCPtr(ctx);