tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

testDirectProxyDefineProperty4.js (431B)


      1 load(libdir + "asserts.js");
      2 
      3 /*
      4 * Throw a TypeError if the trap defines a non-configurable property that does
      5 * not exist on the target
      6 */
      7 var handler = { defineProperty: function (target, name, desc) { return true; } };
      8 for (let p of [new Proxy({}, handler), Proxy.revocable({}, handler).proxy]) {
      9    assertThrowsInstanceOf(function () {
     10        Object.defineProperty(p, 'foo', { configurable: false });
     11    }, TypeError);
     12 }