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

Unified Diff: test/mjsunit/harmony/proxies-get.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: Move check to LookupIterator 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 | « src/lookup.cc ('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-get.js
diff --git a/test/mjsunit/harmony/proxies-get.js b/test/mjsunit/harmony/proxies-get.js
index 812739066e435aec1ad63a4553ff8eec1b6b0047..8e8591298719fc64f713d43e85686c62535c7918 100644
--- a/test/mjsunit/harmony/proxies-get.js
+++ b/test/mjsunit/harmony/proxies-get.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
(function testBasicFunctionality() {
var target = {
@@ -93,3 +93,27 @@
assertEquals("value", proxy.key2);
assertThrows(function(){ proxy.key3 }, TypeError);
})();
+
+(function testGetInternalIterators() {
+ var log = [];
+ var array = [1,2,3,4,5]
+ var origIt = array[Symbol.iterator]();
+ var it = new Proxy(origIt, {
+ get(t, name) {
+ log.push(`[[Get]](iterator, ${String(name)})`);
+ return Reflect.get(t, name);
+ },
+ set(t, name, val) {
+ log.push(`[[Set]](iterator, ${String(name)}, ${String(val)})`);
+ return Reflect.set(t, name, val);
+ }
+ });
+
+ assertThrows(function() {
+ for (var v of it) log.push(v);
+ }, TypeError);
+ assertEquals([
+ "[[Get]](iterator, Symbol(Symbol.iterator))",
+ "[[Get]](iterator, next)"
+ ], log);
+})();
« no previous file with comments | « src/lookup.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698