tor-browser

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

trap-is-undefined-no-property.js (598B)


      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.8
      5 description: >
      6    [[Get]] (P, Receiver)
      7 
      8    8. If trap is undefined, then return target.[[Get]](P, Receiver).
      9 features: [Proxy]
     10 ---*/
     11 
     12 var target = {
     13  attr: 1
     14 };
     15 var p = new Proxy(target, {});
     16 
     17 assert.sameValue(p.attr, 1, 'return target.attr');
     18 assert.sameValue(p.foo, undefined, 'return target.foo');
     19 assert.sameValue(p['attr'], 1, 'return target.attr');
     20 assert.sameValue(p['foo'], undefined, 'return target.foo');
     21 
     22 reportCompare(0, 0);