repl: force editorMode in .load · nodejs/node@eee2aa6 · GitHub
Skip to content

Commit eee2aa6

Browse files
lanceMylesBorins
authored andcommitted
repl: force editorMode in .load
The `.load` command would fail with any file that contains multiline `.` operator expressions. This was particularly noticeable when chaining promises or multi-line arrow expressions. This change Forces the REPL to be in `editorMode` while loading a file from disk using the `.load` command. Fixes: #14022 PR-URL: #14861 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com>
1 parent 72aae04 commit eee2aa6

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

lib/repl.js

Lines changed: 4 additions & 1 deletion
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const getLunch = () =>
2+
placeOrder('tacos')
3+
.then(eat);
4+
5+
const placeOrder = (order) => Promise.resolve(order);
6+
const eat = (food) => '<nom nom nom>';
Lines changed: 38 additions & 0 deletions

0 commit comments

Comments
 (0)