| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 (function(global, utils) { | 5 (function(global, utils) { |
| 6 | 6 |
| 7 "use strict"; | 7 "use strict"; |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 utils.InstallConstants(GlobalSymbol, [ | 77 utils.InstallConstants(GlobalSymbol, [ |
| 78 "hasInstance", hasInstanceSymbol, | 78 "hasInstance", hasInstanceSymbol, |
| 79 "isConcatSpreadable", isConcatSpreadableSymbol, | 79 "isConcatSpreadable", isConcatSpreadableSymbol, |
| 80 "iterator", iteratorSymbol, | 80 "iterator", iteratorSymbol, |
| 81 // TODO(yangguo): expose when implemented. | 81 // TODO(yangguo): expose when implemented. |
| 82 // "match", matchSymbol, | 82 // "match", matchSymbol, |
| 83 // "replace", replaceSymbol, | 83 // "replace", replaceSymbol, |
| 84 // "search", searchSymbol, | 84 // "search", searchSymbol, |
| 85 // "split, splitSymbol, | 85 // "split, splitSymbol, |
| 86 "toPrimitive", toPrimitiveSymbol, | 86 "toPrimitive", toPrimitiveSymbol, |
| 87 // TODO(dslomov, caitp): Currently defined in harmony-tostring.js --- | 87 "toStringTag", toStringTagSymbol, |
| 88 // Move here when shipping | |
| 89 // "toStringTag", toStringTagSymbol, | |
| 90 "unscopables", unscopablesSymbol, | 88 "unscopables", unscopablesSymbol, |
| 91 ]); | 89 ]); |
| 92 | 90 |
| 93 utils.InstallFunctions(GlobalSymbol, DONT_ENUM, [ | 91 utils.InstallFunctions(GlobalSymbol, DONT_ENUM, [ |
| 94 "for", SymbolFor, | 92 "for", SymbolFor, |
| 95 "keyFor", SymbolKeyFor | 93 "keyFor", SymbolKeyFor |
| 96 ]); | 94 ]); |
| 97 | 95 |
| 98 %AddNamedProperty( | 96 %AddNamedProperty( |
| 99 GlobalSymbol.prototype, toStringTagSymbol, "Symbol", DONT_ENUM | READ_ONLY); | 97 GlobalSymbol.prototype, toStringTagSymbol, "Symbol", DONT_ENUM | READ_ONLY); |
| 100 | 98 |
| 101 utils.InstallFunctions(GlobalSymbol.prototype, DONT_ENUM | READ_ONLY, [ | 99 utils.InstallFunctions(GlobalSymbol.prototype, DONT_ENUM | READ_ONLY, [ |
| 102 toPrimitiveSymbol, SymbolToPrimitive | 100 toPrimitiveSymbol, SymbolToPrimitive |
| 103 ]); | 101 ]); |
| 104 | 102 |
| 105 utils.InstallFunctions(GlobalSymbol.prototype, DONT_ENUM, [ | 103 utils.InstallFunctions(GlobalSymbol.prototype, DONT_ENUM, [ |
| 106 "toString", SymbolToString, | 104 "toString", SymbolToString, |
| 107 "valueOf", SymbolValueOf | 105 "valueOf", SymbolValueOf |
| 108 ]); | 106 ]); |
| 109 | 107 |
| 110 // ------------------------------------------------------------------- | 108 // ------------------------------------------------------------------- |
| 111 // Exports | 109 // Exports |
| 112 | 110 |
| 113 utils.Export(function(to) { | 111 utils.Export(function(to) { |
| 114 to.SymbolToString = SymbolToString; | 112 to.SymbolToString = SymbolToString; |
| 115 }) | 113 }) |
| 116 | 114 |
| 117 }) | 115 }) |
| OLD | NEW |