tor-browser

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

lgcl-and-assignment-operator-no-set-strict.js (746B)


      1 'use strict';
      2 // Copyright (c) 2020 Ecma International.  All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-assignment-operators-runtime-semantics-evaluation
      7 description: >
      8    Strict Mode - TypeError is not thrown if the LeftHandSide of a Logical
      9    Assignment operator(&&=) is a reference to a data property with the
     10    attribute value {[[Set]]:undefined} and PutValue step is not reached.
     11 flags: [onlyStrict]
     12 features: [logical-assignment-operators]
     13 
     14 ---*/
     15 
     16 var obj = {};
     17 Object.defineProperty(obj, "prop", {
     18  get: function() {
     19    return 0;
     20  },
     21  set: undefined,
     22  enumerable: true,
     23  configurable: true
     24 });
     25 
     26 assert.sameValue(obj.prop &&= 1, 0, "obj.prop");
     27 
     28 reportCompare(0, 0);