update-expression-prefix.js 514 B

1234567891011121314151617181920212223
  1. // Copyright 2019 Google, Inc. All rights reserved.
  2. // This code is governed by the BSD license found in the LICENSE file.
  3. /*---
  4. esid: prod-OptionalExpression
  5. description: >
  6. optional chaining is forbidden in write contexts
  7. info: |
  8. UpdateExpression[Yield, Await]:
  9. LeftHandSideExpression++
  10. LeftHandSideExpression--
  11. ++UnaryExpression
  12. --UnaryExpression
  13. features: [optional-chaining]
  14. negative:
  15. type: SyntaxError
  16. phase: parse
  17. ---*/
  18. $DONOTEVALUATE();
  19. // --UnaryExpression
  20. const a = {};
  21. --a?.b;