Skip to content

Commit 22b22f3

Browse files
committed
Raise specific errors for unterminated template literals
Closes #707
1 parent 1461c7c commit 22b22f3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/expression.js

+1
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ pp.parseTemplate = function({isTagged = false} = {}) {
531531
let curElt = this.parseTemplateElement({isTagged})
532532
node.quasis = [curElt]
533533
while (!curElt.tail) {
534+
if (this.type === tt.eof) this.raise(this.pos, "Unterminated template literal")
534535
this.expect(tt.dollarBraceL)
535536
node.expressions.push(this.parseExpression())
536537
this.expect(tt.braceR)

0 commit comments

Comments
 (0)