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 declarations have been made | 7 // This file relies on the fact that the following declarations have been made |
8 // in runtime.js: | 8 // in runtime.js: |
9 // var $Array = global.Array; | 9 // var $Array = global.Array; |
10 | 10 |
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 | 1464 |
1465 // ------------------------------------------------------------------- | 1465 // ------------------------------------------------------------------- |
1466 | 1466 |
1467 function SetUpArray() { | 1467 function SetUpArray() { |
1468 %CheckIsBootstrapping(); | 1468 %CheckIsBootstrapping(); |
1469 | 1469 |
1470 // Set up non-enumerable constructor property on the Array.prototype | 1470 // Set up non-enumerable constructor property on the Array.prototype |
1471 // object. | 1471 // object. |
1472 %AddNamedProperty($Array.prototype, "constructor", $Array, DONT_ENUM); | 1472 %AddNamedProperty($Array.prototype, "constructor", $Array, DONT_ENUM); |
1473 | 1473 |
1474 // Set up unscopable properties on the Array.prototype object. | |
1475 var unscopables = { | |
1476 __proto__: null, | |
1477 copyWithin: true, | |
1478 entries: true, | |
1479 fill: true, | |
1480 find: true, | |
1481 findIndex: true, | |
1482 keys: true, | |
1483 values: true, | |
1484 }; | |
1485 %AddNamedProperty($Array.prototype, symbolUnscopables, unscopables, | |
1486 DONT_ENUM | READ_ONLY); | |
1487 | |
1488 // Set up non-enumerable functions on the Array object. | 1474 // Set up non-enumerable functions on the Array object. |
1489 InstallFunctions($Array, DONT_ENUM, $Array( | 1475 InstallFunctions($Array, DONT_ENUM, $Array( |
1490 "isArray", ArrayIsArray | 1476 "isArray", ArrayIsArray |
1491 )); | 1477 )); |
1492 | 1478 |
1493 var specialFunctions = %SpecialArrayFunctions(); | 1479 var specialFunctions = %SpecialArrayFunctions(); |
1494 | 1480 |
1495 var getFunction = function(name, jsBuiltin, len) { | 1481 var getFunction = function(name, jsBuiltin, len) { |
1496 var f = jsBuiltin; | 1482 var f = jsBuiltin; |
1497 if (specialFunctions.hasOwnProperty(name)) { | 1483 if (specialFunctions.hasOwnProperty(name)) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 )); | 1532 )); |
1547 | 1533 |
1548 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( | 1534 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( |
1549 "join", getFunction("join", ArrayJoin), | 1535 "join", getFunction("join", ArrayJoin), |
1550 "pop", getFunction("pop", ArrayPop), | 1536 "pop", getFunction("pop", ArrayPop), |
1551 "push", getFunction("push", ArrayPush) | 1537 "push", getFunction("push", ArrayPush) |
1552 )); | 1538 )); |
1553 } | 1539 } |
1554 | 1540 |
1555 SetUpArray(); | 1541 SetUpArray(); |
OLD | NEW |