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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 }) |
OLD | NEW |