• Felix Lange's avatar
    cmd/geth, jsre: improve the js command · 87ae0df4
    Felix Lange authored
    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
    87ae0df4
Name
Last commit
Last update
..
bignumber_js.go Loading commit data...
completion.go Loading commit data...
completion_test.go Loading commit data...
ethereum_js.go Loading commit data...
jsre.go Loading commit data...
jsre_test.go Loading commit data...
pretty.go Loading commit data...