about summary refs log tree commit diff stats
path: root/src/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-08 19:20:18 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-08 19:20:27 +0200
commitc90c11ea3840c9d25edb16aa5e6a2c366406cb89 (patch)
tree085de879e8c7938892e4e5300426b3a2b3a575b7 /src/js
parentcaf1acc77ac74cf1e47c1a450922b9db2da1bdd8 (diff)
downloadchawan-c90c11ea3840c9d25edb16aa5e6a2c366406cb89.tar.gz
js: fix compileModule
Diffstat (limited to 'src/js')
-rw-r--r--src/js/javascript.nim2
-rw-r--r--src/js/jsmodule.nim2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/js/javascript.nim b/src/js/javascript.nim
index 7bbf2419..2427b6a8 100644
--- a/src/js/javascript.nim
+++ b/src/js/javascript.nim
@@ -1694,7 +1694,7 @@ proc eval*(ctx: JSContext; s, file: string; eval_flags: int): JSValue =
 proc compileScript*(ctx: JSContext; s, file: string): JSValue =
   return ctx.eval(s, file, JS_EVAL_FLAG_COMPILE_ONLY)
 
-proc compileModule*(ctx: JSContext; s: string; file: cstring): JSValue =
+proc compileModule*(ctx: JSContext; s, file: string): JSValue =
   return ctx.eval(s, file, JS_EVAL_TYPE_MODULE or JS_EVAL_FLAG_COMPILE_ONLY)
 
 proc evalFunction*(ctx: JSContext; val: JSValue): JSValue =
diff --git a/src/js/jsmodule.nim b/src/js/jsmodule.nim
index 636065b8..90ad7130 100644
--- a/src/js/jsmodule.nim
+++ b/src/js/jsmodule.nim
@@ -13,7 +13,7 @@ proc setImportMeta(ctx: JSContext; funcVal: JSValue; isMain: bool) =
   JS_FreeAtom(ctx, moduleNameAtom)
 
 proc finishLoadModule*(ctx: JSContext; f: string; name: cstring): JSModuleDef =
-  let funcVal = compileModule(ctx, f, name)
+  let funcVal = compileModule(ctx, f, $name)
   if JS_IsException(funcVal):
     return nil
   setImportMeta(ctx, funcVal, false)