about summary refs log tree commit diff stats
path: root/src/js/opaque.nim
Commit message (Collapse)AuthorAgeFilesLines
* js: refactorbptato2024-05-081-127/+0
| | | | | | | * prefix to-be-separated modules with js * remove dynstreams dependency * untangle from EmptyPromise * move typeptr into tojs
* js: fix various leaks etc.bptato2024-05-031-51/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we didn't actually free the main JS runtime, probably because you can't do this without first waiting for JS to unwind the stack. (This has the unfortunate effect that code now *can* run after quit(). TODO: find a fix for this.) This isn't a huge problem per se, we only have one of these and the OS can clean it up. However, it also disabled the JS_FreeRuntime leak check, which resulted in sieve-like behavior (manual refcounting is a pain). So now we choose the other tradeoff: quit no longer runs exitnow, but it waits for the event loop to run to the end and only then exits the browser. Then, before exit we free the JS context & runtime, and also all JS values allocated by config. Fixes: * fix `ad' flag not being set for just one siteconf/omnirule * fix various leaks (since leak check is enabled now) * use ptr UncheckedArray[JSValue] for QJS bindings that take an array * allow JSAtom in jsgetprop etc., also disallow int types other than uint32 * do not set a destructor for globals
* Update code stylebptato2024-04-171-9/+9
| | | | | | * separate params with ; (semicolon) instead of , (colon) * reduce screaming snake case use * wrap long lines
* dom: add onload content attribute to bodybptato2024-02-241-2/+6
|
* regex: re-work compileSearchRegexbptato2024-02-171-2/+6
| | | | | | | I've gotten tired of not being able to search for forward slashes. Now it works like in vim, and you can also set default ignore case in the config.
* Use std/* imports everywherebptato2024-01-071-1/+1
|
* event: remove ctx from CustomEventbptato2023-12-031-1/+3
| | | | | Instead, make finalizers optionally pass their runtime for resource deallocation.
* pager, container: add text selection/copyingbptato2023-12-031-0/+1
| | | | | | | | | | * Add select & copy selection functionality to container * Fix bug in generateSwapOutput where output could be misplaced because of zero-width cells * Add fromJSPromise, call runJSJobs in every iteration of the headed event loop * "await" pager actions that output a promise * Change default view source keybinding to `\'
* js: allow subclassing platform objects in JSbptato2023-11-301-0/+1
|
* js: refine isInstanceOf check in functionsbptato2023-10-251-0/+1
| | | | Special case the global object, check for inheritance, etc.
* javascript: add TextEncoder, TextDecoderbptato2023-10-211-0/+4
|
* dom: add document.all, misc fixesbptato2023-09-191-0/+1
| | | | | | | | * Fix an issue with Collection cache invalidation (we must invalidate collections of the parent node on insertion, so that it triggers a refresh). * Remove circular reference of document.document, now we use a function instead.
* move around more modulesbptato2023-09-141-1/+1
| | | | | | | | | | * ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
* javascript: fix a GC bugbptato2023-09-091-0/+1
| | | | | | | GC_unref may indirectly call nim_finalize_for_js, which could mess up execution of checkDestroy. I haven't encountered it in refc, but it's definitely present in orc.
* javascript: fix fromJSFunction, simplify setOpaquebptato2023-08-301-3/+3
| | | | | | * fromJSFunction: dup the value, so that it cannot go out of context. * setOpaque no longer calls GC_ref, so no need for it to be generic instead of just taking a pointer.
* javascript: factor out fromJSbptato2023-08-291-0/+37
|
* javascript: refactorbptato2023-08-281-0/+82
Split out parts of the JS module, because it was starting to confuse the compiler a little. (Peakmem is back at 750M. Interesting.)