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); |
+})(); |