ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

Script Meta Data in Native Function

Open bkimman opened this issue 3 years ago • 1 comments

I am porting an old application that embedded a very old version of Mozilla js to use chakra.

This application involves several native objects written in C. The methods of these objects will be invoked from the script. If there is an exception to be raised from the native method, is there a way to determine meta data (source, url, line, column) about the script function from where the native function was called?

bkimman avatar Jul 29 '22 06:07 bkimman

JsGetAndClearExceptionWithMetadata should be able to help: https://github.com/chakra-core/ChakraCore/wiki/JsGetAndClearExceptionWithMetadata

It returns a JavaScript object containing the source information.

Let me know if this helps.

ppenzin avatar Aug 17 '22 00:08 ppenzin