| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 | 120 |
| 121 // ------------------------------------------------------------------- | 121 // ------------------------------------------------------------------- |
| 122 | 122 |
| 123 function SetUpSet() { | 123 function SetUpSet() { |
| 124 %CheckIsBootstrapping(); | 124 %CheckIsBootstrapping(); |
| 125 | 125 |
| 126 %SetCode($Set, SetConstructor); | 126 %SetCode($Set, SetConstructor); |
| 127 %FunctionSetPrototype($Set, new $Object()); | 127 %FunctionSetPrototype($Set, new $Object()); |
| 128 %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM); | 128 %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM); |
| 129 %AddNamedProperty( |
| 130 $Set.prototype, symbolToStringTag, "Set", DONT_ENUM | READ_ONLY); |
| 129 | 131 |
| 130 %FunctionSetLength(SetForEach, 1); | 132 %FunctionSetLength(SetForEach, 1); |
| 131 | 133 |
| 132 // Set up the non-enumerable functions on the Set prototype object. | 134 // Set up the non-enumerable functions on the Set prototype object. |
| 133 InstallGetter($Set.prototype, "size", SetGetSizeJS); | 135 InstallGetter($Set.prototype, "size", SetGetSizeJS); |
| 134 InstallFunctions($Set.prototype, DONT_ENUM, $Array( | 136 InstallFunctions($Set.prototype, DONT_ENUM, $Array( |
| 135 "add", SetAddJS, | 137 "add", SetAddJS, |
| 136 "has", SetHasJS, | 138 "has", SetHasJS, |
| 137 "delete", SetDeleteJS, | 139 "delete", SetDeleteJS, |
| 138 "clear", SetClearJS, | 140 "clear", SetClearJS, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 263 |
| 262 | 264 |
| 263 // ------------------------------------------------------------------- | 265 // ------------------------------------------------------------------- |
| 264 | 266 |
| 265 function SetUpMap() { | 267 function SetUpMap() { |
| 266 %CheckIsBootstrapping(); | 268 %CheckIsBootstrapping(); |
| 267 | 269 |
| 268 %SetCode($Map, MapConstructor); | 270 %SetCode($Map, MapConstructor); |
| 269 %FunctionSetPrototype($Map, new $Object()); | 271 %FunctionSetPrototype($Map, new $Object()); |
| 270 %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM); | 272 %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM); |
| 273 %AddNamedProperty( |
| 274 $Map.prototype, symbolToStringTag, "Map", DONT_ENUM | READ_ONLY); |
| 271 | 275 |
| 272 %FunctionSetLength(MapForEach, 1); | 276 %FunctionSetLength(MapForEach, 1); |
| 273 | 277 |
| 274 // Set up the non-enumerable functions on the Map prototype object. | 278 // Set up the non-enumerable functions on the Map prototype object. |
| 275 InstallGetter($Map.prototype, "size", MapGetSizeJS); | 279 InstallGetter($Map.prototype, "size", MapGetSizeJS); |
| 276 InstallFunctions($Map.prototype, DONT_ENUM, $Array( | 280 InstallFunctions($Map.prototype, DONT_ENUM, $Array( |
| 277 "get", MapGetJS, | 281 "get", MapGetJS, |
| 278 "set", MapSetJS, | 282 "set", MapSetJS, |
| 279 "has", MapHasJS, | 283 "has", MapHasJS, |
| 280 "delete", MapDeleteJS, | 284 "delete", MapDeleteJS, |
| 281 "clear", MapClearJS, | 285 "clear", MapClearJS, |
| 282 "forEach", MapForEach | 286 "forEach", MapForEach |
| 283 )); | 287 )); |
| 284 } | 288 } |
| 285 | 289 |
| 286 SetUpMap(); | 290 SetUpMap(); |
| OLD | NEW |