Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: src/array.js

Issue 39593002: Revert "Make Array.prototype.pop throw if the last element is not configurable." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-array-pop-nonconfigurable.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-array-pop-nonconfigurable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698