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

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

Issue 1492923002: [proxies] do not leak private symbols to proxy traps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More tests + cleanup fix 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
Index: test/mjsunit/harmony/proxies-has.js
diff --git a/test/mjsunit/harmony/proxies-has.js b/test/mjsunit/harmony/proxies-has.js
index ffeb0312aad6884519c30d46a0a281463aa95af7..8eda812503ea642b54174ef60dcd7c3e1012de08 100644
--- a/test/mjsunit/harmony/proxies-has.js
+++ b/test/mjsunit/harmony/proxies-has.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --harmony-proxies
+// Flags: --harmony-proxies --harmony-reflect --allow-natives-syntax
var target = {
"target_one": 1
@@ -54,3 +54,15 @@ assertThrows("'nonconf' in proxy", TypeError);
assertThrows("'target_one' in proxy", TypeError);
assertFalse("target_two" in proxy);
assertFalse("in_your_dreams" in proxy);
+
+(function testHasPrivateSymbol() {
+ var symbol = %CreatePrivateSymbol("secret");
+ var O = {};
+ var proxy = new Proxy(O, { has(t, name) { assertUnreachable(); }});
+ O[symbol] = "value";
+ proxy[symbol] = "value";
+ assertEquals(false, symbol in proxy);
+ assertEquals(false, Reflect.has(proxy, symbol));
+ assertEquals(true, symbol in O);
+ assertEquals(true, Reflect.has(O, symbol));
+})();

Powered by Google App Engine
This is Rietveld 408576698