good morning!!!!

Skip to content
Snippets Groups Projects
Commit 87ae0df4 authored by Felix Lange's avatar Felix Lange
Browse files

cmd/geth, jsre: improve the js command

geth js stopped the JS runtime after running the first input file
and blocked for pending callbacks. This commit makes it process
all files and enables quitting with Ctrl-C regardless of callbacks.

Error reporting is also improved. If a script fails to load, the error
is printed and includes the backtrace. package jsre now ensures that
otto is aware of the filename, the backtrace will contain them.

Before:

$ geth js bad.js; echo "exit $?"
... log messages ...
exit 0

After:

$ geth js bad.js; echo "exit $?"
... log messages ...
Fatal: JavaScript Error: Invalid number of input parameters
    at web3.js:3109:20
    at web3.js:4917:15
    at web3.js:4960:5
    at web3.js:4984:23
    at checkWork (bad.js:11:9)
    at bad.js:19:1

exit 1
parent a6ca8fd2
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment