OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 // var $Array = global.Array; | 8 // var $Array = global.Array; |
9 // var $Symbol = global.Symbol; | 9 // var $Symbol = global.Symbol; |
10 | 10 |
11 function ExtendSymbol() { | 11 function UnscopablesExtendSymbol() { |
12 %CheckIsBootstrapping(); | 12 %CheckIsBootstrapping(); |
13 InstallConstants($Symbol, $Array( | 13 InstallConstants($Symbol, $Array( |
14 "unscopables", symbolUnscopables | 14 "unscopables", symbolUnscopables |
15 )); | 15 )); |
16 } | 16 } |
17 | 17 |
18 ExtendSymbol(); | 18 UnscopablesExtendSymbol(); |
19 | 19 |
20 | 20 |
21 var arrayUnscopables = { | 21 var arrayUnscopables = { |
22 __proto__: null, | 22 __proto__: null, |
23 copyWithin: true, | 23 copyWithin: true, |
24 entries: true, | 24 entries: true, |
25 fill: true, | 25 fill: true, |
26 find: true, | 26 find: true, |
27 findIndex: true, | 27 findIndex: true, |
28 keys: true, | 28 keys: true, |
29 values: true, | 29 values: true, |
30 }; | 30 }; |
31 | 31 |
32 | 32 |
33 function ExtendArrayPrototype() { | 33 function UnscopablesExtendArrayPrototype() { |
34 %CheckIsBootstrapping(); | 34 %CheckIsBootstrapping(); |
35 %AddNamedProperty($Array.prototype, symbolUnscopables, arrayUnscopables, | 35 %AddNamedProperty($Array.prototype, symbolUnscopables, arrayUnscopables, |
36 DONT_ENUM | READ_ONLY); | 36 DONT_ENUM | READ_ONLY); |
37 } | 37 } |
38 | 38 |
39 ExtendArrayPrototype(); | 39 UnscopablesExtendArrayPrototype(); |
OLD | NEW |