lgcl-and-assignment-operator-non-extensible.js 611 B

12345678910111213141516171819
  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. esid: sec-assignment-operators-runtime-semantics-evaluation
  5. description: >
  6. Strict Mode - TypeError is not thrown if The LeftHandSide of a Logical
  7. Assignment operator(&&=) is a reference to a non-existent property of an
  8. object whose [[Extensible]] internal property is false.
  9. flags: [onlyStrict]
  10. features: [logical-assignment-operators]
  11. ---*/
  12. var obj = {};
  13. Object.preventExtensions(obj);
  14. obj.prop &&= 1;
  15. assert.sameValue(obj.prop, undefined, "obj.prop");