From 5b5ae9152fd33100c20d20e453108b72d44e088a Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Sat, 15 Feb 2020 03:03:05 -0500 Subject: [PATCH] Fix REPL ASI handling when new input starts with '-' (#944) --- src/bin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin.ts b/src/bin.ts index 88a5131cf..c303129a3 100644 --- a/src/bin.ts +++ b/src/bin.ts @@ -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` }