On Tue, Oct 28, 2014 at 5:30 PM, Francisco Tolmasky <[email protected]> wrote:
> Hi, I was wondering if its possible to get the filename/source location of a
> function's definition (without throwing an error from within the function).
> Essentially, something like Ruby's source_location. I'd like to be able to
> just do someFunction.getSourceLocation(). I'm OK with writing the v8
> bindings myself if that is necessary.
>
> Thanks,
>
> Francisco

You can with `Debug.Debug.findFunctionSourceLocation(fun)` when you
start V8 with `--expose_debug_as=Debug`.

Another way to get the debug object is to enter the debug scope (see
v8::Debug::GetDebugContext() in include/v8-debug.h) and look up the
Debug global object.

-- 
-- 
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/d/optout.

Reply via email to