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

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

Issue 1242623002: [es6] Array.prototype[Symbol.iterator].name should be 'values' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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-iterator.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 var $arrayValues; 5 var $arrayValues;
6 6
7 (function(global, utils) { 7 (function(global, utils) {
8 8
9 "use strict"; 9 "use strict";
10 10
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 ArrayIteratorIterator, DONT_ENUM); 131 ArrayIteratorIterator, DONT_ENUM);
132 %AddNamedProperty(ArrayIterator.prototype, symbolToStringTag, 132 %AddNamedProperty(ArrayIterator.prototype, symbolToStringTag,
133 "Array Iterator", READ_ONLY | DONT_ENUM); 133 "Array Iterator", READ_ONLY | DONT_ENUM);
134 134
135 utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [ 135 utils.InstallFunctions(GlobalArray.prototype, DONT_ENUM, [
136 // No 'values' since it breaks webcompat: http://crbug.com/409858 136 // No 'values' since it breaks webcompat: http://crbug.com/409858
137 'entries', ArrayEntries, 137 'entries', ArrayEntries,
138 'keys', ArrayKeys 138 'keys', ArrayKeys
139 ]); 139 ]);
140 140
141 // TODO(adam): Remove this call once 'values' is in the above
142 // InstallFunctions block, as it'll be redundant.
143 utils.SetFunctionName(ArrayValues, 'values');
144
141 %AddNamedProperty(GlobalArray.prototype, symbolIterator, ArrayValues, 145 %AddNamedProperty(GlobalArray.prototype, symbolIterator, ArrayValues,
142 DONT_ENUM); 146 DONT_ENUM);
143 147
144 macro EXTEND_TYPED_ARRAY(NAME) 148 macro EXTEND_TYPED_ARRAY(NAME)
145 %AddNamedProperty(GlobalNAME.prototype, 'entries', ArrayEntries, DONT_ENUM); 149 %AddNamedProperty(GlobalNAME.prototype, 'entries', ArrayEntries, DONT_ENUM);
146 %AddNamedProperty(GlobalNAME.prototype, 'values', ArrayValues, DONT_ENUM); 150 %AddNamedProperty(GlobalNAME.prototype, 'values', ArrayValues, DONT_ENUM);
147 %AddNamedProperty(GlobalNAME.prototype, 'keys', ArrayKeys, DONT_ENUM); 151 %AddNamedProperty(GlobalNAME.prototype, 'keys', ArrayKeys, DONT_ENUM);
148 %AddNamedProperty(GlobalNAME.prototype, symbolIterator, ArrayValues, 152 %AddNamedProperty(GlobalNAME.prototype, symbolIterator, ArrayValues,
149 DONT_ENUM); 153 DONT_ENUM);
150 endmacro 154 endmacro
151 155
152 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) 156 TYPED_ARRAYS(EXTEND_TYPED_ARRAY)
153 157
154 // ------------------------------------------------------------------- 158 // -------------------------------------------------------------------
155 // Exports 159 // Exports
156 160
157 utils.Export(function(to) { 161 utils.Export(function(to) {
158 to.ArrayIteratorCreateResultObject = CreateIteratorResultObject; 162 to.ArrayIteratorCreateResultObject = CreateIteratorResultObject;
159 }); 163 });
160 164
161 $arrayValues = ArrayValues; 165 $arrayValues = ArrayValues;
162 166
163 }) 167 })
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698