diff options
Diffstat (limited to 'js/src/jit-test/tests/for-of/proxy-3.js')
-rw-r--r-- | js/src/jit-test/tests/for-of/proxy-3.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/for-of/proxy-3.js b/js/src/jit-test/tests/for-of/proxy-3.js new file mode 100644 index 000000000..1d7b84847 --- /dev/null +++ b/js/src/jit-test/tests/for-of/proxy-3.js @@ -0,0 +1,13 @@ +// An exception thrown from a proxy trap while getting the .iterator method is propagated. + +load(libdir + "asserts.js"); +load(libdir + "iteration.js"); + +var p = new Proxy({}, { + get(target, property) { + if (property === Symbol.iterator) + throw "fit"; + return undefined; + } +}); +assertThrowsValue(function () { for (var v of p) {} }, "fit"); |