captureCalls.js
captureCalls.js copied to clipboard
Show argument values in stacktraces
function run(x, y) {return add(x + 1, y + 1)}
function add(x,y) {return x + y}
captureCalls(run)
run(2, 3)
Expected output:
run(x=2, y=3) -> undefined
add(x=3, y=4) -> 7 :6:1
It currently shows:
run(x=2, y=3) -> undefined
at <anonymous>:6:1
It seems plausible to implement this using caller and caller.arguments.