diff --git a/js/repl.ts b/js/repl.ts index 806a3e1426eba3..4fae31eabc896e 100644 --- a/js/repl.ts +++ b/js/repl.ts @@ -124,7 +124,7 @@ function parenthesesAreOpen(code: string): boolean { if (bracePosition % 2 === 0) { stack.push(bracePosition + 1); // push next expected brace position } else { - if (stack.length === 0 || stack.pop() !== bracePosition) { + if (stack.pop() !== bracePosition) { return false; } }