Skip to content

Commit

Permalink
Fix REPL ASI handling when new input starts with '-'
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Jan 13, 2020
1 parent b90754e commit efc3717
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ function appendEval (state: EvalState, input: string) {
const undoLines = state.lines

// Handle ASI issues with TypeScript re-evaluation.
if (undoInput.charAt(undoInput.length - 1) === '\n' && /^\s*[\/\[(`]/.test(input) && !/;\s*$/.test(undoInput)) {
if (undoInput.charAt(undoInput.length - 1) === '\n' && /^\s*[\/\[(`-]/.test(input) && !/;\s*$/.test(undoInput)) {
state.input = `${state.input.slice(0, -1)};\n`
}

Expand Down

0 comments on commit efc3717

Please sign in to comment.