aboutsummaryrefslogtreecommitdiffstats
path: root/src/js
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-09 12:44:26 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-09 12:44:26 +0200
commit530fc9f9212802db84c8ef0a9854e88b0d389944 (patch)
tree1a0b415d1d722c269e1366b90b19fae11ab3d05a /src/js
parentff77767ed4d9e2a1ed1ad8c2951127340d97f345 (diff)
downloadchawan-530fc9f9212802db84c8ef0a9854e88b0d389944.tar.gz
tojs: remove JSDict
it's broken anyway, and unused currently
Diffstat (limited to 'src/js')
-rw-r--r--src/js/tojs.nim12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/js/tojs.nim b/src/js/tojs.nim
index cd4f2b86..511af52d 100644
--- a/src/js/tojs.nim
+++ b/src/js/tojs.nim
@@ -34,7 +34,6 @@ proc toJS*(ctx: JSContext, promise: EmptyPromise): JSValue
proc toJS*(ctx: JSContext, obj: ref object): JSValue
proc toJS*(ctx: JSContext, err: JSError): JSValue
proc toJS*(ctx: JSContext, f: JSCFunction): JSValue
-proc toJS*(ctx: JSContext, d: JSDict): JSValue
# Convert Nim types to the corresponding JavaScript type, with knowledge of
# the parent object.
@@ -257,17 +256,6 @@ proc toJS*(ctx: JSContext, err: JSError): JSValue =
proc toJS*(ctx: JSContext, f: JSCFunction): JSValue =
return JS_NewCFunction(ctx, f, cstring"", 0)
-proc toJS*(ctx: JSContext, d: JSDict): JSValue =
- let obj = JS_NewObject(ctx)
- if JS_IsException(obj):
- return obj
- for k, v in d.fieldPairs:
- let val = toJS(ctx, v)
- if JS_IsException(val):
- return val
- definePropertyCWE(ctx, obj, k, val)
- return obj
-
proc toJSP(ctx: JSContext, parent: ref object, child: var object): JSValue =
let p = addr child
# Save parent as the original ancestor for this tree.