Skip to content
Permalink
Browse files

Fix Unexpected ILLEGAL token with function literal in template strings

Fixes #1991
Closes gh-1994
  • Loading branch information...
JosephPecoraro authored and ariya committed Sep 11, 2019
1 parent 5e55171 commit 3f9dc14a707a5325f2579075251876977f1e7e15
@@ -50,6 +50,7 @@ interface ScannerState {
index: number;
lineNumber: number;
lineStart: number;
curlyStack: string[];
}

export class Scanner {
@@ -62,7 +63,7 @@ export class Scanner {
index: number;
lineNumber: number;
lineStart: number;
private curlyStack: string[];
curlyStack: string[];

private readonly length: number;

@@ -83,14 +84,16 @@ export class Scanner {
return {
index: this.index,
lineNumber: this.lineNumber,
lineStart: this.lineStart
lineStart: this.lineStart,
curlyStack: this.curlyStack.slice()
};
}

public restoreState(state: ScannerState): void {
this.index = state.index;
this.lineNumber = state.lineNumber;
this.lineStart = state.lineStart;
this.curlyStack = state.curlyStack;
}

public eof(): boolean {
@@ -0,0 +1 @@
`${function() { let {x} = y; }}`

0 comments on commit 3f9dc14

Please sign in to comment.
You can’t perform that action at this time.