|can't get function arguments in stack trace from user scripts|
|Reported by char...@isomorphic.com, Jun 8 2012||Back to list|
Jun 18 2012,
Dec 2 2013,
I tried playing with this a little. Part of the problem is that the custom stack trace formatter (Error.prepareStackTrace) runs lazily, only when the .stack property is accessed, which is why the "trace inside prepare" example gives the same results as the "trace from catch()" example: the prepare step doesn't actually happen until the catch. If there were some way to force V8 to invoke the stack trace formatter eagerly (at throw time) instead of lazily (at catch time), you'd be able to see all the arguments as in the "trace from before crash" case. I realize this would be at odds with the whole reason for making the stack trace formatting run lazily in the first place. But it would be helpful for some debugging scenarios. However, getting the arguments from the old "function.arguments" property is nondesirable because of the holes that design has always had -- it doesn't work with recursive functions, and it's illegal in strict mode. It would be really nice if the CallSite object could just expose the arguments, without going through the function object for the current CallSite.
Nov 4 2014,
Nov 4 2014,
not going to touch error formatting until it is spec'ed.
|► Sign in to add a comment|