diff options
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSGlobalObject.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSGlobalObject.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp index da55c0191..2a4231537 100644 --- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp +++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp @@ -56,6 +56,9 @@ #include "Interpreter.h" #include "Lookup.h" #include "MathObject.h" +#include "NameConstructor.h" +#include "NameInstance.h" +#include "NamePrototype.h" #include "NativeErrorConstructor.h" #include "NativeErrorPrototype.h" #include "NumberConstructor.h" @@ -78,7 +81,7 @@ namespace JSC { const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &JSVariableObject::s_info, 0, ExecState::globalObjectTable, CREATE_METHOD_TABLE(JSGlobalObject) }; -const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript }; +const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptExperimentsEnabled }; /* Source for JSGlobalObject.lut.h @begin globalObjectTable @@ -306,6 +309,15 @@ void JSGlobalObject::reset(JSValue prototype) }; addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals)); + if (m_experimentsEnabled) { + NamePrototype* privateNamePrototype = NamePrototype::create(exec, NamePrototype::createStructure(exec->globalData(), this, m_objectPrototype.get())); + m_privateNameStructure.set(exec->globalData(), this, NameInstance::createStructure(exec->globalData(), this, privateNamePrototype)); + + JSCell* privateNameConstructor = NameConstructor::create(exec, this, NameConstructor::createStructure(exec->globalData(), this, m_functionPrototype.get()), privateNamePrototype); + privateNamePrototype->putDirectWithoutTransition(exec->globalData(), exec->propertyNames().constructor, privateNameConstructor, DontEnum); + putDirectWithoutTransition(exec->globalData(), Identifier(exec, "Name"), privateNameConstructor, DontEnum); + } + resetPrototype(exec->globalData(), prototype); } |