diff options
Diffstat (limited to 'js/src/jit-test/tests/proxy/function-toString.js')
-rw-r--r-- | js/src/jit-test/tests/proxy/function-toString.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/proxy/function-toString.js b/js/src/jit-test/tests/proxy/function-toString.js new file mode 100644 index 000000000..cedcf552a --- /dev/null +++ b/js/src/jit-test/tests/proxy/function-toString.js @@ -0,0 +1,10 @@ +load(libdir + 'asserts.js'); + +// Function.prototype.toString doesn't accept ES6 proxies. + +var proxy = new Proxy(function() {}, {}); +assertThrowsInstanceOf(() => Function.prototype.toString.call(proxy), TypeError); +var o = Proxy.revocable(function() {}, {}); +assertThrowsInstanceOf(() => Function.prototype.toString.call(o.proxy), TypeError); +o.revoke(); +assertThrowsInstanceOf(() => Function.prototype.toString.call(o.proxy), TypeError); |