tor-browser

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

trap-is-undefined-using-with.js (590B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 es6id: 9.5.7
      5 description: >
      6    Return target.[[HasProperty]](P) if trap is undefined.
      7 info: |
      8    [[HasProperty]] (P)
      9 
     10    ...
     11    8. If trap is undefined, then
     12        a. Return target.[[HasProperty]](P).
     13    ...
     14 flags: [noStrict]
     15 features: [Proxy]
     16 ---*/
     17 
     18 var target = Object.create(Array.prototype);
     19 var p = new Proxy(target, {});
     20 
     21 var foo = 3;
     22 with(target) {
     23  assert.sameValue(length, 0);
     24  assert.sameValue(foo, 3);
     25 }
     26 
     27 reportCompare(0, 0);