| 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 if (n == 0) { | 483 if (n == 0) { |
| 484 array.length = n; | 484 array.length = n; |
| 485 return; | 485 return; |
| 486 } | 486 } |
| 487 | 487 |
| 488 if (%IsObserved(array)) | 488 if (%IsObserved(array)) |
| 489 return ObservedArrayPop.call(array, n); | 489 return ObservedArrayPop.call(array, n); |
| 490 | 490 |
| 491 n--; | 491 n--; |
| 492 var value = array[n]; | 492 var value = array[n]; |
| 493 // TODO(jkummerow): Use %DeleteProperty_Strict instead, delete "Delete". |
| 493 Delete(array, n, true); | 494 Delete(array, n, true); |
| 494 array.length = n; | 495 array.length = n; |
| 495 return value; | 496 return value; |
| 496 } | 497 } |
| 497 | 498 |
| 498 | 499 |
| 499 function ObservedArrayPush() { | 500 function ObservedArrayPush() { |
| 500 var n = TO_LENGTH_OR_UINT32(this.length); | 501 var n = TO_LENGTH_OR_UINT32(this.length); |
| 501 var m = %_ArgumentsLength(); | 502 var m = %_ArgumentsLength(); |
| 502 | 503 |
| (...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1922 %InstallToContext([ | 1923 %InstallToContext([ |
| 1923 "array_pop", ArrayPop, | 1924 "array_pop", ArrayPop, |
| 1924 "array_push", ArrayPush, | 1925 "array_push", ArrayPush, |
| 1925 "array_shift", ArrayShift, | 1926 "array_shift", ArrayShift, |
| 1926 "array_splice", ArraySplice, | 1927 "array_splice", ArraySplice, |
| 1927 "array_slice", ArraySlice, | 1928 "array_slice", ArraySlice, |
| 1928 "array_unshift", ArrayUnshift, | 1929 "array_unshift", ArrayUnshift, |
| 1929 ]); | 1930 ]); |
| 1930 | 1931 |
| 1931 }); | 1932 }); |
| OLD | NEW |