tor-browser

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

S11.13.1_A5_T3.js (986B)


      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: Assignment Operator calls PutValue(lref, rval)
      6 es5id: S11.13.1_A5_T3
      7 description: >
      8    Evaluating LeftHandSideExpression lref returns Reference type; Reference
      9    base value is an environment record and environment record kind is
     10    object environment record. PutValue(lref, rval) uses the initially
     11    created Reference even if the environment binding is no longer present.
     12    Binding in surrounding object environment record is not changed.
     13 flags: [noStrict]
     14 ---*/
     15 
     16 var outerScope = {x: 0};
     17 var innerScope = {x: 1};
     18 
     19 with (outerScope) {
     20  with (innerScope) {
     21    x = (delete innerScope.x, 2);
     22  }
     23 }
     24 
     25 if (innerScope.x !== 2) {
     26  throw new Test262Error('#1: innerScope.x === 2. Actual: ' + (innerScope.x));
     27 }
     28 if (outerScope.x !== 0) {
     29  throw new Test262Error('#2: outerScope.x === 0. Actual: ' + (outerScope.x));
     30 }
     31 
     32 reportCompare(0, 0);