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

Unified Diff: test/mjsunit/array-unshift.js

Issue 666883009: Change SmartMove no-op behavior to match SimpleMove (and ES6 spec) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/array.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-unshift.js
diff --git a/test/mjsunit/array-unshift.js b/test/mjsunit/array-unshift.js
index 0eb299a0cee2a145396c2e7036d2237667c256c7..50aab4f52a4b58a316053604c719d4465c48be9a 100644
--- a/test/mjsunit/array-unshift.js
+++ b/test/mjsunit/array-unshift.js
@@ -37,9 +37,7 @@
})();
-// Check that unshift with no args has a side-effect of
-// filling the holes with elements from the prototype
-// (if present, of course)
+// Check that unshift with no args has no side-effects.
(function() {
var len = 3;
var array = new Array(len);
@@ -65,15 +63,15 @@
assertTrue(delete Array.prototype[0]);
assertTrue(delete Array.prototype[2]);
- // unshift makes array own 0 and 2...
- assertTrue(array.hasOwnProperty(0));
+ // array still owns nothing...
+ assertFalse(array.hasOwnProperty(0));
Michael Starzinger 2014/10/22 08:45:50 I am not convinced that this is actually spec-comp
adamk 2014/10/22 17:15:35 This appears to be a difference between ES5 and ES
assertFalse(array.hasOwnProperty(1));
- assertTrue(array.hasOwnProperty(2));
+ assertFalse(array.hasOwnProperty(2));
// ... so they are not affected be delete.
- assertEquals(array[0], at0);
+ assertEquals(array[0], undefined);
assertEquals(array[1], undefined);
- assertEquals(array[2], at2);
+ assertEquals(array[2], undefined);
})();
@@ -115,9 +113,7 @@
assertTrue(delete Array.prototype[7]);
})();
-// Check that unshift with no args has a side-effect of
-// filling the holes with elements from the prototype
-// (if present, of course)
+// Check that unshift with no args has no side-effects.
(function() {
var len = 3;
var array = new Array(len);
@@ -142,12 +138,12 @@
assertEquals(len, array.unshift());
- // unshift makes array own 0 and 2...
- assertTrue(array.hasOwnProperty(0));
+ // array still owns nothing.
+ assertFalse(array.hasOwnProperty(0));
assertFalse(array.hasOwnProperty(1));
- assertTrue(array.hasOwnProperty(2));
+ assertFalse(array.hasOwnProperty(2));
- // ... so they are not affected be delete.
+ // ... but still sees values from array_proto.
assertEquals(array[0], at0);
assertEquals(array[1], undefined);
assertEquals(array[2], at2);
« no previous file with comments | « src/array.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698