summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryeeter-the-dog <86205456+yeeter-the-dog@users.noreply.github.com>2021-06-20 13:58:57 -0700
committerGitHub <noreply@github.com>2021-06-20 21:58:57 +0100
commit3ccf4dc7ad4c64c0ccff7c7098bb44446bc89b14 (patch)
tree88be82323d5792124b95f350224dba9b0d1a559a
parent54852832b192978fc873f74038e80792a476385e (diff)
downloadserenity-3ccf4dc7ad4c64c0ccff7c7098bb44446bc89b14.zip
js: Insert newline after each line in REPL mode
This makes ASI work in the REPL.
-rw-r--r--Userland/Utilities/js.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp
index 69e45a178d..a4beb6ff20 100644
--- a/Userland/Utilities/js.cpp
+++ b/Userland/Utilities/js.cpp
@@ -121,6 +121,7 @@ static String read_next_piece()
s_editor->add_to_history(line);
piece.append(line);
+ piece.append('\n');
auto lexer = JS::Lexer(line);
enum {