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

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

Issue 1309243003: ES6: Array.prototype.slice and friends should use ToLength instead of ToUint32 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed nit: use factory()->ToBoolean() Created 5 years, 3 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 | « src/flag-definitions.h ('k') | src/heap/heap.h » ('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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 for (; i < end; i++) 166 for (; i < end; i++)
167 array[i] = value; 167 array[i] = value;
168 return array; 168 return array;
169 } 169 }
170 170
171 // ES6, draft 04-05-14, section 22.1.3.6 171 // ES6, draft 04-05-14, section 22.1.3.6
172 function ArrayFill(value, start, end) { 172 function ArrayFill(value, start, end) {
173 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill"); 173 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill");
174 174
175 var array = TO_OBJECT(this); 175 var array = TO_OBJECT(this);
176 var length = TO_UINT32(array.length); 176 var length = TO_LENGTH_OR_UINT32(array.length);
177 177
178 return InnerArrayFill(value, start, end, array, length); 178 return InnerArrayFill(value, start, end, array, length);
179 } 179 }
180 180
181 function AddArrayElement(constructor, array, i, value) { 181 function AddArrayElement(constructor, array, i, value) {
182 if (constructor === GlobalArray) { 182 if (constructor === GlobalArray) {
183 %AddElement(array, i, value); 183 %AddElement(array, i, value);
184 } else { 184 } else {
185 ObjectDefineProperty(array, i, { 185 ObjectDefineProperty(array, i, {
186 value: value, writable: true, configurable: true, enumerable: true 186 value: value, writable: true, configurable: true, enumerable: true
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 utils.Export(function(to) { 292 utils.Export(function(to) {
293 to.ArrayFrom = ArrayFrom; 293 to.ArrayFrom = ArrayFrom;
294 to.InnerArrayCopyWithin = InnerArrayCopyWithin; 294 to.InnerArrayCopyWithin = InnerArrayCopyWithin;
295 to.InnerArrayFill = InnerArrayFill; 295 to.InnerArrayFill = InnerArrayFill;
296 to.InnerArrayFind = InnerArrayFind; 296 to.InnerArrayFind = InnerArrayFind;
297 to.InnerArrayFindIndex = InnerArrayFindIndex; 297 to.InnerArrayFindIndex = InnerArrayFindIndex;
298 }); 298 });
299 299
300 }) 300 })
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698