[quickjs-devel] Re: JS_Eval with JS_EVAL_FLAG_COMPILE_ONLY is not a function

  • From: Connor Nolan <connor24nolan@xxxxxxxx>
  • To: "quickjs-devel@xxxxxxxxxxxxx" <quickjs-devel@xxxxxxxxxxxxx>
  • Date: Wed, 21 Aug 2019 19:42:04 +0000

Is there any way to turn it into a JS function?


________________________________
From: quickjs-devel-bounce@xxxxxxxxxxxxx <quickjs-devel-bounce@xxxxxxxxxxxxx> 
on behalf of Fabrice Bellard <fabrice@xxxxxxxxxxx>
Sent: Wednesday, August 21, 2019 1:08 AM
To: quickjs-devel@xxxxxxxxxxxxx <quickjs-devel@xxxxxxxxxxxxx>
Subject: [quickjs-devel] Re: JS_Eval with JS_EVAL_FLAG_COMPILE_ONLY is not a 
function

JS_EVAL_FLAG_COMPILE_ONLY is flagged for internal use in quickjs.h so
you should not use it.

For your information, JS_Eval() with JS_EVAL_FLAG_COMPILE_ONLY does not
return a JS function but bytecode. It can be evaluated with
JS_EvalBinary() after having been converted to a binary JSON object. It
is used by qjsc for example.

Best regards,

Fabrice.

On 8/20/19 9:48 PM, Connor Nolan wrote:

Any update on this?

------------------------------------------------------------------------
*From:* quickjs-devel-bounce@xxxxxxxxxxxxx
<quickjs-devel-bounce@xxxxxxxxxxxxx> on behalf of Connor Nolan
<connor24nolan@xxxxxxxx>
*Sent:* Wednesday, August 14, 2019 11:07 AM
*To:* quickjs-devel@xxxxxxxxxxxxx <quickjs-devel@xxxxxxxxxxxxx>
*Subject:* [quickjs-devel] JS_Eval with JS_EVAL_FLAG_COMPILE_ONLY is not
a function
Compiling JS code into a function with JS_Eval, passing it to JS, and
trying top call it, results in this error: "TypeError: not a function".

Other related posts: