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