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

Unified Diff: test/mjsunit/harmony/proxies-delete-property.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-delete-property.js
diff --git a/test/mjsunit/harmony/proxies-delete-property.js b/test/mjsunit/harmony/proxies-delete-property.js
index 27f9c059ccd6815cf4481d11ae33fe563ba3ec0c..f69f25535ca29270f648a8f95c7c529d125e1b8e 100644
--- a/test/mjsunit/harmony/proxies-delete-property.js
+++ b/test/mjsunit/harmony/proxies-delete-property.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
var properties =
@@ -188,3 +188,14 @@ TestTrappingFalsish(
(o, p) => {"use strict"; return delete o[p]}, true);
TestTrappingFalsish(
(o, p) => {"use strict"; return Reflect.deleteProperty(o, p)}, false);
+
+(function testDeletePrivateSymbol() {
+ var symbol = %CreatePrivateSymbol("secret");
+ var O = { [symbol]: "value" };
+ var proxy = new Proxy(O, { delete(t, name) { assertUnreachable(); }});
+ delete proxy[symbol];
+ assertEquals(true, Reflect.deleteProperty(proxy, symbol));
+ assertEquals("value", O[symbol]);
+ assertEquals(true, Reflect.deleteProperty(O, symbol));
+ assertEquals(undefined, O[symbol]);
+})();

Powered by Google App Engine
This is Rietveld 408576698