How Can I Get The Execution Context Of A Javascript Function Inside V8 Engine
I want to know the JS functions' calling relationship by getting the execution context or more specifically scope chain of a JS function. Consider this example: function one() {
Solution 1:
You could use (new Error()).stack
for that:
console.log((newError()).stack);
Here is a code to remove that misleading 'Error' first line:
var callStackLines = (newError()).stack.split('\n');
callStackLines.splice(0, 1);
var callStack = callStackLines.join('\n') + '\n';
console.log(callStack);
Post a Comment for "How Can I Get The Execution Context Of A Javascript Function Inside V8 Engine"