tor-browser

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

11.4.1-4.a-5.js (733B)


      1 // Copyright (c) 2012 Ecma International.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: |
      6    This test is actually testing the [[Delete]] internal method (8.12.8). Since the
      7    language provides no way to directly exercise [[Delete]], the tests are placed here.
      8 esid: sec-delete-operator-runtime-semantics-evaluation
      9 description: >
     10    delete operator returns false when deleting the declaration of the environment object
     11    inside 'with'
     12 flags: [noStrict]
     13 ---*/
     14 
     15 var o = new Object();
     16 o.x = 1;
     17 var d;
     18 with(o) {
     19  d = delete o;
     20 }
     21 
     22 assert.sameValue(d, false, 'd');
     23 assert.sameValue(typeof o, 'object', 'typeof(o)');
     24 assert.sameValue(o.x, 1, 'o.x');
     25 
     26 reportCompare(0, 0);