tor-browser

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

S11.13.1_A6_T3.js (869B)


      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_A6_T3
      7 description: >
      8    Evaluating LeftHandSideExpression lref returns Reference type; Reference
      9    base value is an environment record and environment record kind is
     10    declarative environment record. PutValue(lref, rval) uses the initially
     11    created Reference even if a more local binding is available.
     12 flags: [noStrict]
     13 ---*/
     14 
     15 function testAssignment() {
     16  var x = 0;
     17  var scope = {};
     18 
     19  with (scope) {
     20    x = (scope.x = 2, 1);
     21  }
     22 
     23  if (scope.x !== 2) {
     24    throw new Test262Error('#1: scope.x === 2. Actual: ' + (scope.x));
     25  }
     26  if (x !== 1) {
     27    throw new Test262Error('#2: x === 1. Actual: ' + (x));
     28  }
     29 }
     30 testAssignment();
     31 
     32 reportCompare(0, 0);