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 var $arrayConcat; | 5 var $arrayConcat; |
6 var $arrayPush; | 6 var $arrayPush; |
7 var $arrayPop; | 7 var $arrayPop; |
8 var $arrayShift; | 8 var $arrayShift; |
9 var $arraySlice; | 9 var $arraySlice; |
10 var $arraySplice; | 10 var $arraySplice; |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 if (n == 0) { | 471 if (n == 0) { |
472 array.length = n; | 472 array.length = n; |
473 return; | 473 return; |
474 } | 474 } |
475 | 475 |
476 if (%IsObserved(array)) | 476 if (%IsObserved(array)) |
477 return ObservedArrayPop.call(array, n); | 477 return ObservedArrayPop.call(array, n); |
478 | 478 |
479 n--; | 479 n--; |
480 var value = array[n]; | 480 var value = array[n]; |
481 Delete(array, $toName(n), true); | 481 Delete(array, n, true); |
482 array.length = n; | 482 array.length = n; |
483 return value; | 483 return value; |
484 } | 484 } |
485 | 485 |
486 | 486 |
487 function ObservedArrayPush() { | 487 function ObservedArrayPush() { |
488 var n = TO_UINT32(this.length); | 488 var n = TO_UINT32(this.length); |
489 var m = %_ArgumentsLength(); | 489 var m = %_ArgumentsLength(); |
490 | 490 |
491 try { | 491 try { |
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1696 | 1696 |
1697 $arrayConcat = ArrayConcatJS; | 1697 $arrayConcat = ArrayConcatJS; |
1698 $arrayPush = ArrayPush; | 1698 $arrayPush = ArrayPush; |
1699 $arrayPop = ArrayPop; | 1699 $arrayPop = ArrayPop; |
1700 $arrayShift = ArrayShift; | 1700 $arrayShift = ArrayShift; |
1701 $arraySlice = ArraySlice; | 1701 $arraySlice = ArraySlice; |
1702 $arraySplice = ArraySplice; | 1702 $arraySplice = ArraySplice; |
1703 $arrayUnshift = ArrayUnshift; | 1703 $arrayUnshift = ArrayUnshift; |
1704 | 1704 |
1705 }); | 1705 }); |
OLD | NEW |