Hi, On Wed 05 Jun 2013 04:57, Bruno Jouhier <[email protected]> writes:
> I'm playing with version 3.19 and generators and I would need a > JavaScript API to extract stack trace information from generators. I > don't really need the whole stacktrace but I would need at least > function name + filename + line number of the top frame. I'm not really sure what you mean here. Generators are shallow coroutines consisting of a single function activation, and thus such a "stack trace" would only ever have one frame. If you have a chain of them, that's something you build in a library, not in V8 itself. As for "what you can do with a generator object", section 15.19.4 of the latest (14 May) ES6 draft specifies their behavior. Figure 2 in section 15.19.3 specifies the various prototype chain, prototype property, and constructor properties of generator objects. I believe it was suggested at one point that the per-function prototype have a .constructor link back to the specific generator function instead of to (Generator), but that was ruled out I think because of security concerns. It seems to me that the right place for this introspection is probably in the Reflect module, which hasn't been specced out yet AFAIK. So what you want is unfortunately not yet available on the language level. Happy hacking, Andy -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
