| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 | 142 |
| 143 // ------------------------------------------------------------------- | 143 // ------------------------------------------------------------------- |
| 144 | 144 |
| 145 function SetUpSet() { | 145 function SetUpSet() { |
| 146 %CheckIsBootstrapping(); | 146 %CheckIsBootstrapping(); |
| 147 | 147 |
| 148 %SetCode($Set, SetConstructor); | 148 %SetCode($Set, SetConstructor); |
| 149 %FunctionSetPrototype($Set, new $Object()); | 149 %FunctionSetPrototype($Set, new $Object()); |
| 150 %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM); | 150 %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM); |
| 151 %AddNamedProperty($Set.prototype, symbolToStringTag, "Set", DONT_ENUM | READ_
ONLY); |
| 151 | 152 |
| 152 %FunctionSetLength(SetForEach, 1); | 153 %FunctionSetLength(SetForEach, 1); |
| 153 | 154 |
| 154 // Set up the non-enumerable functions on the Set prototype object. | 155 // Set up the non-enumerable functions on the Set prototype object. |
| 155 InstallGetter($Set.prototype, "size", SetGetSizeJS); | 156 InstallGetter($Set.prototype, "size", SetGetSizeJS); |
| 156 InstallFunctions($Set.prototype, DONT_ENUM, $Array( | 157 InstallFunctions($Set.prototype, DONT_ENUM, $Array( |
| 157 "add", SetAddJS, | 158 "add", SetAddJS, |
| 158 "has", SetHasJS, | 159 "has", SetHasJS, |
| 159 "delete", SetDeleteJS, | 160 "delete", SetDeleteJS, |
| 160 "clear", SetClearJS, | 161 "clear", SetClearJS, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 277 |
| 277 | 278 |
| 278 // ------------------------------------------------------------------- | 279 // ------------------------------------------------------------------- |
| 279 | 280 |
| 280 function SetUpMap() { | 281 function SetUpMap() { |
| 281 %CheckIsBootstrapping(); | 282 %CheckIsBootstrapping(); |
| 282 | 283 |
| 283 %SetCode($Map, MapConstructor); | 284 %SetCode($Map, MapConstructor); |
| 284 %FunctionSetPrototype($Map, new $Object()); | 285 %FunctionSetPrototype($Map, new $Object()); |
| 285 %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM); | 286 %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM); |
| 287 %AddNamedProperty($Map.prototype, symbolToStringTag, "Map", DONT_ENUM | READ_
ONLY); |
| 286 | 288 |
| 287 %FunctionSetLength(MapForEach, 1); | 289 %FunctionSetLength(MapForEach, 1); |
| 288 | 290 |
| 289 // Set up the non-enumerable functions on the Map prototype object. | 291 // Set up the non-enumerable functions on the Map prototype object. |
| 290 InstallGetter($Map.prototype, "size", MapGetSizeJS); | 292 InstallGetter($Map.prototype, "size", MapGetSizeJS); |
| 291 InstallFunctions($Map.prototype, DONT_ENUM, $Array( | 293 InstallFunctions($Map.prototype, DONT_ENUM, $Array( |
| 292 "get", MapGetJS, | 294 "get", MapGetJS, |
| 293 "set", MapSetJS, | 295 "set", MapSetJS, |
| 294 "has", MapHasJS, | 296 "has", MapHasJS, |
| 295 "delete", MapDeleteJS, | 297 "delete", MapDeleteJS, |
| 296 "clear", MapClearJS, | 298 "clear", MapClearJS, |
| 297 "forEach", MapForEach | 299 "forEach", MapForEach |
| 298 )); | 300 )); |
| 299 } | 301 } |
| 300 | 302 |
| 301 SetUpMap(); | 303 SetUpMap(); |
| OLD | NEW |