OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 | 7 |
8 // This file relies on the fact that the following declaration has been made | 8 // This file relies on the fact that the following declaration has been made |
9 // in runtime.js: | 9 // in runtime.js: |
10 // var $Array = global.Array; | 10 // var $Array = global.Array; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 ArrayIteratorIterator, DONT_ENUM); | 114 ArrayIteratorIterator, DONT_ENUM); |
115 } | 115 } |
116 SetUpArrayIterator(); | 116 SetUpArrayIterator(); |
117 | 117 |
118 | 118 |
119 function ExtendArrayPrototype() { | 119 function ExtendArrayPrototype() { |
120 %CheckIsBootstrapping(); | 120 %CheckIsBootstrapping(); |
121 | 121 |
122 InstallFunctions($Array.prototype, DONT_ENUM, $Array( | 122 InstallFunctions($Array.prototype, DONT_ENUM, $Array( |
123 'entries', ArrayEntries, | 123 'entries', ArrayEntries, |
124 'values', ArrayValues, | 124 // TODO(arv): Reenable once @@unscopables are shipping. |
| 125 // 'values', ArrayValues, |
125 'keys', ArrayKeys | 126 'keys', ArrayKeys |
126 )); | 127 )); |
127 | 128 |
128 %AddNamedProperty($Array.prototype, symbolIterator, ArrayValues, DONT_ENUM); | 129 %AddNamedProperty($Array.prototype, symbolIterator, ArrayValues, DONT_ENUM); |
129 } | 130 } |
130 ExtendArrayPrototype(); | 131 ExtendArrayPrototype(); |
131 | 132 |
132 | 133 |
133 function ExtendTypedArrayPrototypes() { | 134 function ExtendTypedArrayPrototypes() { |
134 %CheckIsBootstrapping(); | 135 %CheckIsBootstrapping(); |
135 | 136 |
136 macro TYPED_ARRAYS(FUNCTION) | 137 macro TYPED_ARRAYS(FUNCTION) |
137 FUNCTION(Uint8Array) | 138 FUNCTION(Uint8Array) |
138 FUNCTION(Int8Array) | 139 FUNCTION(Int8Array) |
139 FUNCTION(Uint16Array) | 140 FUNCTION(Uint16Array) |
140 FUNCTION(Int16Array) | 141 FUNCTION(Int16Array) |
141 FUNCTION(Uint32Array) | 142 FUNCTION(Uint32Array) |
142 FUNCTION(Int32Array) | 143 FUNCTION(Int32Array) |
143 FUNCTION(Float32Array) | 144 FUNCTION(Float32Array) |
144 FUNCTION(Float64Array) | 145 FUNCTION(Float64Array) |
145 FUNCTION(Uint8ClampedArray) | 146 FUNCTION(Uint8ClampedArray) |
146 endmacro | 147 endmacro |
147 | 148 |
148 macro EXTEND_TYPED_ARRAY(NAME) | 149 macro EXTEND_TYPED_ARRAY(NAME) |
149 %AddNamedProperty($NAME.prototype, 'entries', ArrayEntries, DONT_ENUM); | 150 %AddNamedProperty($NAME.prototype, 'entries', ArrayEntries, DONT_ENUM); |
150 %AddNamedProperty($NAME.prototype, 'values', ArrayValues, DONT_ENUM); | 151 // TODO(arv): Reenable once @@unscopables are shipping. |
| 152 // %AddNamedProperty($NAME.prototype, 'values', ArrayValues, DONT_ENUM); |
151 %AddNamedProperty($NAME.prototype, 'keys', ArrayKeys, DONT_ENUM); | 153 %AddNamedProperty($NAME.prototype, 'keys', ArrayKeys, DONT_ENUM); |
152 %AddNamedProperty($NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM); | 154 %AddNamedProperty($NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM); |
153 endmacro | 155 endmacro |
154 | 156 |
155 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) | 157 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) |
156 } | 158 } |
157 ExtendTypedArrayPrototypes(); | 159 ExtendTypedArrayPrototypes(); |
OLD | NEW |