tor-browser

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

testDirectProxyDefineProperty1.js (624B)


      1 // Forward to the target if the trap is not defined
      2 
      3 var target;
      4 function testProxy(p, key) {
      5    Object.defineProperty(p, key, {
      6        value: 'bar',
      7        writable: true,
      8        enumerable: false,
      9        configurable: true
     10    });
     11    var desc = Object.getOwnPropertyDescriptor(target, key);
     12    assertEq(desc.value, 'bar');
     13    assertEq(desc.writable, true);
     14    assertEq(desc.enumerable, false);
     15    assertEq(desc.configurable, true);
     16 }
     17 
     18 for (var key of ['foo', Symbol("quux")]) {
     19    target = {};
     20    testProxy(new Proxy(target, {}), key);
     21    target = {};
     22    testProxy(Proxy.revocable(target, {}).proxy, key);
     23 }