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/js/regex.nim | |
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/js/regex.nim')
-rw-r--r-- | src/js/regex.nim | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/js/regex.nim b/src/js/regex.nim index d7371428..157e1fbc 100644 --- a/src/js/regex.nim +++ b/src/js/regex.nim @@ -2,7 +2,6 @@ import bindings/libregexp import bindings/quickjs -import js/javascript import utils/opt import utils/twtstr @@ -30,8 +29,8 @@ type rule: string global: bool -var dummyRuntime = newJSRuntime() -var dummyContext = dummyRuntime.newJSContextRaw() +var dummyRuntime = JS_NewRuntime() +var dummyContext = JS_NewContextRaw(dummyRuntime) when NimMajor >= 2: proc `=destroy`*(regex: Regex) = |