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 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 utils.SetFunctionName(ArrayIteratorIterator, iteratorSymbol); | 137 utils.SetFunctionName(ArrayIteratorIterator, iteratorSymbol); |
138 %AddNamedProperty(ArrayIterator.prototype, toStringTagSymbol, | 138 %AddNamedProperty(ArrayIterator.prototype, toStringTagSymbol, |
139 "Array Iterator", READ_ONLY | DONT_ENUM); | 139 "Array Iterator", READ_ONLY | DONT_ENUM); |
140 | 140 |
141 utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [ | 141 utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [ |
142 // No 'values' since it breaks webcompat: http://crbug.com/409858 | 142 // No 'values' since it breaks webcompat: http://crbug.com/409858 |
143 'entries', ArrayEntries, | 143 'entries', ArrayEntries, |
144 'keys', ArrayKeys | 144 'keys', ArrayKeys |
145 ]); | 145 ]); |
146 | 146 |
147 // TODO(adam): Remove this call once 'values' is in the above | 147 // TODO(adam): Remove these calls once 'values' is in the above |
148 // InstallFunctions block, as it'll be redundant. | 148 // InstallFunctions block, as they'll be redundant. |
149 utils.SetFunctionName(ArrayValues, 'values'); | 149 utils.SetFunctionName(ArrayValues, 'values'); |
| 150 %FunctionRemovePrototype(ArrayValues); |
| 151 %SetNativeFlag(ArrayValues); |
150 | 152 |
151 %AddNamedProperty(GlobalArray.prototype, iteratorSymbol, ArrayValues, | 153 %AddNamedProperty(GlobalArray.prototype, iteratorSymbol, ArrayValues, |
152 DONT_ENUM); | 154 DONT_ENUM); |
153 | 155 |
154 utils.InstallFunctions(GlobalTypedArray.prototype, DONT_ENUM, [ | 156 utils.InstallFunctions(GlobalTypedArray.prototype, DONT_ENUM, [ |
155 'entries', TypedArrayEntries, | 157 'entries', TypedArrayEntries, |
156 'keys', TypedArrayKeys, | 158 'keys', TypedArrayKeys, |
157 'values', TypedArrayValues | 159 'values', TypedArrayValues |
158 ]); | 160 ]); |
159 %AddNamedProperty(GlobalTypedArray.prototype, | 161 %AddNamedProperty(GlobalTypedArray.prototype, |
160 iteratorSymbol, TypedArrayValues, DONT_ENUM); | 162 iteratorSymbol, TypedArrayValues, DONT_ENUM); |
161 | 163 |
162 // ------------------------------------------------------------------- | 164 // ------------------------------------------------------------------- |
163 // Exports | 165 // Exports |
164 | 166 |
165 utils.Export(function(to) { | 167 utils.Export(function(to) { |
166 to.ArrayValues = ArrayValues; | 168 to.ArrayValues = ArrayValues; |
167 }); | 169 }); |
168 | 170 |
169 %InstallToContext(["array_values_iterator", ArrayValues]); | 171 %InstallToContext(["array_values_iterator", ArrayValues]); |
170 | 172 |
171 }) | 173 }) |
OLD | NEW |