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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 var array = %IsConstructor(constructor) ? new constructor(length) : []; | 280 var array = %IsConstructor(constructor) ? new constructor(length) : []; |
281 for (var i = 0; i < length; i++) { | 281 for (var i = 0; i < length; i++) { |
282 AddArrayElement(constructor, array, i, %_Arguments(i)); | 282 AddArrayElement(constructor, array, i, %_Arguments(i)); |
283 } | 283 } |
284 array.length = length; | 284 array.length = length; |
285 return array; | 285 return array; |
286 } | 286 } |
287 | 287 |
288 // ------------------------------------------------------------------- | 288 // ------------------------------------------------------------------- |
289 | 289 |
290 utils.InstallConstants(GlobalSymbol, [ | |
291 // TODO(dslomov, caitp): Move to symbol.js when shipping | |
292 "isConcatSpreadable", symbolIsConcatSpreadable | |
293 ]); | |
294 | |
295 %FunctionSetLength(ArrayCopyWithin, 2); | 290 %FunctionSetLength(ArrayCopyWithin, 2); |
296 %FunctionSetLength(ArrayFrom, 1); | 291 %FunctionSetLength(ArrayFrom, 1); |
297 %FunctionSetLength(ArrayFill, 1); | 292 %FunctionSetLength(ArrayFill, 1); |
298 %FunctionSetLength(ArrayFind, 1); | 293 %FunctionSetLength(ArrayFind, 1); |
299 %FunctionSetLength(ArrayFindIndex, 1); | 294 %FunctionSetLength(ArrayFindIndex, 1); |
300 | 295 |
301 // Set up non-enumerable functions on the Array object. | 296 // Set up non-enumerable functions on the Array object. |
302 utils.InstallFunctions(GlobalArray, DONT_ENUM, [ | 297 utils.InstallFunctions(GlobalArray, DONT_ENUM, [ |
303 "from", ArrayFrom, | 298 "from", ArrayFrom, |
304 "of", ArrayOf | 299 "of", ArrayOf |
(...skipping 12 matching lines...) Expand all Loading... |
317 | 312 |
318 utils.Export(function(to) { | 313 utils.Export(function(to) { |
319 to.ArrayFrom = ArrayFrom; | 314 to.ArrayFrom = ArrayFrom; |
320 to.InnerArrayCopyWithin = InnerArrayCopyWithin; | 315 to.InnerArrayCopyWithin = InnerArrayCopyWithin; |
321 to.InnerArrayFill = InnerArrayFill; | 316 to.InnerArrayFill = InnerArrayFill; |
322 to.InnerArrayFind = InnerArrayFind; | 317 to.InnerArrayFind = InnerArrayFind; |
323 to.InnerArrayFindIndex = InnerArrayFindIndex; | 318 to.InnerArrayFindIndex = InnerArrayFindIndex; |
324 }); | 319 }); |
325 | 320 |
326 }) | 321 }) |
OLD | NEW |