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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 | 127 |
128 // ------------------------------------------------------------------- | 128 // ------------------------------------------------------------------- |
129 | 129 |
130 function SetUpSet() { | 130 function SetUpSet() { |
131 %CheckIsBootstrapping(); | 131 %CheckIsBootstrapping(); |
132 | 132 |
133 %SetCode($Set, SetConstructor); | 133 %SetCode($Set, SetConstructor); |
134 %FunctionSetPrototype($Set, new $Object()); | 134 %FunctionSetPrototype($Set, new $Object()); |
135 %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM); | 135 %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM); |
| 136 %AddNamedProperty( |
| 137 $Set.prototype, symbolToStringTag, "Set", DONT_ENUM | READ_ONLY); |
136 | 138 |
137 %FunctionSetLength(SetForEach, 1); | 139 %FunctionSetLength(SetForEach, 1); |
138 | 140 |
139 // Set up the non-enumerable functions on the Set prototype object. | 141 // Set up the non-enumerable functions on the Set prototype object. |
140 InstallGetter($Set.prototype, "size", SetGetSizeJS); | 142 InstallGetter($Set.prototype, "size", SetGetSizeJS); |
141 InstallFunctions($Set.prototype, DONT_ENUM, $Array( | 143 InstallFunctions($Set.prototype, DONT_ENUM, $Array( |
142 "add", SetAddJS, | 144 "add", SetAddJS, |
143 "has", SetHasJS, | 145 "has", SetHasJS, |
144 "delete", SetDeleteJS, | 146 "delete", SetDeleteJS, |
145 "clear", SetClearJS, | 147 "clear", SetClearJS, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 277 |
276 | 278 |
277 // ------------------------------------------------------------------- | 279 // ------------------------------------------------------------------- |
278 | 280 |
279 function SetUpMap() { | 281 function SetUpMap() { |
280 %CheckIsBootstrapping(); | 282 %CheckIsBootstrapping(); |
281 | 283 |
282 %SetCode($Map, MapConstructor); | 284 %SetCode($Map, MapConstructor); |
283 %FunctionSetPrototype($Map, new $Object()); | 285 %FunctionSetPrototype($Map, new $Object()); |
284 %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM); | 286 %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM); |
| 287 %AddNamedProperty( |
| 288 $Map.prototype, symbolToStringTag, "Map", DONT_ENUM | READ_ONLY); |
285 | 289 |
286 %FunctionSetLength(MapForEach, 1); | 290 %FunctionSetLength(MapForEach, 1); |
287 | 291 |
288 // Set up the non-enumerable functions on the Map prototype object. | 292 // Set up the non-enumerable functions on the Map prototype object. |
289 InstallGetter($Map.prototype, "size", MapGetSizeJS); | 293 InstallGetter($Map.prototype, "size", MapGetSizeJS); |
290 InstallFunctions($Map.prototype, DONT_ENUM, $Array( | 294 InstallFunctions($Map.prototype, DONT_ENUM, $Array( |
291 "get", MapGetJS, | 295 "get", MapGetJS, |
292 "set", MapSetJS, | 296 "set", MapSetJS, |
293 "has", MapHasJS, | 297 "has", MapHasJS, |
294 "delete", MapDeleteJS, | 298 "delete", MapDeleteJS, |
295 "clear", MapClearJS, | 299 "clear", MapClearJS, |
296 "forEach", MapForEach | 300 "forEach", MapForEach |
297 )); | 301 )); |
298 } | 302 } |
299 | 303 |
300 SetUpMap(); | 304 SetUpMap(); |
OLD | NEW |