tor-browser

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

S11.4.4_A5_T2.js (904B)


      1 // Copyright (C) 2014 André Bargull. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 info: Operator ++x calls PutValue(lhs, newValue)
      6 es5id: S11.4.4_A5_T2
      7 description: >
      8    Evaluating LeftHandSideExpression lhs returns Reference type; Reference
      9    base value is an environment record and environment record kind is
     10    object environment record. PutValue(lhs, newValue) uses the initially
     11    created Reference even if the environment binding is no longer present.
     12    Binding in surrounding global environment record is not changed.
     13 flags: [noStrict]
     14 ---*/
     15 
     16 var x = 0;
     17 var scope = {
     18  get x() {
     19    delete this.x;
     20    return 2;
     21  }
     22 };
     23 
     24 with (scope) {
     25  ++x;
     26 }
     27 
     28 if (scope.x !== 3) {
     29  throw new Test262Error('#1: scope.x === 3. Actual: ' + (scope.x));
     30 }
     31 if (x !== 0) {
     32  throw new Test262Error('#2: x === 0. Actual: ' + (x));
     33 }
     34 
     35 reportCompare(0, 0);