Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/js/array-iterator.js

Issue 2188753002: Make Array.prototype[Symbol.iterator] non-constructible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/array-prototype-values.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 })
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/array-prototype-values.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698