early-errors-tail-position-null-op-template-string-esi.js 627 B

12345678910111213141516171819202122232425
  1. // Copyright 2020 Salesforce.com, 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. template string passed to tail position of optional chain
  7. info: |
  8. Static Semantics: Early Errors
  9. OptionalChain:
  10. ?.TemplateLiteral
  11. OptionalChain TemplateLiteral
  12. It is a Syntax Error if any code matches this production.
  13. features: [optional-chaining]
  14. negative:
  15. type: SyntaxError
  16. phase: parse
  17. ---*/
  18. $DONOTEVALUATE();
  19. // This production exists in order to prevent automatic semicolon
  20. // insertion rules.
  21. null?.
  22. `hello`