OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 GetExistingHash; | 14 var GetExistingHash; |
15 var GetHash; | 15 var GetHash; |
16 var GlobalObject = global.Object; | 16 var GlobalObject = global.Object; |
17 var GlobalWeakMap = global.WeakMap; | 17 var GlobalWeakMap = global.WeakMap; |
18 var GlobalWeakSet = global.WeakSet; | 18 var GlobalWeakSet = global.WeakSet; |
| 19 var MakeTypeError; |
19 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); | 20 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
20 | 21 |
21 utils.Import(function(from) { | 22 utils.Import(function(from) { |
22 GetExistingHash = from.GetExistingHash; | 23 GetExistingHash = from.GetExistingHash; |
23 GetHash = from.GetHash; | 24 GetHash = from.GetHash; |
| 25 MakeTypeError = from.MakeTypeError; |
24 }); | 26 }); |
25 | 27 |
26 // ------------------------------------------------------------------- | 28 // ------------------------------------------------------------------- |
27 // Harmony WeakMap | 29 // Harmony WeakMap |
28 | 30 |
29 function WeakMapConstructor(iterable) { | 31 function WeakMapConstructor(iterable) { |
30 if (!%_IsConstructCall()) { | 32 if (!%_IsConstructCall()) { |
31 throw MakeTypeError(kConstructorNotFunction, "WeakMap"); | 33 throw MakeTypeError(kConstructorNotFunction, "WeakMap"); |
32 } | 34 } |
33 | 35 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 DONT_ENUM | READ_ONLY); | 181 DONT_ENUM | READ_ONLY); |
180 | 182 |
181 // Set up the non-enumerable functions on the WeakSet prototype object. | 183 // Set up the non-enumerable functions on the WeakSet prototype object. |
182 utils.InstallFunctions(GlobalWeakSet.prototype, DONT_ENUM, [ | 184 utils.InstallFunctions(GlobalWeakSet.prototype, DONT_ENUM, [ |
183 "add", WeakSetAdd, | 185 "add", WeakSetAdd, |
184 "has", WeakSetHas, | 186 "has", WeakSetHas, |
185 "delete", WeakSetDelete | 187 "delete", WeakSetDelete |
186 ]); | 188 ]); |
187 | 189 |
188 }) | 190 }) |
OLD | NEW |