tor-browser

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

lgcl-and-assignment-operator-unresolved-rhs-put.js (597B)


      1 // Copyright (c) 2020 Ecma International.  All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-assignment-operators-runtime-semantics-evaluation
      6 description: >
      7    ReferenceError is thrown if the AssignmentExpression of a Logical
      8    Assignment operator(&&=) evaluates to an unresolvable reference and the
      9    AssignmentExpression is evaluated.
     10 features: [logical-assignment-operators]
     11 
     12 ---*/
     13 
     14 var value = 2;
     15 
     16 assert.throws(ReferenceError, function() {
     17  value &&= unresolved;
     18 });
     19 assert.sameValue(value, 2, "value");
     20 
     21 reportCompare(0, 0);