tor-browser

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

testDirectProxyGetOwnPropertyNames1.js (656B)


      1 // Forward to the target if the trap is not defined
      2 var objAB = Object.create(null, {
      3    a: {
      4        enumerable: true,
      5        configurable: true
      6    },
      7    b: {
      8        enumerable: false,
      9        configurable: true
     10    }
     11 });
     12 
     13 var objCD = Object.create(objAB, {
     14    c: {
     15        enumerable: true,
     16        configurable: true
     17    },
     18    d: {
     19        enumerable: false,
     20        configurable: true
     21    }
     22 });
     23 
     24 objCD[Symbol("moon")] = "something";
     25 for (let p of [new Proxy(objCD, {}), Proxy.revocable(objCD, {}).proxy]) {
     26    var names = Object.getOwnPropertyNames(p);
     27    assertEq(names.length, 2);
     28    assertEq(names[0], 'c');
     29    assertEq(names[1], 'd');
     30 }