tor-browser

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

trap-is-undefined-not-strict.js (687B)


      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.10
      5 description: >
      6    [[Delete]] (P)
      7 
      8    8. If trap is undefined, then Return target.[[Delete]](P).
      9 flags: [noStrict]
     10 features: [Proxy]
     11 ---*/
     12 
     13 var target = {
     14  attr: 1
     15 };
     16 var p = new Proxy(target, {});
     17 
     18 assert.sameValue(delete p.attr, true);
     19 assert.sameValue(delete p.notThere, true);
     20 assert.sameValue(
     21  Object.getOwnPropertyDescriptor(target, "attr"),
     22  undefined
     23 );
     24 
     25 Object.defineProperty(target, "attr", {
     26  configurable: false,
     27  enumerable: true,
     28  value: 1
     29 });
     30 
     31 assert.sameValue(delete p.attr, false);
     32 
     33 reportCompare(0, 0);