about summary refs log tree commit diff stats
path: root/src/bindings
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-11-30 22:21:26 +0100
committerbptato <nincsnevem662@gmail.com>2023-11-30 22:28:57 +0100
commitd3a32a80fc8b6111d9e87f0f9eaa4254ef895868 (patch)
tree6cc0ecc3a0bab48881220ecf9c4802adb4be5177 /src/bindings
parent06326cdd0ef3381a5d4fe621c10b2754225bb0c8 (diff)
downloadchawan-d3a32a80fc8b6111d9e87f0f9eaa4254ef895868.tar.gz
js: simplify toJSP0
* Expose js_create_from_ctor from QuickJS and directly use that (instead
  of badly recreating it)
* Do not call defineUnforgeable twice (it is inevitably called in toJSP0,
  so jsctor does not need it)
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/quickjs.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bindings/quickjs.nim b/src/bindings/quickjs.nim
index 7f27876b..01182b90 100644
--- a/src/bindings/quickjs.nim
+++ b/src/bindings/quickjs.nim
@@ -407,8 +407,12 @@ proc JS_GetOwnPropertyNames*(ctx: JSContext,
     ptab: ptr ptr UncheckedArray[JSPropertyEnum], plen: ptr uint32,
     obj: JSValue, flags: cint): cint
 
-proc JS_GetOwnProperty*(ctx: JSContext, desc: ptr JSPropertyDescriptor, obj: JSValue, prop: JSAtom): cint
-proc JS_Call*(ctx: JSContext, func_obj, this_obj: JSValue, argc: cint, argv: ptr JSValue): JSValue
+proc JS_GetOwnProperty*(ctx: JSContext, desc: ptr JSPropertyDescriptor,
+  obj: JSValue, prop: JSAtom): cint
+proc JS_Call*(ctx: JSContext, func_obj, this_obj: JSValue, argc: cint,
+  argv: ptr JSValue): JSValue
+proc JS_NewObjectFromCtor*(ctx: JSContext, ctor: JSValue,
+  class_id: JSClassID): JSValue
 proc JS_CallConstructor*(ctx: JSContext, func_obj: JSValue, argc: cint,
   argv: ptr JSValue): JSValue