Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Script CallStack information in a method callback

$
0
0
Hi guys,

I was wondering what would be the fastest way to dump a script callstack information from within a method callback for information purposes.

To give an example, lets say we'd wanna run something bigger and not enable debugging /JIT but rather have some information with script call stack attached.

We'd create a class like:
    public class Log
    {
        public void Info(string text)
        {
            Console.WriteLine(text);
            Console.WriteLine(GetScriptCallStack());
        }
    }
Then add _jsEngine.AddHostObject("Log", new Log());

I'd be interested in how to implement the GetScriptCallStack for JScript specifically or more generally considering the jsEngine can be accessed from that method.

Any ideas? I'm thinking either calee or somehow accessing the IDebug* implementation of the WindowsScript class?

Thank you

Andi

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>