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 |
11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
12 // Imports | 12 // Imports |
13 | 13 |
14 var GlobalObject = global.Object; | 14 var GlobalObject = global.Object; |
15 var GlobalSymbol = global.Symbol; | 15 var GlobalSymbol = global.Symbol; |
16 var hasInstanceSymbol = utils.ImportNow("has_instance_symbol"); | 16 var hasInstanceSymbol = utils.ImportNow("has_instance_symbol"); |
17 var isConcatSpreadableSymbol = | 17 var isConcatSpreadableSymbol = |
18 utils.ImportNow("is_concat_spreadable_symbol"); | 18 utils.ImportNow("is_concat_spreadable_symbol"); |
19 var isRegExpSymbol = utils.ImportNow("is_regexp_symbol"); | 19 var isRegExpSymbol = utils.ImportNow("is_regexp_symbol"); |
20 var iteratorSymbol = utils.ImportNow("iterator_symbol"); | 20 var iteratorSymbol = utils.ImportNow("iterator_symbol"); |
| 21 var MakeTypeError; |
21 var ObjectGetOwnPropertyKeys; | 22 var ObjectGetOwnPropertyKeys; |
22 var toPrimitiveSymbol = utils.ImportNow("to_primitive_symbol"); | 23 var toPrimitiveSymbol = utils.ImportNow("to_primitive_symbol"); |
23 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 24 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
24 var unscopablesSymbol = utils.ImportNow("unscopables_symbol"); | 25 var unscopablesSymbol = utils.ImportNow("unscopables_symbol"); |
25 | 26 |
26 utils.Import(function(from) { | 27 utils.Import(function(from) { |
| 28 MakeTypeError = from.MakeTypeError; |
27 ObjectGetOwnPropertyKeys = from.ObjectGetOwnPropertyKeys; | 29 ObjectGetOwnPropertyKeys = from.ObjectGetOwnPropertyKeys; |
28 }); | 30 }); |
29 | 31 |
30 // ------------------------------------------------------------------- | 32 // ------------------------------------------------------------------- |
31 | 33 |
32 // 19.4.3.4 Symbol.prototype [ @@toPrimitive ] ( hint ) | 34 // 19.4.3.4 Symbol.prototype [ @@toPrimitive ] ( hint ) |
33 function SymbolToPrimitive(hint) { | 35 function SymbolToPrimitive(hint) { |
34 if (!(IS_SYMBOL(this) || IS_SYMBOL_WRAPPER(this))) { | 36 if (!(IS_SYMBOL(this) || IS_SYMBOL_WRAPPER(this))) { |
35 throw MakeTypeError(kIncompatibleMethodReceiver, | 37 throw MakeTypeError(kIncompatibleMethodReceiver, |
36 "Symbol.prototype [ @@toPrimitive ]", this); | 38 "Symbol.prototype [ @@toPrimitive ]", this); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 ]); | 127 ]); |
126 | 128 |
127 // ------------------------------------------------------------------- | 129 // ------------------------------------------------------------------- |
128 // Exports | 130 // Exports |
129 | 131 |
130 utils.Export(function(to) { | 132 utils.Export(function(to) { |
131 to.SymbolToString = SymbolToString; | 133 to.SymbolToString = SymbolToString; |
132 }) | 134 }) |
133 | 135 |
134 }) | 136 }) |
OLD | NEW |