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 "use strict"; | 5 "use strict"; |
6 | 6 |
7 // This file relies on the fact that the following declaration has been made | 7 // This file relies on the fact that the following declaration has been made |
8 // in runtime.js: | 8 // in runtime.js: |
9 // var $Array = global.Array; | 9 // var $Array = global.Array; |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 | 94 |
95 %SetCode($Symbol, SymbolConstructor); | 95 %SetCode($Symbol, SymbolConstructor); |
96 %FunctionSetPrototype($Symbol, new $Object()); | 96 %FunctionSetPrototype($Symbol, new $Object()); |
97 | 97 |
98 InstallConstants($Symbol, $Array( | 98 InstallConstants($Symbol, $Array( |
99 // TODO(rossberg): expose when implemented. | 99 // TODO(rossberg): expose when implemented. |
100 // "hasInstance", symbolHasInstance, | 100 // "hasInstance", symbolHasInstance, |
101 // "isConcatSpreadable", symbolIsConcatSpreadable, | 101 // "isConcatSpreadable", symbolIsConcatSpreadable, |
102 // "isRegExp", symbolIsRegExp, | 102 // "isRegExp", symbolIsRegExp, |
103 "iterator", symbolIterator, | 103 "iterator", symbolIterator, |
104 // TODO: Currently defined in harmony-tostring.js --- Move here when shippin g | |
Dmitry Lomov (no reviews)
2014/10/17 19:29:06
nit: 80 column lines
caitp (gmail)
2014/10/17 20:12:13
Acknowledged.
| |
104 // "toStringTag", symbolToStringTag, | 105 // "toStringTag", symbolToStringTag, |
105 "unscopables", symbolUnscopables | 106 "unscopables", symbolUnscopables |
106 )); | 107 )); |
107 InstallFunctions($Symbol, DONT_ENUM, $Array( | 108 InstallFunctions($Symbol, DONT_ENUM, $Array( |
108 "for", SymbolFor, | 109 "for", SymbolFor, |
109 "keyFor", SymbolKeyFor | 110 "keyFor", SymbolKeyFor |
110 )); | 111 )); |
111 | 112 |
112 %AddNamedProperty($Symbol.prototype, "constructor", $Symbol, DONT_ENUM); | 113 %AddNamedProperty($Symbol.prototype, "constructor", $Symbol, DONT_ENUM); |
114 %AddNamedProperty( | |
115 $Symbol.prototype, symbolToStringTag, "Symbol", DONT_ENUM | READ_ONLY); | |
Dmitry Lomov (no reviews)
2014/10/17 19:29:06
Hmm, when --harmony-tostring is turned off, where
caitp (gmail)
2014/10/17 20:12:13
It's defined in both harmony-tostring.js and symbo
Dmitry Lomov (no reviews)
2014/10/18 08:41:49
Oh I see. missed that.
| |
113 InstallFunctions($Symbol.prototype, DONT_ENUM, $Array( | 116 InstallFunctions($Symbol.prototype, DONT_ENUM, $Array( |
114 "toString", SymbolToString, | 117 "toString", SymbolToString, |
115 "valueOf", SymbolValueOf | 118 "valueOf", SymbolValueOf |
116 )); | 119 )); |
117 } | 120 } |
118 | 121 |
119 SetUpSymbol(); | 122 SetUpSymbol(); |
120 | 123 |
121 | 124 |
122 function ExtendObject() { | 125 function ExtendObject() { |
123 %CheckIsBootstrapping(); | 126 %CheckIsBootstrapping(); |
124 | 127 |
125 InstallFunctions($Object, DONT_ENUM, $Array( | 128 InstallFunctions($Object, DONT_ENUM, $Array( |
126 "getOwnPropertySymbols", ObjectGetOwnPropertySymbols | 129 "getOwnPropertySymbols", ObjectGetOwnPropertySymbols |
127 )); | 130 )); |
128 } | 131 } |
129 | 132 |
130 ExtendObject(); | 133 ExtendObject(); |
OLD | NEW |