OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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, extrasUtils) { | 5 (function(global, utils, extrasUtils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 | 395 |
396 var array = TO_OBJECT(this); | 396 var array = TO_OBJECT(this); |
397 var n = TO_LENGTH(array.length); | 397 var n = TO_LENGTH(array.length); |
398 if (n == 0) { | 398 if (n == 0) { |
399 array.length = n; | 399 array.length = n; |
400 return; | 400 return; |
401 } | 401 } |
402 | 402 |
403 n--; | 403 n--; |
404 var value = array[n]; | 404 var value = array[n]; |
405 %DeleteProperty_Strict(array, n); | 405 delete array[n]; |
406 array.length = n; | 406 array.length = n; |
407 return value; | 407 return value; |
408 } | 408 } |
409 | 409 |
410 | 410 |
411 // Appends the arguments to the end of the array and returns the new | 411 // Appends the arguments to the end of the array and returns the new |
412 // length of the array. See ECMA-262, section 15.4.4.7. | 412 // length of the array. See ECMA-262, section 15.4.4.7. |
413 function ArrayPush() { | 413 function ArrayPush() { |
414 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.push"); | 414 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.push"); |
415 | 415 |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 "array_pop", ArrayPop, | 1453 "array_pop", ArrayPop, |
1454 "array_push", ArrayPush, | 1454 "array_push", ArrayPush, |
1455 "array_shift", ArrayShift, | 1455 "array_shift", ArrayShift, |
1456 "array_splice", ArraySplice, | 1456 "array_splice", ArraySplice, |
1457 "array_slice", ArraySlice, | 1457 "array_slice", ArraySlice, |
1458 "array_unshift", ArrayUnshift, | 1458 "array_unshift", ArrayUnshift, |
1459 "array_values_iterator", IteratorFunctions.values, | 1459 "array_values_iterator", IteratorFunctions.values, |
1460 ]); | 1460 ]); |
1461 | 1461 |
1462 }); | 1462 }); |
OLD | NEW |