// Imports
var arrayIterationKindSymbol =
- utils.GetPrivateSymbol("array_iteration_kind_symbol");
+ utils.ImportNow("array_iteration_kind_symbol");
var arrayIteratorNextIndexSymbol =
- utils.GetPrivateSymbol("array_iterator_next_symbol");
+ utils.ImportNow("array_iterator_next_symbol");
var arrayIteratorObjectSymbol =
- utils.GetPrivateSymbol("array_iterator_object_symbol");
+ utils.ImportNow("array_iterator_object_symbol");
var GlobalArray = global.Array;
+var iteratorSymbol = utils.ImportNow("iterator_symbol");
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
macro TYPED_ARRAYS(FUNCTION)
FUNCTION(Uint8Array)
utils.InstallFunctions(ArrayIterator.prototype, DONT_ENUM, [
'next', ArrayIteratorNext
]);
-utils.SetFunctionName(ArrayIteratorIterator, symbolIterator);
-%AddNamedProperty(ArrayIterator.prototype, symbolIterator,
+utils.SetFunctionName(ArrayIteratorIterator, iteratorSymbol);
+%AddNamedProperty(ArrayIterator.prototype, iteratorSymbol,
ArrayIteratorIterator, DONT_ENUM);
-%AddNamedProperty(ArrayIterator.prototype, symbolToStringTag,
+%AddNamedProperty(ArrayIterator.prototype, toStringTagSymbol,
"Array Iterator", READ_ONLY | DONT_ENUM);
utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
// InstallFunctions block, as it'll be redundant.
utils.SetFunctionName(ArrayValues, 'values');
-%AddNamedProperty(GlobalArray.prototype, symbolIterator, ArrayValues,
+%AddNamedProperty(GlobalArray.prototype, iteratorSymbol, ArrayValues,
DONT_ENUM);
macro EXTEND_TYPED_ARRAY(NAME)
%AddNamedProperty(GlobalNAME.prototype, 'entries', ArrayEntries, DONT_ENUM);
%AddNamedProperty(GlobalNAME.prototype, 'values', ArrayValues, DONT_ENUM);
%AddNamedProperty(GlobalNAME.prototype, 'keys', ArrayKeys, DONT_ENUM);
- %AddNamedProperty(GlobalNAME.prototype, symbolIterator, ArrayValues,
+ %AddNamedProperty(GlobalNAME.prototype, iteratorSymbol, ArrayValues,
DONT_ENUM);
endmacro
var ObjectToString;
var ToNumber;
var ToString;
+var unscopablesSymbol = utils.ImportNow("unscopables_symbol");
utils.Import(function(from) {
Delete = from.Delete;
keys: true,
};
-%AddNamedProperty(GlobalArray.prototype, symbolUnscopables, unscopables,
+%AddNamedProperty(GlobalArray.prototype, unscopablesSymbol, unscopables,
DONT_ENUM | READ_ONLY);
// Set up non-enumerable functions on the Array object.
var MathMax;
var MathMin;
var ToNumber;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
MathMax = from.MathMax;
GlobalArrayBuffer.prototype, "constructor", GlobalArrayBuffer, DONT_ENUM);
%AddNamedProperty(GlobalArrayBuffer.prototype,
- symbolToStringTag, "ArrayBuffer", DONT_ENUM | READ_ONLY);
+ toStringTagSymbol, "ArrayBuffer", DONT_ENUM | READ_ONLY);
-utils.InstallGetter(GlobalArrayBuffer.prototype, "byteLength", ArrayBufferGetByteLen);
+utils.InstallGetter(GlobalArrayBuffer.prototype, "byteLength",
+ ArrayBufferGetByteLen);
utils.InstallFunctions(GlobalArrayBuffer, DONT_ENUM, [
"isView", ArrayBufferIsViewJS
}
-void Bootstrapper::ExportPrivateSymbols(Isolate* isolate,
- Handle<JSObject> container) {
+void Bootstrapper::ExportFromRuntime(Isolate* isolate,
+ Handle<JSObject> container) {
HandleScope scope(isolate);
#define EXPORT_PRIVATE_SYMBOL(NAME) \
Handle<String> NAME##_name = \
isolate->factory()->NewStringFromAsciiChecked(#NAME); \
JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \
NONE);
-
PRIVATE_SYMBOL_LIST(EXPORT_PRIVATE_SYMBOL)
-
#undef EXPORT_PRIVATE_SYMBOL
+
+#define EXPORT_PUBLIC_SYMBOL(NAME, DESCRIPTION) \
+ Handle<String> NAME##_name = \
+ isolate->factory()->NewStringFromAsciiChecked(#NAME); \
+ JSObject::AddProperty(container, NAME##_name, isolate->factory()->NAME(), \
+ NONE);
+ PUBLIC_SYMBOL_LIST(EXPORT_PUBLIC_SYMBOL)
+#undef EXPORT_PUBLIC_SYMBOL
+
+ Handle<JSFunction> apply = InstallFunction(
+ container, "reflect_apply", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ MaybeHandle<JSObject>(), Builtins::kReflectApply);
+ apply->shared()->set_internal_formal_parameter_count(3);
+ apply->shared()->set_length(3);
+ isolate->native_context()->set_reflect_apply(*apply);
+
+ Handle<JSFunction> construct = InstallFunction(
+ container, "reflect_construct", JS_OBJECT_TYPE, JSObject::kHeaderSize,
+ MaybeHandle<JSObject>(), Builtins::kReflectConstruct);
+ construct->shared()->set_internal_formal_parameter_count(3);
+ construct->shared()->set_length(2);
+ isolate->native_context()->set_reflect_construct(*construct);
+}
+
+
+void Bootstrapper::ExportExperimentalFromRuntime(Isolate* isolate,
+ Handle<JSObject> container) {
+ HandleScope scope(isolate);
+
+#define INITIALIZE_FLAG(FLAG) \
+ { \
+ Handle<String> name = \
+ isolate->factory()->NewStringFromAsciiChecked(#FLAG); \
+ JSObject::AddProperty(container, name, \
+ isolate->factory()->ToBoolean(FLAG), NONE); \
+ }
+
+ INITIALIZE_FLAG(FLAG_harmony_regexps)
+ INITIALIZE_FLAG(FLAG_harmony_unicode_regexps)
+ INITIALIZE_FLAG(FLAG_harmony_tostring)
+
+#undef INITIALIZE_FLAG
}
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_atomics)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_new_target)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_concat_spreadable)
-
-void Genesis::InitializeGlobal_harmony_regexps() {
- Handle<JSObject> builtins(native_context()->builtins());
-
- Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value()
- : heap()->false_value());
- Runtime::SetObjectProperty(isolate(), builtins,
- factory()->harmony_regexps_string(), flag,
- STRICT).Assert();
-}
-
-
-void Genesis::InitializeGlobal_harmony_unicode_regexps() {
- Handle<JSObject> builtins(native_context()->builtins());
-
- Handle<HeapObject> flag(FLAG_harmony_unicode_regexps ? heap()->true_value()
- : heap()->false_value());
- Runtime::SetObjectProperty(isolate(), builtins,
- factory()->harmony_unicode_regexps_string(), flag,
- STRICT).Assert();
-}
+EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_regexps)
+EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_unicode_regexps)
+EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_tostring)
void Genesis::InitializeGlobal_harmony_reflect() {
- Handle<JSObject> builtins(native_context()->builtins());
-
- Handle<JSFunction> apply = InstallFunction(
- builtins, "$reflectApply", JS_OBJECT_TYPE, JSObject::kHeaderSize,
- MaybeHandle<JSObject>(), Builtins::kReflectApply);
- apply->shared()->set_internal_formal_parameter_count(3);
- apply->shared()->set_length(3);
-
- native_context()->set_reflect_apply(*apply);
-
- Handle<JSFunction> construct = InstallFunction(
- builtins, "$reflectConstruct", JS_OBJECT_TYPE, JSObject::kHeaderSize,
- MaybeHandle<JSObject>(), Builtins::kReflectConstruct);
- construct->shared()->set_internal_formal_parameter_count(3);
- construct->shared()->set_length(2);
-
- native_context()->set_reflect_construct(*construct);
-
if (!FLAG_harmony_reflect) return;
Handle<JSGlobalObject> global(JSGlobalObject::cast(
}
-void Genesis::InitializeGlobal_harmony_tostring() {
- Handle<JSObject> builtins(native_context()->builtins());
-
- Handle<HeapObject> flag(FLAG_harmony_tostring ? heap()->true_value()
- : heap()->false_value());
- Runtime::SetObjectProperty(isolate(), builtins,
- factory()->harmony_tostring_string(), flag,
- STRICT).Assert();
-}
-
void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
if (!FLAG_harmony_sharedarraybuffer) return;
return true;
}
- // Install public symbols.
- {
- static const PropertyAttributes attributes =
- static_cast<PropertyAttributes>(READ_ONLY | DONT_DELETE);
-#define INSTALL_PUBLIC_SYMBOL(name, varname, description) \
- Handle<String> varname = factory()->NewStringFromStaticChars(#varname); \
- JSObject::AddProperty(builtins, varname, factory()->name(), attributes);
- PUBLIC_SYMBOL_LIST(INSTALL_PUBLIC_SYMBOL)
-#undef INSTALL_PUBLIC_SYMBOL
- }
-
// Run the rest of the native scripts.
while (builtin_index < Natives::GetBuiltinsCount()) {
if (!Bootstrapper::CompileBuiltin(isolate(), builtin_index++)) return false;
static bool CompileCodeStubBuiltin(Isolate* isolate, int index);
static bool InstallCodeStubNatives(Isolate* isolate);
- static void ExportPrivateSymbols(Isolate* isolate,
- Handle<JSObject> container);
+ static void ExportFromRuntime(Isolate* isolate, Handle<JSObject> container);
+ static void ExportExperimentalFromRuntime(Isolate* isolate,
+ Handle<JSObject> container);
private:
Isolate* isolate_;
var GlobalMap = global.Map;
var GlobalSet = global.Set;
+var iteratorSymbol = utils.ImportNow("iterator_symbol");
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
// -------------------------------------------------------------------
'next', SetIteratorNextJS
]);
-%AddNamedProperty(SetIterator.prototype, symbolToStringTag,
+%AddNamedProperty(SetIterator.prototype, toStringTagSymbol,
"Set Iterator", READ_ONLY | DONT_ENUM);
utils.InstallFunctions(GlobalSet.prototype, DONT_ENUM, [
'values', SetValues
]);
-%AddNamedProperty(GlobalSet.prototype, symbolIterator, SetValues, DONT_ENUM);
+%AddNamedProperty(GlobalSet.prototype, iteratorSymbol, SetValues, DONT_ENUM);
$setIteratorNext = SetIteratorNextJS;
$setValues = SetValues;
'next', MapIteratorNextJS
]);
-%AddNamedProperty(MapIterator.prototype, symbolToStringTag,
+%AddNamedProperty(MapIterator.prototype, toStringTagSymbol,
"Map Iterator", READ_ONLY | DONT_ENUM);
'values', MapValues
]);
-%AddNamedProperty(GlobalMap.prototype, symbolIterator, MapEntries, DONT_ENUM);
+%AddNamedProperty(GlobalMap.prototype, iteratorSymbol, MapEntries, DONT_ENUM);
$mapEntries = MapEntries;
$mapIteratorNext = MapIteratorNextJS;
var GlobalMap = global.Map;
var GlobalObject = global.Object;
var GlobalSet = global.Set;
-var hashCodeSymbol = utils.GetPrivateSymbol("hash_code_symbol");
+var hashCodeSymbol = utils.ImportNow("hash_code_symbol");
var IntRandom;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
IntRandom = from.IntRandom;
%FunctionSetLength(GlobalSet, 0);
%FunctionSetPrototype(GlobalSet, new GlobalObject());
%AddNamedProperty(GlobalSet.prototype, "constructor", GlobalSet, DONT_ENUM);
-%AddNamedProperty(GlobalSet.prototype, symbolToStringTag, "Set",
+%AddNamedProperty(GlobalSet.prototype, toStringTagSymbol, "Set",
DONT_ENUM | READ_ONLY);
%FunctionSetLength(SetForEach, 1);
%FunctionSetPrototype(GlobalMap, new GlobalObject());
%AddNamedProperty(GlobalMap.prototype, "constructor", GlobalMap, DONT_ENUM);
%AddNamedProperty(
- GlobalMap.prototype, symbolToStringTag, "Map", DONT_ENUM | READ_ONLY);
+ GlobalMap.prototype, toStringTagSymbol, "Map", DONT_ENUM | READ_ONLY);
%FunctionSetLength(MapForEach, 1);
var MathAbs;
var MathFloor;
var ToNumber;
+var toPrimitiveSymbol = utils.ImportNow("to_primitive_symbol");
var ToString;
utils.Import(function(from) {
// Set up non-enumerable constructor property of the Date prototype object.
%AddNamedProperty(GlobalDate.prototype, "constructor", GlobalDate, DONT_ENUM);
-utils.SetFunctionName(DateToPrimitive, symbolToPrimitive);
-%AddNamedProperty(GlobalDate.prototype, symbolToPrimitive, DateToPrimitive,
+utils.SetFunctionName(DateToPrimitive, toPrimitiveSymbol);
+%AddNamedProperty(GlobalDate.prototype, toPrimitiveSymbol, DateToPrimitive,
DONT_ENUM | READ_ONLY);
// Set up non-enumerable functions of the Date prototype object and
var IsNaN = global.isNaN;
var JSONStringify = global.JSON.stringify;
var MathMin = global.Math.min;
-var promiseStatusSymbol = utils.GetPrivateSymbol("promise_status_symbol");
-var promiseValueSymbol = utils.GetPrivateSymbol("promise_value_symbol");
+var promiseStatusSymbol = utils.ImportNow("promise_status_symbol");
+var promiseValueSymbol = utils.ImportNow("promise_value_symbol");
+var SymbolToString;
var ToBoolean;
var ToString;
utils.Import(function(from) {
FunctionSourceString = from.FunctionSourceString;
+ SymbolToString = from.SymbolToString;
ToBoolean = from.ToBoolean;
ToString = from.ToString;
});
SymbolMirror.prototype.toText = function() {
- return %_CallFunction(this.value_, builtins.$symbolToString);
+ return %_CallFunction(this.value_, SymbolToString);
}
PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
-#define SYMBOL_ACCESSOR(name, varname, description) \
+#define SYMBOL_ACCESSOR(name, description) \
inline Handle<Symbol> name() { \
return Handle<Symbol>(bit_cast<Symbol**>( \
&isolate()->heap()->roots_[Heap::k##name##RootIndex])); \
// Imports
var GlobalFunction = global.Function;
-
var NewFunctionString;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
NewFunctionString = from.NewFunctionString;
%AddNamedProperty(GeneratorObjectPrototype, "constructor",
GeneratorFunctionPrototype, DONT_ENUM | READ_ONLY);
%AddNamedProperty(GeneratorObjectPrototype,
- symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY);
+ toStringTagSymbol, "Generator", DONT_ENUM | READ_ONLY);
%InternalSetPrototype(GeneratorFunctionPrototype, GlobalFunction.prototype);
%AddNamedProperty(GeneratorFunctionPrototype,
- symbolToStringTag, "GeneratorFunction", DONT_ENUM | READ_ONLY);
+ toStringTagSymbol, "GeneratorFunction", DONT_ENUM | READ_ONLY);
%AddNamedProperty(GeneratorFunctionPrototype, "constructor",
GeneratorFunction, DONT_ENUM | READ_ONLY);
%InternalSetPrototype(GeneratorFunction, GlobalFunction);
var GetIterator;
var GetMethod;
var GlobalArray = global.Array;
-var GlobalSymbol = global.Symbol;
+var iteratorSymbol = utils.ImportNow("iterator_symbol");
var MathMax;
var MathMin;
var ObjectIsFrozen;
}
}
- var iterable = GetMethod(items, symbolIterator);
+ var iterable = GetMethod(items, iteratorSymbol);
var k;
var result;
var mappedValue;
var GlobalObject = global.Object;
var MathMax;
var ToNumber;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
MathMax = from.MathMax;
%AddNamedProperty(global, "Atomics", Atomics, DONT_ENUM);
%FunctionSetInstanceClassName(AtomicsConstructor, 'Atomics');
-%AddNamedProperty(Atomics, symbolToStringTag, "Atomics", READ_ONLY | DONT_ENUM);
+%AddNamedProperty(Atomics, toStringTagSymbol, "Atomics", READ_ONLY | DONT_ENUM);
// These must match the values in src/futex-emulation.h
utils.InstallConstants(Atomics, [
%CheckIsBootstrapping();
+var isConcatSpreadableSymbol =
+ utils.ImportNow("is_concat_spreadable_symbol");
+
utils.InstallConstants(global.Symbol, [
// TODO(littledan): Move to symbol.js when shipping
- "isConcatSpreadable", symbolIsConcatSpreadable
+ "isConcatSpreadable", isConcatSpreadableSymbol
]);
})
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO(yangguo): Remove this file. Do all of this in
-// Genesis::InitializeGlobal_harmony_reflect
-
(function(global, utils) {
'use strict';
%CheckIsBootstrapping();
var GlobalReflect = global.Reflect;
+var ReflectApply = utils.ImportNow("reflect_apply");
+var ReflectConstruct = utils.ImportNow("reflect_construct");
utils.InstallFunctions(GlobalReflect, DONT_ENUM, [
- "apply", $reflectApply,
- "construct", $reflectConstruct
+ "apply", ReflectApply,
+ "construct", ReflectConstruct
]);
})
var GlobalSharedArrayBuffer = global.SharedArrayBuffer;
var GlobalObject = global.Object;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
// -------------------------------------------------------------------
GlobalSharedArrayBuffer, DONT_ENUM);
%AddNamedProperty(GlobalSharedArrayBuffer.prototype,
- symbolToStringTag, "SharedArrayBuffer", DONT_ENUM | READ_ONLY);
+ toStringTagSymbol, "SharedArrayBuffer", DONT_ENUM | READ_ONLY);
utils.InstallGetter(GlobalSharedArrayBuffer.prototype, "byteLength",
SharedArrayBufferGetByteLen);
// Imports
var GlobalSIMD = global.SIMD;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
macro SIMD_FLOAT_TYPES(FUNCTION)
FUNCTION(Float32x4, float32x4, 4)
}
-%AddNamedProperty(GlobalSIMD, symbolToStringTag, 'SIMD', READ_ONLY | DONT_ENUM);
+%AddNamedProperty(GlobalSIMD, toStringTagSymbol, 'SIMD', READ_ONLY | DONT_ENUM);
macro SETUP_SIMD_TYPE(NAME, TYPE, LANES)
%SetCode(GlobalNAME, NAMEConstructor);
%FunctionSetPrototype(GlobalNAME, {});
%AddNamedProperty(GlobalNAME.prototype, 'constructor', GlobalNAME,
DONT_ENUM);
-%AddNamedProperty(GlobalNAME.prototype, symbolToStringTag, 'NAME',
+%AddNamedProperty(GlobalNAME.prototype, toStringTagSymbol, 'NAME',
DONT_ENUM | READ_ONLY);
utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [
'toLocaleString', NAMEToLocaleString,
%CheckIsBootstrapping();
var GlobalSymbol = global.Symbol;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.InstallConstants(GlobalSymbol, [
// TODO(dslomov, caitp): Move to symbol.js when shipping
- "toStringTag", symbolToStringTag
+ "toStringTag", toStringTagSymbol
]);
})
#define SYMBOL_NAME(name) NAME_ENTRY(name)
PRIVATE_SYMBOL_LIST(SYMBOL_NAME)
#undef SYMBOL_NAME
-#define SYMBOL_NAME(name, varname, description) NAME_ENTRY(name)
+#define SYMBOL_NAME(name, description) NAME_ENTRY(name)
PUBLIC_SYMBOL_LIST(SYMBOL_NAME)
#undef SYMBOL_NAME
#undef NAME_ENTRY
PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
-#define SYMBOL_ACCESSOR(name, varname, description) \
+#define SYMBOL_ACCESSOR(name, description) \
Symbol* Heap::name() { return Symbol::cast(roots_[k##name##RootIndex]); }
PUBLIC_SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
{
HandleScope scope(isolate());
-#define SYMBOL_INIT(name, varname, description) \
+#define SYMBOL_INIT(name, description) \
Handle<Symbol> name = factory->NewSymbol(); \
Handle<String> name##d = factory->NewStringFromStaticChars(#description); \
name->set_name(*name##d); \
V(multiline_string, "multiline") \
V(sticky_string, "sticky") \
V(unicode_string, "unicode") \
- V(harmony_regexps_string, "harmony_regexps") \
- V(harmony_tostring_string, "harmony_tostring") \
- V(harmony_unicode_regexps_string, "harmony_unicode_regexps") \
V(input_string, "input") \
V(index_string, "index") \
V(last_index_string, "lastIndex") \
V(string_iterator_next_index_symbol) \
V(uninitialized_symbol)
-
-#define PUBLIC_SYMBOL_LIST(V) \
- V(has_instance_symbol, symbolHasInstance, Symbol.hasInstance) \
- V(is_concat_spreadable_symbol, symbolIsConcatSpreadable, \
- Symbol.isConcatSpreadable) \
- V(is_regexp_symbol, symbolIsRegExp, Symbol.isRegExp) \
- V(iterator_symbol, symbolIterator, Symbol.iterator) \
- V(to_primitive_symbol, symbolToPrimitive, Symbol.toPrimitive) \
- V(to_string_tag_symbol, symbolToStringTag, Symbol.toStringTag) \
- V(unscopables_symbol, symbolUnscopables, Symbol.unscopables)
+#define PUBLIC_SYMBOL_LIST(V) \
+ V(has_instance_symbol, Symbol.hasInstance) \
+ V(is_concat_spreadable_symbol, Symbol.isConcatSpreadable) \
+ V(is_regexp_symbol, Symbol.isRegExp) \
+ V(iterator_symbol, Symbol.iterator) \
+ V(to_primitive_symbol, Symbol.toPrimitive) \
+ V(to_string_tag_symbol, Symbol.toStringTag) \
+ V(unscopables_symbol, Symbol.unscopables)
// Heap roots that are known to be immortal immovable, for which we can safely
// skip write barriers. This list is not complete and has omissions.
PRIVATE_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
#undef SYMBOL_INDEX_DECLARATION
-#define SYMBOL_INDEX_DECLARATION(name, varname, description) k##name##RootIndex,
+#define SYMBOL_INDEX_DECLARATION(name, description) k##name##RootIndex,
PUBLIC_SYMBOL_LIST(SYMBOL_INDEX_DECLARATION)
#undef SYMBOL_INDEX_DECLARATION
PRIVATE_SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
-#define SYMBOL_ACCESSOR(name, varname, description) inline Symbol* name();
+#define SYMBOL_ACCESSOR(name, description) inline Symbol* name();
PUBLIC_SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
var GlobalRegExp = global.RegExp;
var GlobalString = global.String;
var MathFloor;
+var ObjectDefineProperties = utils.ImportNow("ObjectDefineProperties");
+var ObjectDefineProperty = utils.ImportNow("ObjectDefineProperty");
var RegExpTest;
var StringIndexOf;
var StringLastIndexOf;
ToNumber = from.ToNumber;
});
-utils.ImportNow(function(from) {
- ObjectDefineProperties = from.ObjectDefineProperties;
- ObjectDefineProperty = from.ObjectDefineProperty;
-});
-
// -------------------------------------------------------------------
var Intl = {};
%CheckIsBootstrapping();
var GlobalObject = global.Object;
+ var iteratorSymbol = utils.ImportNow("iterator_symbol");
// 25.1.2.1 %IteratorPrototype% [ @@iterator ] ( )
function IteratorPrototypeIterator() {
return this;
}
- utils.SetFunctionName(IteratorPrototypeIterator, symbolIterator);
- %AddNamedProperty($iteratorPrototype, symbolIterator,
+ utils.SetFunctionName(IteratorPrototypeIterator, iteratorSymbol);
+ %AddNamedProperty($iteratorPrototype, iteratorSymbol,
IteratorPrototypeIterator, DONT_ENUM);
})
var ObjectHasOwnProperty;
var ToNumber;
var ToString;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
MathMax = from.MathMax;
// -------------------------------------------------------------------
-%AddNamedProperty(GlobalJSON, symbolToStringTag, "JSON", READ_ONLY | DONT_ENUM);
+%AddNamedProperty(GlobalJSON, toStringTagSymbol, "JSON", READ_ONLY | DONT_ENUM);
// Set up non-enumerable properties of the JSON object.
utils.InstallFunctions(GlobalJSON, DONT_ENUM, [
var GlobalMath = global.Math;
var GlobalObject = global.Object;
var InternalArray = utils.InternalArray;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
//-------------------------------------------------------------------
// -------------------------------------------------------------------
-%AddNamedProperty(GlobalMath, symbolToStringTag, "Math", READ_ONLY | DONT_ENUM);
+%AddNamedProperty(GlobalMath, toStringTagSymbol, "Math", READ_ONLY | DONT_ENUM);
// Set up math constants.
utils.InstallConstants(GlobalMath, [
var Bool32x4ToString;
var Bool8x16ToString;
var callSiteReceiverSymbol =
- utils.GetPrivateSymbol("call_site_receiver_symbol");
+ utils.ImportNow("call_site_receiver_symbol");
var callSiteFunctionSymbol =
- utils.GetPrivateSymbol("call_site_function_symbol");
+ utils.ImportNow("call_site_function_symbol");
var callSitePositionSymbol =
- utils.GetPrivateSymbol("call_site_position_symbol");
-var callSiteStrictSymbol = utils.GetPrivateSymbol("call_site_strict_symbol");
+ utils.ImportNow("call_site_position_symbol");
+var callSiteStrictSymbol =
+ utils.ImportNow("call_site_strict_symbol");
var Float32x4ToString;
var formattedStackTraceSymbol =
- utils.GetPrivateSymbol("formatted_stack_trace_symbol");
+ utils.ImportNow("formatted_stack_trace_symbol");
var FunctionSourceString
var GlobalObject = global.Object;
var Int16x8ToString;
var Int32x4ToString;
var Int8x16ToString;
var InternalArray = utils.InternalArray;
-var internalErrorSymbol = utils.GetPrivateSymbol("internal_error_symbol");
+var internalErrorSymbol = utils.ImportNow("internal_error_symbol");
var ObjectDefineProperty;
var ObjectToString;
-var stackTraceSymbol = utils.GetPrivateSymbol("stack_trace_symbol");
+var stackTraceSymbol = utils.ImportNow("stack_trace_symbol");
var StringCharAt;
var StringIndexOf;
var StringSubstring;
-var ToString;
+var SymbolToString;
+var ToString = utils.ImportNow("ToString");
var Uint16x8ToString;
var Uint32x4ToString;
var Uint8x16ToString;
StringCharAt = from.StringCharAt;
StringIndexOf = from.StringIndexOf;
StringSubstring = from.StringSubstring;
+ SymbolToString = from.SymbolToString;
Uint16x8ToString = from.Uint16x8ToString;
Uint32x4ToString = from.Uint32x4ToString;
Uint8x16ToString = from.Uint8x16ToString;
});
-utils.ImportNow(function(from) {
- ToString = from.ToString;
-});
-
// -------------------------------------------------------------------
var GlobalError;
}
return str;
}
- if (IS_SYMBOL(obj)) return %_CallFunction(obj, $symbolToString);
+ if (IS_SYMBOL(obj)) return %_CallFunction(obj, SymbolToString);
if (IS_SIMD_VALUE(obj)) {
switch (typeof(obj)) {
case 'float32x4': return %_CallFunction(obj, Float32x4ToString);
var imports = UNDEFINED;
var imports_from_experimental = UNDEFINED;
-var exports_container = {};
+var exports_container = %ExportFromRuntime({});
// Export to other scripts.
// In normal natives, this exports functions to other normal natives.
imports = f;
}
+
// Import immediately from exports of previous scripts. We need this for
// functions called during bootstrapping. Hooking up imports in PostNatives
// would be too late.
-function ImportNow(f) {
- f(exports_container);
+function ImportNow(name) {
+ return exports_container[name];
}
}
-var private_symbols = %ExportPrivateSymbols({});
-
-function GetPrivateSymbol(name) {
- return private_symbols[name];
-}
-
// -----------------------------------------------------------------------
// To be called by bootstrapper
"ObjectIsFrozen",
"ObjectDefineProperty",
"OwnPropertyKeys",
+ "SymbolToString",
"ToNameArray",
"ToBoolean",
"ToNumber",
"ToString",
+ // From runtime:
+ "is_concat_spreadable_symbol",
+ "iterator_symbol",
+ "promise_status_symbol",
+ "promise_value_symbol",
+ "reflect_apply",
+ "reflect_construct",
+ "to_string_tag_symbol",
];
var filtered_exports = {};
function PostExperimentals(utils) {
%CheckIsBootstrapping();
-
+ %ExportExperimentalFromRuntime(exports_container);
for ( ; !IS_UNDEFINED(imports); imports = imports.next) {
imports(exports_container);
}
}
exports_container = UNDEFINED;
- private_symbols = UNDEFINED;
utils.PostExperimentals = UNDEFINED;
utils.PostDebug = UNDEFINED;
}
exports_container = UNDEFINED;
- private_symbols = UNDEFINED;
utils.PostDebug = UNDEFINED;
utils.PostExperimentals = UNDEFINED;
// -----------------------------------------------------------------------
-%OptimizeObjectForAddingMultipleProperties(utils, 14);
+%OptimizeObjectForAddingMultipleProperties(utils, 13);
utils.Import = Import;
utils.ImportNow = ImportNow;
utils.Export = Export;
utils.ImportFromExperimental = ImportFromExperimental;
-utils.GetPrivateSymbol = GetPrivateSymbol;
utils.SetFunctionName = SetFunctionName;
utils.InstallConstants = InstallConstants;
utils.InstallFunctions = InstallFunctions;
var InternalArray = utils.InternalArray;
var promiseHasHandlerSymbol =
- utils.GetPrivateSymbol("promise_has_handler_symbol");
-var promiseOnRejectSymbol = utils.GetPrivateSymbol("promise_on_reject_symbol");
+ utils.ImportNow("promise_has_handler_symbol");
+var promiseOnRejectSymbol = utils.ImportNow("promise_on_reject_symbol");
var promiseOnResolveSymbol =
- utils.GetPrivateSymbol("promise_on_resolve_symbol");
-var promiseRawSymbol = utils.GetPrivateSymbol("promise_raw_symbol");
-var promiseStatusSymbol = utils.GetPrivateSymbol("promise_status_symbol");
-var promiseValueSymbol = utils.GetPrivateSymbol("promise_value_symbol");
+ utils.ImportNow("promise_on_resolve_symbol");
+var promiseRawSymbol = utils.ImportNow("promise_raw_symbol");
+var promiseStatusSymbol = utils.ImportNow("promise_status_symbol");
+var promiseValueSymbol = utils.ImportNow("promise_value_symbol");
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
// -------------------------------------------------------------------
// Install exported functions.
%AddNamedProperty(global, 'Promise', GlobalPromise, DONT_ENUM);
-%AddNamedProperty(GlobalPromise.prototype, symbolToStringTag, "Promise",
+%AddNamedProperty(GlobalPromise.prototype, toStringTagSymbol, "Promise",
DONT_ENUM | READ_ONLY);
utils.InstallFunctions(GlobalPromise, DONT_ENUM, [
// found in the LICENSE file.
var $regexpLastMatchInfoOverride;
-var harmony_regexps = false;
-var harmony_unicode_regexps = false;
(function(global, utils) {
// -------------------------------------------------------------------
// Imports
+var FLAG_harmony_regexps;
+var FLAG_harmony_unicode_regexps;
var GlobalRegExp = global.RegExp;
var InternalPackedArray = utils.InternalPackedArray;
var ToNumber;
ToNumber = from.ToNumber;
});
+utils.ImportFromExperimental(function(from) {
+ FLAG_harmony_regexps = from.FLAG_harmony_regexps;
+ FLAG_harmony_unicode_regexps = from.FLAG_harmony_unicode_regexps;
+});
+
// -------------------------------------------------------------------
// Property of the builtins object for recording the result of the last
flags = (pattern.global ? 'g' : '')
+ (pattern.ignoreCase ? 'i' : '')
+ (pattern.multiline ? 'm' : '');
- if (harmony_unicode_regexps)
+ if (FLAG_harmony_unicode_regexps)
flags += (pattern.unicode ? 'u' : '');
- if (harmony_regexps)
+ if (FLAG_harmony_regexps)
flags += (pattern.sticky ? 'y' : '');
pattern = pattern.source;
}
// algorithm, step 5) even if the value is discarded for non-global RegExps.
var i = TO_INTEGER(lastIndex);
- var updateLastIndex = this.global || (harmony_regexps && this.sticky);
+ var updateLastIndex = this.global || (FLAG_harmony_regexps && this.sticky);
if (updateLastIndex) {
if (i < 0 || i > string.length) {
this.lastIndex = 0;
// algorithm, step 5) even if the value is discarded for non-global RegExps.
var i = TO_INTEGER(lastIndex);
- if (this.global || (harmony_regexps && this.sticky)) {
+ if (this.global || (FLAG_harmony_regexps && this.sticky)) {
if (i < 0 || i > string.length) {
this.lastIndex = 0;
return false;
if (this.global) result += 'g';
if (this.ignoreCase) result += 'i';
if (this.multiline) result += 'm';
- if (harmony_unicode_regexps && this.unicode) result += 'u';
- if (harmony_regexps && this.sticky) result += 'y';
+ if (FLAG_harmony_unicode_regexps && this.unicode) result += 'u';
+ if (FLAG_harmony_regexps && this.sticky) result += 'y';
return result;
}
var GlobalBoolean = global.Boolean;
var GlobalString = global.String;
var GlobalNumber = global.Number;
+var isConcatSpreadableSymbol =
+ utils.ImportNow("is_concat_spreadable_symbol");
// ----------------------------------------------------------------------------
// ES6, draft 10-14-14, section 22.1.3.1.1
function IsConcatSpreadable(O) {
if (!IS_SPEC_OBJECT(O)) return false;
- var spreadable = O[symbolIsConcatSpreadable];
+ var spreadable = O[isConcatSpreadableSymbol];
if (IS_UNDEFINED(spreadable)) return IS_ARRAY(O);
return ToBoolean(spreadable);
}
}
-RUNTIME_FUNCTION(Runtime_ExportPrivateSymbols) {
+RUNTIME_FUNCTION(Runtime_ExportFromRuntime) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSObject, container, 0);
RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
JSObject::NormalizeProperties(container, KEEP_INOBJECT_PROPERTIES, 10,
- "ExportPrivateSymbols");
- Bootstrapper::ExportPrivateSymbols(isolate, container);
- JSObject::MigrateSlowToFast(container, 0, "ExportPrivateSymbols");
+ "ExportFromRuntime");
+ Bootstrapper::ExportFromRuntime(isolate, container);
+ JSObject::MigrateSlowToFast(container, 0, "ExportFromRuntime");
+ return *container;
+}
+
+
+RUNTIME_FUNCTION(Runtime_ExportExperimentalFromRuntime) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, container, 0);
+ RUNTIME_ASSERT(isolate->bootstrapper()->IsActive());
+ JSObject::NormalizeProperties(container, KEEP_INOBJECT_PROPERTIES, 10,
+ "ExportExperimentalFromRuntime");
+ Bootstrapper::ExportExperimentalFromRuntime(isolate, container);
+ JSObject::MigrateSlowToFast(container, 0, "ExportExperimentalFromRuntime");
return *container;
}
#define FOR_EACH_INTRINSIC_INTERNAL(F) \
F(CheckIsBootstrapping, 0, 1) \
- F(ExportPrivateSymbols, 1, 1) \
+ F(ExportFromRuntime, 1, 1) \
+ F(ExportExperimentalFromRuntime, 1, 1) \
F(InstallToContext, 1, 1) \
F(Throw, 1, 1) \
F(ReThrow, 1, 1) \
var ArrayIteratorCreateResultObject;
var GlobalString = global.String;
+var iteratorSymbol = utils.ImportNow("iterator_symbol");
var stringIteratorIteratedStringSymbol =
- utils.GetPrivateSymbol("string_iterator_iterated_string_symbol");
+ utils.ImportNow("string_iterator_iterated_string_symbol");
var stringIteratorNextIndexSymbol =
- utils.GetPrivateSymbol("string_iterator_next_index_symbol");
+ utils.ImportNow("string_iterator_next_index_symbol");
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
ArrayIteratorCreateResultObject = from.ArrayIteratorCreateResultObject;
utils.InstallFunctions(StringIterator.prototype, DONT_ENUM, [
'next', StringIteratorNext
]);
-%AddNamedProperty(StringIterator.prototype, symbolToStringTag,
+%AddNamedProperty(StringIterator.prototype, toStringTagSymbol,
"String Iterator", READ_ONLY | DONT_ENUM);
-utils.SetFunctionName(StringPrototypeIterator, symbolIterator);
-%AddNamedProperty(GlobalString.prototype, symbolIterator,
+utils.SetFunctionName(StringPrototypeIterator, iteratorSymbol);
+%AddNamedProperty(GlobalString.prototype, iteratorSymbol,
StringPrototypeIterator, DONT_ENUM);
})
var RegExpExec;
var RegExpExecNoTests;
var RegExpLastMatchInfo;
+var SymbolToString;
var ToNumber;
var ToString;
RegExpExec = from.RegExpExec;
RegExpExecNoTests = from.RegExpExecNoTests;
RegExpLastMatchInfo = from.RegExpLastMatchInfo;
+ SymbolToString = from.SymbolToString;
ToNumber = from.ToNumber;
ToString = from.ToString;
});
%_SetValueOf(this, TO_STRING_INLINE(x));
} else {
return IS_SYMBOL(x) ?
- %_CallFunction(x, $symbolToString) : TO_STRING_INLINE(x);
+ %_CallFunction(x, SymbolToString) : TO_STRING_INLINE(x);
}
}
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Expects following symbols to be set in the bootstrapper during genesis:
-// - symbolHasInstance
-// - symbolIsConcatSpreadable
-// - symbolIsRegExp
-// - symbolIterator
-// - symbolToPrimitive
-// - symbolToStringTag
-// - symbolUnscopables
-
-var $symbolToString;
-
(function(global, utils) {
"use strict";
var GlobalObject = global.Object;
var GlobalSymbol = global.Symbol;
+var hasInstanceSymbol = utils.ImportNow("has_instance_symbol");
+var isConcatSpreadableSymbol =
+ utils.ImportNow("is_concat_spreadable_symbol");
+var isRegExpSymbol = utils.ImportNow("is_regexp_symbol");
+var iteratorSymbol = utils.ImportNow("iterator_symbol");
var ObjectGetOwnPropertyKeys;
+var toPrimitiveSymbol = utils.ImportNow("to_primitive_symbol");
var ToString;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
+var unscopablesSymbol = utils.ImportNow("unscopables_symbol");
utils.Import(function(from) {
ObjectGetOwnPropertyKeys = from.ObjectGetOwnPropertyKeys;
return ObjectGetOwnPropertyKeys(obj, PROPERTY_ATTRIBUTES_STRING);
}
-//-------------------------------------------------------------------
+// -------------------------------------------------------------------
%SetCode(GlobalSymbol, SymbolConstructor);
%FunctionSetPrototype(GlobalSymbol, new GlobalObject());
utils.InstallConstants(GlobalSymbol, [
// TODO(rossberg): expose when implemented.
- // "hasInstance", symbolHasInstance,
- // "isConcatSpreadable", symbolIsConcatSpreadable,
- // "isRegExp", symbolIsRegExp,
- "iterator", symbolIterator,
- "toPrimitive", symbolToPrimitive,
+ // "hasInstance", hasInstanceSymbol,
+ // "isConcatSpreadable", isConcatSpreadableSymbol,
+ // "isRegExp", isRegExpSymbol,
+ "iterator", iteratorSymbol,
+ "toPrimitive", toPrimitiveSymbol,
// TODO(dslomov, caitp): Currently defined in harmony-tostring.js ---
// Move here when shipping
- // "toStringTag", symbolToStringTag,
- "unscopables", symbolUnscopables
+ // "toStringTag", toStringTagSymbol,
+ "unscopables", unscopablesSymbol,
]);
utils.InstallFunctions(GlobalSymbol, DONT_ENUM, [
%AddNamedProperty(
GlobalSymbol.prototype, "constructor", GlobalSymbol, DONT_ENUM);
-utils.SetFunctionName(SymbolToPrimitive, symbolToPrimitive);
+utils.SetFunctionName(SymbolToPrimitive, toPrimitiveSymbol);
%AddNamedProperty(
- GlobalSymbol.prototype, symbolToPrimitive, SymbolToPrimitive,
+ GlobalSymbol.prototype, toPrimitiveSymbol, SymbolToPrimitive,
DONT_ENUM | READ_ONLY);
%AddNamedProperty(
- GlobalSymbol.prototype, symbolToStringTag, "Symbol", DONT_ENUM | READ_ONLY);
+ GlobalSymbol.prototype, toStringTagSymbol, "Symbol", DONT_ENUM | READ_ONLY);
utils.InstallFunctions(GlobalSymbol.prototype, DONT_ENUM, [
"toString", SymbolToString,
"getOwnPropertySymbols", ObjectGetOwnPropertySymbols
]);
-$symbolToString = SymbolToString;
+// -------------------------------------------------------------------
+// Exports
+
+utils.Export(function(to) {
+ to.SymbolToString = SymbolToString;
+})
})
var GlobalArrayBuffer = global.ArrayBuffer;
var GlobalDataView = global.DataView;
var GlobalObject = global.Object;
+var iteratorSymbol = utils.ImportNow("iterator_symbol");
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
macro TYPED_ARRAYS(FUNCTION)
// arrayIds below should be synchronized with Runtime_TypedArrayInitialize.
};
// TODO(littledan): Computed properties don't work yet in nosnap.
// Rephrase when they do.
- newIterable[symbolIterator] = function() { return iterator; }
+ newIterable[iteratorSymbol] = function() { return iterator; }
for (var value of newIterable) {
list.push(value);
}
IS_BOOLEAN(arg1) || IS_UNDEFINED(arg1)) {
NAMEConstructByLength(this, arg1);
} else {
- var iteratorFn = arg1[symbolIterator];
+ var iteratorFn = arg1[iteratorSymbol];
if (IS_UNDEFINED(iteratorFn) || iteratorFn === $arrayValues) {
NAMEConstructByArrayLike(this, arg1);
} else {
DONT_ENUM | DONT_DELETE);
utils.InstallGetter(GlobalNAME.prototype, "length", NAME_GetLength,
DONT_ENUM | DONT_DELETE);
- utils.InstallGetter(GlobalNAME.prototype, symbolToStringTag,
+ utils.InstallGetter(GlobalNAME.prototype, toStringTagSymbol,
TypedArrayGetToStringTag);
utils.InstallFunctions(GlobalNAME.prototype, DONT_ENUM, [
"subarray", NAMESubArray,
// Set up constructor property on the DataView prototype.
%AddNamedProperty(GlobalDataView.prototype, "constructor", GlobalDataView,
DONT_ENUM);
-%AddNamedProperty(GlobalDataView.prototype, symbolToStringTag, "DataView",
+%AddNamedProperty(GlobalDataView.prototype, toStringTagSymbol, "DataView",
READ_ONLY|DONT_ENUM);
utils.InstallGetter(GlobalDataView.prototype, "buffer", DataViewGetBufferJS);
// ----------------------------------------------------------------------------
// Imports
+var FLAG_harmony_tostring;
var GlobalArray = global.Array;
var GlobalBoolean = global.Boolean;
var GlobalFunction = global.Function;
var GlobalNumber = global.Number;
var GlobalObject = global.Object;
var InternalArray = utils.InternalArray;
+var iteratorSymbol = utils.ImportNow("iterator_symbol");
var MathAbs;
var ProxyDelegateCallAndConstruct;
var ProxyDerivedHasOwnTrap;
var ProxyDerivedKeysTrap;
var StringIndexOf;
-var ToBoolean;
-var ToNumber;
+var ToBoolean = utils.ImportNow("ToBoolean");
+var ToNumber = utils.ImportNow("ToNumber");
var ToString;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
MathAbs = from.MathAbs;
ToString = from.ToString;
});
-utils.ImportNow(function(from) {
- ToBoolean = from.ToBoolean;
- ToNumber = from.ToNumber;
-});
-
utils.ImportFromExperimental(function(from) {
+ FLAG_harmony_tostring = from.FLAG_harmony_tostring;
ProxyDelegateCallAndConstruct = from.ProxyDelegateCallAndConstruct;
ProxyDerivedHasOwnTrap = from.ProxyDerivedHasOwnTrap;
ProxyDerivedKeysTrap = from.ProxyDerivedKeysTrap;
var tag;
// TODO(caitp): cannot wait to get rid of this flag :>
- if (harmony_tostring) {
- tag = O[symbolToStringTag];
+ if (FLAG_harmony_tostring) {
+ tag = O[toStringTagSymbol];
if (!IS_STRING(tag)) {
tag = builtinTag;
}
// 7.4.1 GetIterator ( obj, method )
function GetIterator(obj, method) {
if (IS_UNDEFINED(method)) {
- method = obj[symbolIterator];
+ method = obj[iteratorSymbol];
}
if (!IS_SPEC_FUNCTION(method)) {
throw MakeTypeError(kNotIterable, obj);
var GlobalObject = global.Object;
var GlobalWeakMap = global.WeakMap;
var GlobalWeakSet = global.WeakSet;
+var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
// -------------------------------------------------------------------
// Harmony WeakMap
%FunctionSetPrototype(GlobalWeakMap, new GlobalObject());
%AddNamedProperty(GlobalWeakMap.prototype, "constructor", GlobalWeakMap,
DONT_ENUM);
-%AddNamedProperty(GlobalWeakMap.prototype, symbolToStringTag, "WeakMap",
+%AddNamedProperty(GlobalWeakMap.prototype, toStringTagSymbol, "WeakMap",
DONT_ENUM | READ_ONLY);
// Set up the non-enumerable functions on the WeakMap prototype object.
%FunctionSetPrototype(GlobalWeakSet, new GlobalObject());
%AddNamedProperty(GlobalWeakSet.prototype, "constructor", GlobalWeakSet,
DONT_ENUM);
-%AddNamedProperty(GlobalWeakSet.prototype, symbolToStringTag, "WeakSet",
+%AddNamedProperty(GlobalWeakSet.prototype, toStringTagSymbol, "WeakSet",
DONT_ENUM | READ_ONLY);
// Set up the non-enumerable functions on the WeakSet prototype object.