Skip to content

JS_Eval returns JS_TAG_UNDEFINED #1128

Closed Answered by vincentparrett
vincentparrett asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, so this was user error. I read somewhere that the return val of JS_Eval is the module - so was expecting to get a module value back - when in reality it's return undefined in both Win32/64.

I eventually traced my real problem (C function not being called) to the size of enums - in Delphi they will be emitted in as msaller size as possible.

the fix was to set the enum size

type
   {$MINENUMSIZE 4}
  JSCFunctionEnum = (
    JS_CFUNC_generic,
    JS_CFUNC_generic_magic,
    JS_CFUNC_constructor,
    JS_CFUNC_constructor_magic,
    JS_CFUNC_constructor_or_func,
    JS_CFUNC_constructor_or_func_magic,
    JS_CFUNC_f_f,
    JS_CFUNC_f_f_f,
    JS_CFUNC_getter,
    JS_CFUNC_setter,
    JS_CF…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by vincentparrett
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants