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

Unified Diff: test/cctest/test-extra.js

Issue 1401243003: Add methods to extras' InternalPackedArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test typo Created 5 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/js/array.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-extra.js
diff --git a/test/cctest/test-extra.js b/test/cctest/test-extra.js
index 123c8920d04d18d35a628ca6209b05133af2fd03..dfb6c8012cdbfad93b894acb7dbab6b63c714af4 100644
--- a/test/cctest/test-extra.js
+++ b/test/cctest/test-extra.js
@@ -28,6 +28,18 @@
const Promise = global.Promise;
const Promise_resolve = v8.simpleBind(Promise.resolve, Promise);
+ const arrayToTest = new v8.InternalPackedArray();
+ arrayToTest.push(1);
+ arrayToTest.push(2);
+ arrayToTest.pop();
+ arrayToTest.unshift("a", "b", "c");
+ arrayToTest.shift();
+ arrayToTest.splice(0, 1);
+ const slicedArray = arrayToTest.slice();
+ const arraysOK = arrayToTest.length === 2 && arrayToTest[0] === "c" &&
+ arrayToTest[1] === 1 && slicedArray.length === 2 &&
+ slicedArray[0] === "c" && slicedArray[1] === 1;
+
binding.testExtraCanUseUtils = function() {
const fulfilledPromise = v8.createPromise();
v8.resolvePromise(
@@ -35,9 +47,9 @@
hasOwn({ test: 'test' }, 'test') ? 1 : -1
);
- const fulfilledPromise2 = Promise_resolve(call(function (arg1) {
- return (this.prop === arg1 && arg1 === 'value') ? 2 : -1;
- }, { prop: 'value' }, 'value'));
+ const fulfilledPromise2 = Promise_resolve(call(function (arg1, arg2) {
+ return (this.prop === arg1 && arg1 === 'value' && arg2) ? 2 : -1;
+ }, { prop: 'value' }, 'value', arraysOK));
const rejectedPromise = v8.createPromise();
v8.rejectPromise(rejectedPromise, apply(function (arg1, arg2) {
« no previous file with comments | « src/js/array.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698