[quickjs-devel] JS_CFUNC_DEF doesn't make properties enumerable

  • From: Saúl Ibarra Corretgé <s@xxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Sun, 4 Aug 2019 14:31:25 +0200

Hi,

I noticed JS_CFUNC_DEF "hardcodes" the property flags to
JS_PROP_WRITABLE | JS_PROP_CONFIGURABLE, but not enumerable. Is this
intentional? Is the recommendation to define one's own such as:

#define JSUV_CFUNC_DEF(name, length, func1) { name, JS_PROP_ENUMERABLE,
JS_DEF_CFUNC, 0, .u.func = { length, JS_CFUNC_generic, { .generic =
func1 } } }

in order to make the definitions enumerable (or any other flag
combination) ?


Cheers,

-- 
Saúl

Other related posts: