early-errors-tail-position-op-template-string-esi.js (681B)
1 // |reftest| error:SyntaxError 2 // Copyright 2020 Salesforce.com, Inc. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 /*--- 5 esid: prod-OptionalExpression 6 description: > 7 template string passed to tail position of optional chain 8 info: | 9 Static Semantics: Early Errors 10 OptionalChain: 11 ?.TemplateLiteral 12 OptionalChain TemplateLiteral 13 14 It is a Syntax Error if any code matches this production. 15 features: [optional-chaining] 16 negative: 17 phase: parse 18 type: SyntaxError 19 ---*/ 20 21 $DONOTEVALUATE(); 22 23 const a = function() {}; 24 25 // This production exists in order to prevent automatic semicolon 26 // insertion rules. 27 a?. 28 `hello`