Its a common usecase for me to dynamically grab the JS file name, function 
and line number for the line that made a call. For now, its rather 
inefficient to get the caller information in most JS Engines. An example of 
the most optimal implementation is in 
bunyan.js<https://github.com/trentm/node-bunyan/blob/master/lib/bunyan.js>. 
This bunyan solution is not efficient enough to use in production due to 
the high processing burden. I think that the bunyan.js solution is very 
close to the most optimal way to grab caller information with the current 
V8 stack.

I have found it useful to get caller info for logging, debugging, logical 
and security reasons but scalability is always an issue.

It would be fantastic to have a static native JS call that we can use like 
Error.getCallerInfo(<int>) which would return a CallSite object for <int> 
items back in the call stack.

Would it be much to implement Error.getCallerInfo(<int>) in V8?

Thanks,
- Tim

-- 
-- 
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.

Reply via email to