summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/function-toString.js
blob: cedcf552a412edefcbcdeba794f867446d6b4dca (plain)
1
2
3
4
5
6
7
8
9
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);