REPL .load multiline arrow function expressions #14022
Closed
Description
- Version: v7.10.0
- Platform: Linux DC-28 4.4.0-43-Microsoft deps: update openssl to 1.0.1j #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux
There is no documented way of doing a .load
in .editor
style, causing multiline expressions (and JavaScript's implicit semicolons within a REPL) to break functions such as this:
const parseXlsx = (file) =>
getFile(file)
.then(data => xlsx.read(data))
(After getFile(file), the single line REPL will assume that the expression is done)
Proposal:
Combine .editor
and .load
into .load-editor
or .load-multiline
that loads the entire file before executing it. Possible workarounds - requiring the file and using exports, but that's reinventing .load
. Alternatively, I'll attempt to minify the output, as that should reduce whitespace that has a special meaning in REPL single-line mode.