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

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

Issue 1516843002: [proxy] fixing harmony/proxy.js tests and improving error messages + some drive-by fixes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fixing set super property test 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 | « test/mjsunit/harmony/proxies.js ('k') | test/mjsunit/harmony/proxies-for.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/proxies-enumerate.js
diff --git a/test/mjsunit/harmony/proxies-enumerate.js b/test/mjsunit/harmony/proxies-enumerate.js
index 0da706d9e101f0814ba5c0dab2ed4f815fa78b67..a77c668ee38a3f4ee4f396a7f7f3d56dbb3b66a7 100644
--- a/test/mjsunit/harmony/proxies-enumerate.js
+++ b/test/mjsunit/harmony/proxies-enumerate.js
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --harmony-proxies
-
+/*
Jakob Kummerow 2015/12/10 21:12:13 leftover?
var target = {
"target_one": 1
};
@@ -72,3 +72,39 @@ TestNonStringKey({bad: "value"});
TestNonStringKey(null);
TestNonStringKey(undefined);
TestNonStringKey(true);
+*/
+
+(function testProtoProxyEnumerate() {
+ var keys = ['a', 'b', 'c', 'd'];
+ var handler = {
+ enumerate() { return keys[Symbol.iterator]() },
+ has(target, key) { return false }
+ };
+ var proxy = new Proxy({}, handler);
+ var seen_keys = [];
+ for (var i in proxy) {
+ seen_keys.push(i);
+ }
+ assertEquals([], seen_keys);
+
+ handler.has = function(target, key) { return true };
+ for (var i in proxy) {
+ seen_keys.push(i);
+ }
+ assertEquals(keys, seen_keys);
+
+ o = {__proto__:proxy};
+ handler.has = function(target, key) { return false };
+ seen_keys = [];
+ for (var i in o) {
+ seen_keys.push(i);
+ }
+ assertEquals([], seen_keys);
+
+ handler.has = function(target, key) { return true };
+ seen_keys = [];
+ for (var i in o) {
+ seen_keys.push(i);
+ }
+ assertEquals(keys, seen_keys);
+})();
« no previous file with comments | « test/mjsunit/harmony/proxies.js ('k') | test/mjsunit/harmony/proxies-for.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698