lgcl-or-assignment-operator-namedevaluation-function.js 711 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 Or Assignment
  6. info: |
  7. AssignmentExpression:
  8. LeftHandSideExpression ||= AssignmentExpression
  9. 5. 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 = 0;
  14. value ||= function() {};
  15. assert.sameValue(value.name, "value", "value");