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

Unified Diff: test/mjsunit/harmony/proxies-for.js

Issue 1491863002: [proxies] Adapt and reenable harmony/proxies-for.js test. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address nits. Created 5 years 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 | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/proxies-for.js
diff --git a/test/mjsunit/harmony/proxies-for.js b/test/mjsunit/harmony/proxies-for.js
index 0b7bcc2cd099def71a503069a3a4b4a4b58b32f3..f0b36abbee71e0634154bc50fc56c7640dc2e874 100644
--- a/test/mjsunit/harmony/proxies-for.js
+++ b/test/mjsunit/harmony/proxies-for.js
@@ -40,6 +40,8 @@ function TestWithProxies(test, x, y, z) {
// Iterate over a proxy.
+Array.prototype.values = function() { return this[Symbol.iterator]() }
+
function TestForIn(properties, handler) {
TestWithProxies(TestForIn2, properties, handler)
}
@@ -52,30 +54,17 @@ function TestForIn2(create, properties, handler) {
}
TestForIn(["0", "a"], {
- enumerate: function() { return [0, "a"] }
+ enumerate: function() { return ["0", "a"].values() }
})
TestForIn(["null", "a"], {
enumerate: function() { return this.enumerate2() },
- enumerate2: function() { return [null, "a"] }
-})
-
-TestForIn(["b", "d"], {
- getPropertyNames: function() { return ["a", "b", "c", "d", "e"] },
- getPropertyDescriptor: function(k) {
- switch (k) {
- case "a": return {enumerable: false, value: "3", configurable: true};
- case "b": return {enumerable: true, get get() {}, configurable: true};
- case "c": return {value: 4, configurable: true};
- case "d": return {get enumerable() { return true }, configurable: true};
- default: return undefined;
- }
- }
+ enumerate2: function() { return ["null", "a"].values() }
})
TestForIn(["b", "a", "0", "c"], new Proxy({}, {
get: function(pr, pk) {
- return function() { return ["b", "a", 0, "c"] }
+ return function() { return ["b", "a", "0", "c"].values() }
}
}))
@@ -103,31 +92,14 @@ function TestForInDerived2(create, properties, handler) {
}
TestForInDerived(["0", "a"], {
- enumerate: function() { return [0, "a"] },
- getPropertyDescriptor: function(k) {
- return k == "0" || k == "a" ? {configurable: true} : undefined
- }
+ enumerate: function() { return ["0", "a"].values() },
+ has: function(t, k) { return k == "0" || k == "a" }
})
TestForInDerived(["null", "a"], {
enumerate: function() { return this.enumerate2() },
- enumerate2: function() { return [null, "a"] },
- getPropertyDescriptor: function(k) {
- return k == "null" || k == "a" ? {configurable: true} : undefined
- }
-})
-
-TestForInDerived(["b", "d"], {
- getPropertyNames: function() { return ["a", "b", "c", "d", "e"] },
- getPropertyDescriptor: function(k) {
- switch (k) {
- case "a": return {enumerable: false, value: "3", configurable: true};
- case "b": return {enumerable: true, get get() {}, configurable: true};
- case "c": return {value: 4, configurable: true};
- case "d": return {get enumerable() { return true }, configurable: true};
- default: return undefined;
- }
- }
+ enumerate2: function() { return ["null", "a"].values() },
+ has: function(t, k) { return k == "null" || k == "a" }
})
@@ -154,15 +126,6 @@ TestForInThrow({
enumerate2: function() { throw "myexn" }
})
-TestForInThrow({
- getPropertyNames: function() { throw "myexn" }
-})
-
-TestForInThrow({
- getPropertyNames: function() { return ["a"] },
- getPropertyDescriptor: function() { throw "myexn" }
-})
-
TestForInThrow(new Proxy({}, {
get: function(pr, pk) {
return function() { throw "myexn" }
@@ -170,7 +133,7 @@ TestForInThrow(new Proxy({}, {
}));
(function() {
- var p = new Proxy({}, {enumerate:function() { return [0]; }});
+ var p = new Proxy({}, {enumerate:function() { return ["0"].values(); }});
var o = [0];
o.__proto__ = p;
var keys = [];
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698