Browse Source

js: Insert newline after each line in REPL mode

This makes ASI work in the REPL.
yeeter-the-dog 4 years ago
parent
commit
3ccf4dc7ad
1 changed files with 1 additions and 0 deletions
  1. 1 0
      Userland/Utilities/js.cpp

+ 1 - 0
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 {