diff options
author | bptato <nincsnevem662@gmail.com> | 2023-08-24 22:00:34 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-08-24 22:08:46 +0200 |
commit | 229f199e4bd3ee17ff368006e6a12448a4e04120 (patch) | |
tree | 496eb16f75d32e94c583b8ff2db1d4797f460b22 /src/bindings | |
parent | d55af421cf48d8b3a922fa3b72130f2b40870dc8 (diff) | |
download | chawan-229f199e4bd3ee17ff368006e6a12448a4e04120.tar.gz |
javascript: misc. refactorings
* Remove some unused properties from objects * Un-extern JSFunctionList * Remove js/javascript dependency from regex (the wrapper functions were rather pointless) * Remove setProperty (only toJS(Table) used it, but there we have to use defineProperty instead.) * Accordingly, use definePropertyCWE in toJS(Table) * Simplify fromJSTable (replace pointer arithmetic with UncheckedArray) * Reduce implicit `result' usage
Diffstat (limited to 'src/bindings')
-rw-r--r-- | src/bindings/quickjs.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bindings/quickjs.nim b/src/bindings/quickjs.nim index 8110dc5c..a81bd881 100644 --- a/src/bindings/quickjs.nim +++ b/src/bindings/quickjs.nim @@ -386,7 +386,9 @@ proc JS_SetPropertyFunctionList*(ctx: JSContext, obj: JSValue, tab: ptr JSCFunct proc JS_GetProperty*(ctx: JSContext, this_obj: JSValue, prop: JSAtom): JSValue proc JS_GetPropertyStr*(ctx: JSContext, this_obj: JSValue, prop: cstring): JSValue proc JS_GetPropertyUint32*(ctx: JSContext, this_obj: JSValue, idx: uint32): JSValue -proc JS_GetOwnPropertyNames*(ctx: JSContext, ptab: ptr ptr JSPropertyEnum, plen: ptr uint32, obj: JSValue, flags: cint): cint +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 |