API to get stack frame info from generator

Andy Wingo wingo at igalia.com
Mon Jun 17 00:36:33 PDT 2013

On Sat 15 Jun 2013 19:17, David Bruant <bruant.d at gmail.com> writes:

> Le 15/06/2013 11:18, Bruno Jouhier a écrit :
>> A generator object represents a computation which has been
>> suspended. We have an API to resume this computation
>> (next/throw). What's missing is an API to get information about this
>> suspended computation (which function, where in the source).
> Back to your problem, I worry that this kind of information (a call to
> get the stack trace of where the generator last yielding with line
> number) may partially break encapsulation which wouldn't be good for
> security.

Given the plans to have a Reflect module, I would put it there, in that
case.  Presumably people that can get at Reflect can get at anything.


More information about the es-discuss mailing list