OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 if (n == 0) { | 423 if (n == 0) { |
424 this.length = n; | 424 this.length = n; |
425 return; | 425 return; |
426 } | 426 } |
427 | 427 |
428 if (%IsObserved(this)) | 428 if (%IsObserved(this)) |
429 return ObservedArrayPop.call(this, n); | 429 return ObservedArrayPop.call(this, n); |
430 | 430 |
431 n--; | 431 n--; |
432 var value = this[n]; | 432 var value = this[n]; |
433 Delete(this, ToName(n), true); | 433 delete this[n]; |
434 this.length = n; | 434 this.length = n; |
435 return value; | 435 return value; |
436 } | 436 } |
437 | 437 |
438 | 438 |
439 function ObservedArrayPush() { | 439 function ObservedArrayPush() { |
440 var n = TO_UINT32(this.length); | 440 var n = TO_UINT32(this.length); |
441 var m = %_ArgumentsLength(); | 441 var m = %_ArgumentsLength(); |
442 | 442 |
443 try { | 443 try { |
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 )); | 1652 )); |
1653 | 1653 |
1654 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( | 1654 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( |
1655 "join", getFunction("join", ArrayJoin), | 1655 "join", getFunction("join", ArrayJoin), |
1656 "pop", getFunction("pop", ArrayPop), | 1656 "pop", getFunction("pop", ArrayPop), |
1657 "push", getFunction("push", ArrayPush) | 1657 "push", getFunction("push", ArrayPush) |
1658 )); | 1658 )); |
1659 } | 1659 } |
1660 | 1660 |
1661 SetUpArray(); | 1661 SetUpArray(); |
OLD | NEW |