Index: src/symbol.js |
diff --git a/src/symbol.js b/src/symbol.js |
index 49f909694c19f3ee44c60a39def7fbbd0f39c6a5..7bf10d1288967c222108c451f987735e2420b2b4 100644 |
--- a/src/symbol.js |
+++ b/src/symbol.js |
@@ -65,7 +65,7 @@ function SymbolValueOf() { |
function GetSymbolRegistry() { |
var registry = %SymbolRegistry(); |
- if (!('internal' in registry)) { |
+ if (IS_UNDEFINED(registry.internal)) { |
registry.internal = {__proto__: null}; |
registry.for = {__proto__: null}; |
registry.keyFor = {__proto__: null}; |
@@ -76,7 +76,7 @@ function GetSymbolRegistry() { |
function InternalSymbol(key) { |
var registry = GetSymbolRegistry(); |
- if (!(key in registry.internal)) { |
+ if (IS_UNDEFINED(registry.internal[key])) { |
registry.internal[key] = %CreateSymbol(key); |
} |
return registry.internal[key]; |
@@ -86,7 +86,7 @@ function InternalSymbol(key) { |
function SymbolFor(key) { |
key = TO_STRING_INLINE(key); |
var registry = GetSymbolRegistry(); |
- if (!(key in registry.for)) { |
+ if (IS_UNDEFINED(registry.for[key])) { |
var symbol = %CreateSymbol(key); |
registry.for[key] = symbol; |
registry.keyFor[symbol] = key; |
@@ -118,13 +118,13 @@ function ObjectGetOwnPropertySymbols(obj) { |
//------------------------------------------------------------------- |
-var symbolCreate = InternalSymbol("@@create"); |
-var symbolHasInstance = InternalSymbol("@@hasInstance"); |
-var symbolIsConcatSpreadable = InternalSymbol("@@isConcatSpreadable"); |
-var symbolIsRegExp = InternalSymbol("@@isRegExp"); |
-var symbolIterator = InternalSymbol("@@iterator"); |
-var symbolToStringTag = InternalSymbol("@@toStringTag"); |
-var symbolUnscopables = InternalSymbol("@@unscopables"); |
+var symbolCreate = InternalSymbol("Symbol.create"); |
+var symbolHasInstance = InternalSymbol("Symbol.hasInstance"); |
+var symbolIsConcatSpreadable = InternalSymbol("Symbol.isConcatSpreadable"); |
+var symbolIsRegExp = InternalSymbol("Symbol.isRegExp"); |
+var symbolIterator = InternalSymbol("Symbol.iterator"); |
+var symbolToStringTag = InternalSymbol("Symbol.toStringTag"); |
+var symbolUnscopables = InternalSymbol("Symbol.unscopables"); |
//------------------------------------------------------------------- |
@@ -135,14 +135,15 @@ function SetUpSymbol() { |
%SetCode($Symbol, SymbolConstructor); |
%FunctionSetPrototype($Symbol, new $Object()); |
- %SetProperty($Symbol, "create", symbolCreate, DONT_ENUM); |
- %SetProperty($Symbol, "hasInstance", symbolHasInstance, DONT_ENUM); |
- %SetProperty($Symbol, "isConcatSpreadable", |
- symbolIsConcatSpreadable, DONT_ENUM); |
- %SetProperty($Symbol, "isRegExp", symbolIsRegExp, DONT_ENUM); |
- %SetProperty($Symbol, "iterator", symbolIterator, DONT_ENUM); |
- %SetProperty($Symbol, "toStringTag", symbolToStringTag, DONT_ENUM); |
- %SetProperty($Symbol, "unscopables", symbolUnscopables, DONT_ENUM); |
+ InstallConstants($Symbol, $Array( |
+ "create", symbolCreate, |
+ "hasInstance", symbolHasInstance, |
+ "isConcatSpreadable", symbolIsConcatSpreadable, |
+ "isRegExp", symbolIsRegExp, |
+ "iterator", symbolIterator, |
+ "toStringTag", symbolToStringTag, |
+ "unscopables", symbolUnscopables |
+ )); |
InstallFunctions($Symbol, DONT_ENUM, $Array( |
"for", SymbolFor, |
"keyFor", SymbolKeyFor |