about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/quickjs.nim11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bindings/quickjs.nim b/src/bindings/quickjs.nim
index 94b3c46e..ed2cc15d 100644
--- a/src/bindings/quickjs.nim
+++ b/src/bindings/quickjs.nim
@@ -87,6 +87,7 @@ else:
 type
   JSRuntime* = ptr object
   JSContext* = ptr object
+  JSModuleDef* = ptr object
   JSCFunction* = proc (ctx: JSContext, this_val: JSValue, argc: cint, argv: ptr JSValue): JSValue {.cdecl.}
   JSCFunctionData* = proc (ctx: JSContext, this_val: JSValue, argc: cint, argv: ptr JSValue, magic: cint, func_data: ptr JSValue): JSValue {.cdecl.}
   JSGetterFunction* = proc(ctx: JSContext, this_val: JSValue): JSValue {.cdecl.}
@@ -99,7 +100,11 @@ type
   JSClassFinalizer* = proc (rt: JSRuntime, val: JSValue) {.cdecl.}
   JSClassGCMark* = proc (rt: JSRuntime, val: JSValue, mark_func: JS_MarkFunc) {.cdecl.}
   JS_MarkFunc* = proc (rt: JSRuntime, gp: ptr JSGCObjectHeader) {.cdecl.}
-  JSJobFunc* = proc (ctx: JSContext, argc: cint, argv: ptr JSValue): JSValue
+  JSModuleNormalizeFunc* = proc(ctx: JSContext, module_base_name,
+    module_name: cstring, opaque: pointer): cstring {.cdecl.}
+  JSModuleLoaderFunc* = proc(ctx: JSContext, module_name: cstring,
+    opaque: pointer): JSModuleDef {.cdecl.}
+  JSJobFunc* = proc (ctx: JSContext, argc: cint, argv: ptr JSValue): JSValue {.cdecl.}
   JSGCObjectHeader* {.importc, header: qjsheader.} = object
 
   JSPropertyDescriptor* {.importc, header: qjsheader.} = object
@@ -424,6 +429,10 @@ proc JS_ThrowReferenceError*(ctx: JSContext, fmt: cstring): JSValue {.varargs, d
 proc JS_ThrowRangeError*(ctx: JSContext, fmt: cstring): JSValue {.varargs, discardable.}
 proc JS_ThrowInternalError*(ctx: JSContext, fmt: cstring): JSValue {.varargs, discardable.}
 
+proc JS_SetModuleLoaderFunc*(rt: JSRuntime,
+  module_normalize: JSModuleNormalizeFunc, module_loader: JSModuleLoaderFunc,
+  opaque: pointer)
+
 proc JS_EnqueueJob*(ctx: JSContext, job_func: JSJobFunc, argc: cint, argv: ptr JSValue): cint
 proc JS_IsJobPending*(rt: JSRuntime): JS_BOOL
 proc JS_ExecutePendingJob*(rt: JSRuntime, pctx: ptr JSContext): cint