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

Unified Diff: test/mjsunit/harmony/proxies-set.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
« test/mjsunit/harmony/proxies-get.js ('K') | « test/mjsunit/harmony/proxies-has.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/proxies-set.js
diff --git a/test/mjsunit/harmony/proxies-set.js b/test/mjsunit/harmony/proxies-set.js
index 2fec115a103ea05d0a49fa350381e157f679487a..1b306f8c6ed57cbc2a9a0b42d748d4efd33372f5 100644
--- a/test/mjsunit/harmony/proxies-set.js
+++ b/test/mjsunit/harmony/proxies-set.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 --harmony-reflect
+// Flags: --harmony-proxies --harmony-reflect --allow-natives-syntax
function sloppyDefaultSet(o, p, v) { return o[p] = v }
@@ -310,3 +310,16 @@ TestTrapReceiverArgument(strictReflectSet);
}
}
})();
+
+
+(function testSetPrivateSymbol() {
+ var symbol = %CreatePrivateSymbol("secret");
+ var O = {};
+ var proxy = new Proxy(O, { set(t, name, val) { assertUnreachable(); }});
+ O[symbol] = "value";
+ proxy[symbol] = "value";
+ assertEquals(undefined, proxy[symbol]);
+ assertEquals(false, Reflect.set(proxy, symbol, "otherValue"));
+ assertEquals("value", O[symbol]);
+ assertEquals(true, Reflect.set(O, symbol, "otherValue"));
+})();
« test/mjsunit/harmony/proxies-get.js ('K') | « test/mjsunit/harmony/proxies-has.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698