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 "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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 | 108 |
109 // ------------------------------------------------------------------- | 109 // ------------------------------------------------------------------- |
110 | 110 |
111 function SetUpWeakMap() { | 111 function SetUpWeakMap() { |
112 %CheckIsBootstrapping(); | 112 %CheckIsBootstrapping(); |
113 | 113 |
114 %SetCode($WeakMap, WeakMapConstructor); | 114 %SetCode($WeakMap, WeakMapConstructor); |
115 %FunctionSetPrototype($WeakMap, new $Object()); | 115 %FunctionSetPrototype($WeakMap, new $Object()); |
116 %AddNamedProperty($WeakMap.prototype, "constructor", $WeakMap, DONT_ENUM); | 116 %AddNamedProperty($WeakMap.prototype, "constructor", $WeakMap, DONT_ENUM); |
| 117 %AddNamedProperty( |
| 118 $WeakMap.prototype, symbolToStringTag, "WeakMap", DONT_ENUM | READ_ONLY); |
117 | 119 |
118 // Set up the non-enumerable functions on the WeakMap prototype object. | 120 // Set up the non-enumerable functions on the WeakMap prototype object. |
119 InstallFunctions($WeakMap.prototype, DONT_ENUM, $Array( | 121 InstallFunctions($WeakMap.prototype, DONT_ENUM, $Array( |
120 "get", WeakMapGet, | 122 "get", WeakMapGet, |
121 "set", WeakMapSet, | 123 "set", WeakMapSet, |
122 "has", WeakMapHas, | 124 "has", WeakMapHas, |
123 "delete", WeakMapDelete, | 125 "delete", WeakMapDelete, |
124 "clear", WeakMapClear | 126 "clear", WeakMapClear |
125 )); | 127 )); |
126 } | 128 } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 209 |
208 | 210 |
209 // ------------------------------------------------------------------- | 211 // ------------------------------------------------------------------- |
210 | 212 |
211 function SetUpWeakSet() { | 213 function SetUpWeakSet() { |
212 %CheckIsBootstrapping(); | 214 %CheckIsBootstrapping(); |
213 | 215 |
214 %SetCode($WeakSet, WeakSetConstructor); | 216 %SetCode($WeakSet, WeakSetConstructor); |
215 %FunctionSetPrototype($WeakSet, new $Object()); | 217 %FunctionSetPrototype($WeakSet, new $Object()); |
216 %AddNamedProperty($WeakSet.prototype, "constructor", $WeakSet, DONT_ENUM); | 218 %AddNamedProperty($WeakSet.prototype, "constructor", $WeakSet, DONT_ENUM); |
| 219 %AddNamedProperty( |
| 220 $WeakSet.prototype, symbolToStringTag, "WeakSet", DONT_ENUM | READ_ONLY); |
217 | 221 |
218 // Set up the non-enumerable functions on the WeakSet prototype object. | 222 // Set up the non-enumerable functions on the WeakSet prototype object. |
219 InstallFunctions($WeakSet.prototype, DONT_ENUM, $Array( | 223 InstallFunctions($WeakSet.prototype, DONT_ENUM, $Array( |
220 "add", WeakSetAdd, | 224 "add", WeakSetAdd, |
221 "has", WeakSetHas, | 225 "has", WeakSetHas, |
222 "delete", WeakSetDelete, | 226 "delete", WeakSetDelete, |
223 "clear", WeakSetClear | 227 "clear", WeakSetClear |
224 )); | 228 )); |
225 } | 229 } |
226 | 230 |
227 SetUpWeakSet(); | 231 SetUpWeakSet(); |
OLD | NEW |