Thanks all. A few words for the API: I introduced two calls because I wanted to have minimal overhead to capture the stack. So I'm only capturing the continuation value (an integer). I'm using the other call (GetStackFrame) to format the stack trace. The disadvantage of this approach is that I have to keep a handle on the stack of generators in the error object. So the generators won't be garbage collected until the error object goes away.
An alternative would be to capture the stack frame directly with GetStackFrame(gen). The capture operation would be a little heavier but this would lead to a simpler API. I let you sort this out because I'm not familiar with the best practices in this area. Bruno 2013/6/22 Erik Arvidsson <[email protected]> > Bruno, looks very useful. We should make sure that whatever stack API > we propose also allows you to get the stack frame for generator. > > On Sat, Jun 22, 2013 at 11:29 AM, Brendan Eich <[email protected]> > wrote: > > Bruno: cool, maybe we can build on this in SpiderMonkey too. Cc'ing Jason > > and Dave. > > > > Cc'ing Arv in case he is reading es-discuss only sporadically. > > > > /be > > > > Mark S. Miller wrote: > >> > >> Excellent. This looks like the right kind of low level enabler. Thanks! > >> > >> > >> On Sat, Jun 22, 2013 at 3:01 AM, Bruno Jouhier <[email protected] > >> <mailto:[email protected]>> wrote: > >> > >> For info, I've created a small node.js add-on that exposes a > >> getStackFrame(generator) function: > >> https://github.com/bjouhier/galaxy-stack. > >> With this I could implement long stacktrace in my "galaxy" module; > >> > >> Temporary hack but it's there for experiments until the API gets > >> sorted out. > >> > >> > >> > >> > >> -- > >> Cheers, > >> --MarkM > >> _______________________________________________ > >> es-discuss mailing list > >> [email protected] > >> https://mail.mozilla.org/listinfo/es-discuss > > > > -- > erik >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

