diff --git a/src/expression.js b/src/expression.js index 7ee1ad031..899d57a81 100644 --- a/src/expression.js +++ b/src/expression.js @@ -531,6 +531,7 @@ pp.parseTemplate = function({isTagged = false} = {}) { let curElt = this.parseTemplateElement({isTagged}) node.quasis = [curElt] while (!curElt.tail) { + if (this.type === tt.eof) this.raise(this.pos, "Unterminated template literal") this.expect(tt.dollarBraceL) node.expressions.push(this.parseExpression()) this.expect(tt.braceR)