diff --git a/lib/Runtime/Base/ThreadConfigFlagsList.h b/lib/Runtime/Base/ThreadConfigFlagsList.h index 843e4b0c4e5..ff26cc0332b 100644 --- a/lib/Runtime/Base/ThreadConfigFlagsList.h +++ b/lib/Runtime/Base/ThreadConfigFlagsList.h @@ -34,7 +34,6 @@ FLAG_RELEASE(IsES6SpreadEnabled, ES6Spread) FLAG_RELEASE(IsES6StringExtensionsEnabled, ES6String) FLAG_RELEASE(IsES6StringPrototypeFixEnabled, ES6StringPrototypeFixes) FLAG_RELEASE(IsES6PrototypeChain, ES6PrototypeChain) -FLAG_RELEASE(IsES6SymbolEnabled, ES6Symbol) FLAG_RELEASE(IsES6ToPrimitiveEnabled, ES6ToPrimitive) FLAG_RELEASE(IsES6ToLengthEnabled, ES6ToLength) FLAG_RELEASE(IsES6ToStringTagEnabled, ES6ToStringTag) diff --git a/lib/Runtime/Library/JavascriptLibrary.cpp b/lib/Runtime/Library/JavascriptLibrary.cpp index ef8dc2ded7a..7e2a939f229 100644 --- a/lib/Runtime/Library/JavascriptLibrary.cpp +++ b/lib/Runtime/Library/JavascriptLibrary.cpp @@ -410,19 +410,15 @@ namespace Js DynamicType::New(scriptContext, TypeIds_Function, objectPrototype, JavascriptFunction::PrototypeEntryPoint, DeferredTypeHandler::GetDefaultInstance()), &JavascriptFunction::EntryInfo::PrototypeEntryPoint); - symbolPrototype = nullptr; promisePrototype = nullptr; javascriptEnumeratorIteratorPrototype = nullptr; generatorFunctionPrototype = nullptr; generatorPrototype = nullptr; asyncFunctionPrototype = nullptr; - if (scriptContext->GetConfig()->IsES6SymbolEnabled()) - { - symbolPrototype = DynamicObject::New(recycler, - DynamicType::New(scriptContext, TypeIds_Object, objectPrototype, nullptr, - DeferredTypeHandler::GetDefaultInstance())); - } + symbolPrototype = DynamicObject::New(recycler, + DynamicType::New(scriptContext, TypeIds_Object, objectPrototype, nullptr, + DeferredTypeHandler::GetDefaultInstance())); mapPrototype = DynamicObject::New(recycler, DynamicType::New(scriptContext, TypeIds_Object, objectPrototype, nullptr, @@ -561,8 +557,6 @@ namespace Js uriErrorType = DynamicType::New(scriptContext, TypeIds_Error, uriErrorPrototype, nullptr, SimplePathTypeHandler::New(scriptContext, scriptContext->GetRootPath(), 0, 0, 0, true, true), true, true); - symbolTypeStatic = nullptr; - symbolTypeDynamic = nullptr; withType = nullptr; proxyType = nullptr; promiseType = nullptr; @@ -572,12 +566,9 @@ namespace Js booleanTypeStatic = StaticType::New(scriptContext, TypeIds_Boolean, booleanPrototype, nullptr); booleanTypeDynamic = DynamicType::New(scriptContext, TypeIds_BooleanObject, booleanPrototype, nullptr, NullTypeHandler::GetDefaultInstance(), true, true); - if (config->IsES6SymbolEnabled()) - { - // Initialize symbol types - symbolTypeStatic = StaticType::New(scriptContext, TypeIds_Symbol, symbolPrototype, nullptr); - symbolTypeDynamic = DynamicType::New(scriptContext, TypeIds_SymbolObject, symbolPrototype, nullptr, NullTypeHandler::GetDefaultInstance(), true, true); - } + // Initialize symbol types + symbolTypeStatic = StaticType::New(scriptContext, TypeIds_Symbol, symbolPrototype, nullptr); + symbolTypeDynamic = DynamicType::New(scriptContext, TypeIds_SymbolObject, symbolPrototype, nullptr, NullTypeHandler::GetDefaultInstance(), true, true); if (config->IsES6UnscopablesEnabled()) { @@ -1093,29 +1084,15 @@ namespace Js simdInt32x4DisplayString = CreateStringFromCppLiteral(L"Int32x4"); } - if (scriptContext->GetConfig()->IsES6SymbolEnabled()) - { - symbolTypeDisplayString = CreateStringFromCppLiteral(L"symbol"); + symbolTypeDisplayString = CreateStringFromCppLiteral(L"symbol"); - symbolHasInstance = CreateSymbol(BuiltInPropertyRecords::_symbolHasInstance); - symbolIsConcatSpreadable = CreateSymbol(BuiltInPropertyRecords::_symbolIsConcatSpreadable); - symbolIterator = CreateSymbol(BuiltInPropertyRecords::_symbolIterator); - symbolSpecies = CreateSymbol(BuiltInPropertyRecords::_symbolSpecies); - symbolToPrimitive = CreateSymbol(BuiltInPropertyRecords::_symbolToPrimitive); - symbolToStringTag = CreateSymbol(BuiltInPropertyRecords::_symbolToStringTag); - symbolUnscopables = CreateSymbol(BuiltInPropertyRecords::_symbolUnscopables); - } - else - { - symbolTypeDisplayString = nullptr; - symbolHasInstance = nullptr; - symbolIsConcatSpreadable = nullptr; - symbolIterator = nullptr; - symbolSpecies = nullptr; - symbolToPrimitive = nullptr; - symbolToStringTag = nullptr; - symbolUnscopables = nullptr; - } + symbolHasInstance = CreateSymbol(BuiltInPropertyRecords::_symbolHasInstance); + symbolIsConcatSpreadable = CreateSymbol(BuiltInPropertyRecords::_symbolIsConcatSpreadable); + symbolIterator = CreateSymbol(BuiltInPropertyRecords::_symbolIterator); + symbolSpecies = CreateSymbol(BuiltInPropertyRecords::_symbolSpecies); + symbolToPrimitive = CreateSymbol(BuiltInPropertyRecords::_symbolToPrimitive); + symbolToStringTag = CreateSymbol(BuiltInPropertyRecords::_symbolToStringTag); + symbolUnscopables = CreateSymbol(BuiltInPropertyRecords::_symbolUnscopables); debuggerDeadZoneBlockVariableString = CreateStringFromCppLiteral(L"[Uninitialized block variable]"); defaultAccessorFunction = CreateNonProfiledFunction(&JavascriptOperators::EntryInfo::DefaultAccessor); @@ -1214,12 +1191,9 @@ namespace Js promiseConstructor = nullptr; reflectObject = nullptr; - if (scriptContext->GetConfig()->IsES6SymbolEnabled()) - { - symbolConstructor = CreateBuiltinConstructor(&JavascriptSymbol::EntryInfo::NewInstance, - DeferredTypeHandler::GetDefaultInstance()); - AddFunction(globalObject, PropertyIds::Symbol, symbolConstructor); - } + symbolConstructor = CreateBuiltinConstructor(&JavascriptSymbol::EntryInfo::NewInstance, + DeferredTypeHandler::GetDefaultInstance()); + AddFunction(globalObject, PropertyIds::Symbol, symbolConstructor); if (scriptContext->GetConfig()->IsES6ProxyEnabled()) { @@ -3453,11 +3427,7 @@ namespace Js // so that the update is in sync with profiler JavascriptLibrary* library = objectConstructor->GetLibrary(); ScriptContext* scriptContext = objectConstructor->GetScriptContext(); - int propertyCount = 17; - if (scriptContext->GetConfig()->IsES6SymbolEnabled()) - { - propertyCount += 1; - } + int propertyCount = 18; if (scriptContext->GetConfig()->IsES6ObjectExtensionsEnabled()) { propertyCount += 2; @@ -3499,11 +3469,8 @@ namespace Js library->AddFunctionToLibraryObject(objectConstructor, PropertyIds::getOwnPropertyNames, &JavascriptObject::EntryInfo::GetOwnPropertyNames, 1)); scriptContext->SetBuiltInLibraryFunction(JavascriptObject::EntryInfo::SetPrototypeOf.GetOriginalEntryPoint(), library->AddFunctionToLibraryObject(objectConstructor, PropertyIds::setPrototypeOf, &JavascriptObject::EntryInfo::SetPrototypeOf, 2)); - if (scriptContext->GetConfig()->IsES6SymbolEnabled()) - { - scriptContext->SetBuiltInLibraryFunction(JavascriptObject::EntryInfo::GetOwnPropertySymbols.GetOriginalEntryPoint(), - library->AddFunctionToLibraryObject(objectConstructor, PropertyIds::getOwnPropertySymbols, &JavascriptObject::EntryInfo::GetOwnPropertySymbols, 1)); - } + scriptContext->SetBuiltInLibraryFunction(JavascriptObject::EntryInfo::GetOwnPropertySymbols.GetOriginalEntryPoint(), + library->AddFunctionToLibraryObject(objectConstructor, PropertyIds::getOwnPropertySymbols, &JavascriptObject::EntryInfo::GetOwnPropertySymbols, 1)); if (scriptContext->GetConfig()->IsES6ObjectExtensionsEnabled()) { scriptContext->SetBuiltInLibraryFunction(JavascriptObject::EntryInfo::Is.GetOriginalEntryPoint(), @@ -5949,10 +5916,7 @@ namespace Js REGISTER_OBJECT(WeakMap); REGISTER_OBJECT(WeakSet); - if (config.IsES6SymbolEnabled()) - { - REGISTER_OBJECT(Symbol); - } + REGISTER_OBJECT(Symbol); REGISTER_OBJECT(Iterator); REGISTER_OBJECT(ArrayIterator); @@ -6028,11 +5992,7 @@ namespace Js REG_OBJECTS_LIB_FUNC(setPrototypeOf, JavascriptObject::EntrySetPrototypeOf); - ScriptConfiguration const& config = *(scriptContext->GetConfig()); - if (config.IsES6SymbolEnabled()) - { - REG_OBJECTS_LIB_FUNC(getOwnPropertySymbols, JavascriptObject::EntryGetOwnPropertySymbols); - } + REG_OBJECTS_LIB_FUNC(getOwnPropertySymbols, JavascriptObject::EntryGetOwnPropertySymbols); REG_OBJECTS_LIB_FUNC(hasOwnProperty, JavascriptObject::EntryHasOwnProperty); REG_OBJECTS_LIB_FUNC(propertyIsEnumerable, JavascriptObject::EntryPropertyIsEnumerable); @@ -6044,6 +6004,7 @@ namespace Js REG_OBJECTS_LIB_FUNC(__defineGetter__, JavascriptObject::EntryDefineGetter); REG_OBJECTS_LIB_FUNC(__defineSetter__, JavascriptObject::EntryDefineSetter); + ScriptConfiguration const& config = *(scriptContext->GetConfig()); if (config.IsES6ObjectExtensionsEnabled()) { REG_OBJECTS_LIB_FUNC(is, JavascriptObject::EntryIs); diff --git a/lib/common/ConfigFlagsList.h b/lib/common/ConfigFlagsList.h index a3bc5f949df..c9ca9fd837d 100644 --- a/lib/common/ConfigFlagsList.h +++ b/lib/common/ConfigFlagsList.h @@ -497,7 +497,6 @@ PHASE(All) #define DEFAULT_CONFIG_ES6String (true) #define DEFAULT_CONFIG_ES6StringPrototypeFixes (true) #define DEFAULT_CONFIG_ES6PrototypeChain (false) -#define DEFAULT_CONFIG_ES6Symbol (true) #define DEFAULT_CONFIG_ES6ToPrimitive (false) #define DEFAULT_CONFIG_ES6ToLength (false) #define DEFAULT_CONFIG_ES6ToStringTag (false) @@ -884,7 +883,6 @@ FLAGPR (Boolean, ES6, ES6Spread , "Enable ES6 Spread supp FLAGPR (Boolean, ES6, ES6String , "Enable ES6 String extensions" , DEFAULT_CONFIG_ES6String) FLAGPR (Boolean, ES6, ES6StringPrototypeFixes, "Enable ES6 String.prototype fixes" , DEFAULT_CONFIG_ES6StringPrototypeFixes) FLAGPR_REGOVR_EXP(Boolean, ES6, ES6PrototypeChain , "Enable ES6 prototypes (Example: Date prototype is object)", DEFAULT_CONFIG_ES6PrototypeChain) -FLAGPR (Boolean, ES6, ES6Symbol , "Enable ES6 Symbol feature" , DEFAULT_CONFIG_ES6Symbol) FLAGPR (Boolean, ES6, ES6ToPrimitive , "Enable ES6 ToPrimitve symbol" , DEFAULT_CONFIG_ES6ToPrimitive) FLAGPR (Boolean, ES6, ES6ToLength , "Enable ES6 ToLength fixes" , DEFAULT_CONFIG_ES6ToLength) FLAGPR (Boolean, ES6, ES6ToStringTag , "Enable ES6 ToStringTag symbol" , DEFAULT_CONFIG_ES6ToStringTag) diff --git a/test/es6/es6_all.baseline b/test/es6/es6_all.baseline index a3b158fb031..9e21ad42112 100644 --- a/test/es6/es6_all.baseline +++ b/test/es6/es6_all.baseline @@ -53,8 +53,6 @@ FLAG ES6 = 1 - setting child flag ES6StringPrototypeFixes = 1 FLAG ES6StringPrototypeFixes = 1 FLAG ES6 = 1 - setting child flag ES6PrototypeChain = 1 FLAG ES6PrototypeChain = 1 -FLAG ES6 = 1 - setting child flag ES6Symbol = 1 -FLAG ES6Symbol = 1 FLAG ES6 = 1 - setting child flag ES6ToPrimitive = 1 FLAG ES6ToPrimitive = 1 FLAG ES6 = 1 - setting child flag ES6ToLength = 1 diff --git a/test/es6/es6_stable.baseline b/test/es6/es6_stable.baseline index 78d5a03a663..6da7146494e 100644 --- a/test/es6/es6_stable.baseline +++ b/test/es6/es6_stable.baseline @@ -53,8 +53,6 @@ FLAG ES6 = 1 - setting child flag ES6StringPrototypeFixes = 1 FLAG ES6StringPrototypeFixes = 1 FLAG ES6 = 1 - setting child flag ES6PrototypeChain = 0 FLAG ES6PrototypeChain = 0 -FLAG ES6 = 1 - setting child flag ES6Symbol = 1 -FLAG ES6Symbol = 1 FLAG ES6 = 1 - setting child flag ES6ToPrimitive = 0 FLAG ES6ToPrimitive = 0 FLAG ES6 = 1 - setting child flag ES6ToLength = 0 diff --git a/test/es6/es6_stable.enable_disable.baseline b/test/es6/es6_stable.enable_disable.baseline index 50d14a10c51..d4fcd356a9f 100644 --- a/test/es6/es6_stable.enable_disable.baseline +++ b/test/es6/es6_stable.enable_disable.baseline @@ -53,8 +53,6 @@ FLAG ES6 = 1 - setting child flag ES6StringPrototypeFixes = 1 FLAG ES6StringPrototypeFixes = 1 FLAG ES6 = 1 - setting child flag ES6PrototypeChain = 0 FLAG ES6PrototypeChain = 0 -FLAG ES6 = 1 - setting child flag ES6Symbol = 1 -FLAG ES6Symbol = 1 FLAG ES6 = 1 - setting child flag ES6ToPrimitive = 0 FLAG ES6ToPrimitive = 0 FLAG ES6 = 1 - setting child flag ES6ToLength = 0 @@ -134,8 +132,6 @@ FLAG ES6 = 0 - setting child flag ES6StringPrototypeFixes = 0 FLAG ES6StringPrototypeFixes = 0 FLAG ES6 = 0 - setting child flag ES6PrototypeChain = 0 FLAG ES6PrototypeChain = 0 -FLAG ES6 = 0 - setting child flag ES6Symbol = 0 -FLAG ES6Symbol = 0 FLAG ES6 = 0 - setting child flag ES6ToPrimitive = 0 FLAG ES6ToPrimitive = 0 FLAG ES6 = 0 - setting child flag ES6ToLength = 0 diff --git a/test/es6/rlexe.xml b/test/es6/rlexe.xml index 030740242f5..f499108b897 100644 --- a/test/es6/rlexe.xml +++ b/test/es6/rlexe.xml @@ -409,13 +409,13 @@ ES6Symbol.js - -ES6Symbol -ES6ObjectLiterals -es6toprimitive -es6isConcatSpreadable -es6tostringtag -ES6Species -ES6HasInstance -args summary -endargs + -ES6ObjectLiterals -es6toprimitive -es6isConcatSpreadable -es6tostringtag -ES6Species -ES6HasInstance -args summary -endargs ES6Symbol_540238.js - -ES6Symbol -RecyclerStress + -RecyclerStress exclude_fre