[quickjs-devel] Re: stackframe and line number

  • From: Guido Grassel <guido.grassel@xxxxxxxxxx>
  • To: "quickjs-devel@xxxxxxxxxxxxx" <quickjs-devel@xxxxxxxxxxxxx>
  • Date: Thu, 6 Feb 2020 16:48:24 +0000

Hi!


If I execute some JS in text representation the function for sure dumps the 
stack with filename and line numbers for each function on the stack.


Your pseudo code suggests you want to do the same with already compiled 
bytecode,

means you were able to compile the code ok, but when you actually execute it, 
the exception occurs.

I am afraid, I have not had the case, yet. Would need to construct a case.


BTW, are you sure you did not add 'use strip' either in your source code or as 
a parameter when reading the JS sources?


- Guido

________________________________
From: quickjs-devel-bounce@xxxxxxxxxxxxx <quickjs-devel-bounce@xxxxxxxxxxxxx> 
on behalf of JM <jeevhi@xxxxxxxxx>
Sent: 06 February 2020 15:10:35
To: quickjs-devel@xxxxxxxxxxxxx
Subject: [quickjs-devel] Re: stackframe and line number

can anyone help? even qjs has the same limitation.

On Tue, Feb 4, 2020 at 7:01 PM JM <jeevhi@xxxxxxxxx<mailto:jeevhi@xxxxxxxxx>> 
wrote:
How to dump filename and line number when calling a javascript function using 
JS_EvalFunction() and having an exception

The following code does not dump the stack frame.

JSValue value = JS_EvalFunction(ctx, byte_code);
if (JS_IsException(value)) {
                js_std_dump_error(ctx);
}

It seems like JS_EvalFunction internally calls  JS_EvalFunctionInternal with 
NULL JSStackFrame, is that a reason? how to solve it?

Other related posts: