lgcl-nullish-assignment-operator-namedevaluation-class-expression.js 719 B

1234567891011121314151617181920
  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: NamedEvaluation of Logical Nullish Assignment
  6. info: |
  7. AssignmentExpression:
  8. LeftHandSideExpression ??= AssignmentExpression
  9. 4. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then
  10. a. Let rval be NamedEvaluation of AssignmentExpression with argument GetReferencedName(lref).
  11. features: [logical-assignment-operators]
  12. ---*/
  13. var value = undefined;
  14. value ??= class {};
  15. assert.sameValue(value.name, "value", "value");