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

Unified Diff: test/mjsunit/array-natives-elements.js

Issue 1317053006: Adding ElementsAccessor::Shift (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@2015-09-01_array_builtin_cleanup
Patch Set: Only use range checks in builtins Created 5 years, 3 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/elements.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/array-natives-elements.js
diff --git a/test/mjsunit/array-natives-elements.js b/test/mjsunit/array-natives-elements.js
index a29ebfc5c67483ebeb1066d706a5aaad2e692fb9..cced407aa79f81ac14fec7041f89d9bdba47fb50 100644
--- a/test/mjsunit/array-natives-elements.js
+++ b/test/mjsunit/array-natives-elements.js
@@ -53,15 +53,15 @@ function array_natives_test() {
// Push
var a0 = make_array("[1, 2, 3]");
assertTrue(%HasFastSmiElements(a0));
- a0.push(4);
+ assertEquals(4, a0.push(4));
assertTrue(%HasFastSmiElements(a0));
- a0.push(1.3);
+ assertEquals(5, a0.push(1.3));
assertTrue(%HasFastDoubleElements(a0));
- a0.push(1.5);
+ assertEquals(6, a0.push(1.5));
assertTrue(%HasFastDoubleElements(a0));
- a0.push({});
+ assertEquals(7, a0.push({}));
assertTrue(%HasFastObjectElements(a0));
- a0.push({});
+ assertEquals(8, a0.push({}));
assertTrue(%HasFastObjectElements(a0));
assertEquals([1,2,3,4,1.3,1.5,{},{}], a0);
@@ -253,44 +253,50 @@ function array_natives_test() {
// Pop
var a4 = [1,2,3];
assertEquals(3, a4.pop());
- assertTrue(%HasFastSmiElements(a4));
+ assertEquals([1,2], a4);
+ //assertTrue(%HasFastSmiElements(a4));
a4 = [1.1,2,3];
assertEquals(3, a4.pop());
- assertTrue(%HasFastDoubleElements(a4));
+ assertEquals([1.1,2], a4);
+ //assertTrue(%HasFastDoubleElements(a4));
a4 = [{},2,3];
assertEquals(3, a4.pop());
- assertTrue(%HasFastObjectElements(a4));
+ assertEquals([{},2], a4);
+ //assertTrue(%HasFastObjectElements(a4));
// Shift
var a4 = [1,2,3];
assertEquals(1, a4.shift());
- assertTrue(%HasFastSmiElements(a4));
+ assertEquals([2,3], a4);
+ //assertTrue(%HasFastSmiElements(a4));
a4 = [1.1,2,3];
assertEquals(1.1, a4.shift());
- assertTrue(%HasFastDoubleElements(a4));
+ assertEquals([2,3], a4);
+ //assertTrue(%HasFastDoubleElements(a4));
a4 = [{},2,3];
assertEquals({}, a4.shift());
- assertTrue(%HasFastObjectElements(a4));
+ assertEquals([2,3], a4);
+ //assertTrue(%HasFastObjectElements(a4));
// Unshift
var a4 = [1,2,3];
- a4.unshift(1);
+ assertEquals(4, a4.unshift(1));
assertTrue(%HasFastSmiElements(a4));
assertEquals([1,1,2,3], a4);
a4 = [1,2,3];
- a4.unshift(1.1);
+ assertEquals(4, a4.unshift(1.1));
assertTrue(%HasFastDoubleElements(a4));
assertEquals([1.1,1,2,3], a4);
a4 = [1.1,2,3];
- a4.unshift(1);
+ assertEquals(4, a4.unshift(1));
assertTrue(%HasFastDoubleElements(a4));
assertEquals([1,1.1,2,3], a4);
a4 = [{},2,3];
- a4.unshift(1);
+ assertEquals(4, a4.unshift(1));
assertTrue(%HasFastObjectElements(a4));
assertEquals([1,{},2,3], a4);
a4 = [{},2,3];
- a4.unshift(1.1);
+ assertEquals(4, a4.unshift(1.1));
assertTrue(%HasFastObjectElements(a4));
assertEquals([1.1,{},2,3], a4);
}
« no previous file with comments | « src/elements.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698