about summary refs log tree commit diff stats
path: root/src/js/tojs.nim
Commit message (Collapse)AuthorAgeFilesLines
* js: proper distinction between Opt/Optionbptato2024-03-241-2/+1
| | | | | | | | | | | | | | | | until now, this had very strange (and inconsistent) semantics: * err() was used for exception propagation, but also as a null value * Option accepted undefined as a none value, but not null * Opt and Option were used interchangeably (and mostly randomly) Now, Result is always used for error reporting, and err(nil) means JS_EXCEPTION. (Opt is a special case of Result where we don't care about the error type, and is not used in JS.) Option on the other hand means "nullable variation of normally non-nullable type", and translates to JS_NULL. In JS we mainly use it for turning strings nullable.
* dom: add onload content attribute to bodybptato2024-02-241-1/+19
|
* regex: re-work compileSearchRegexbptato2024-02-171-0/+11
| | | | | | | 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.
* js: define toStringTag properlybptato2024-01-241-0/+9
|
* js: merge some type modules into jstypesbptato2024-01-111-7/+5
| | | | They only had type definitions, no need to put them in separate modules.
* tojs: document + remove unused JSCFunction converterbptato2024-01-071-7/+41
|
* pager: add marksbptato2023-12-091-0/+15
| | | | | Default is vi-style, but w3m-style marks work as well; see bonus/w3m.toml.
* js: simplify toJSP0bptato2023-11-301-28/+10
| | | | | | | * Expose js_create_from_ctor from QuickJS and directly use that (instead of badly recreating it) * Do not call defineUnforgeable twice (it is inevitably called in toJSP0, so jsctor does not need it)
* js: allow subclassing platform objects in JSbptato2023-11-301-4/+48
|
* intl: stub out Intl.PluralRulesbptato2023-11-301-0/+9
|
* js: define global properties as CONFIGURABLE | WRITABLEbptato2023-10-251-0/+5
|
* base64: reduce pointless re-coding using JSStringbptato2023-10-211-0/+7
| | | | | We now expose some functions from QuickJS to interact with JavaScript strings without re-encoding them into UTF-8.
* javascript: add TextEncoder, TextDecoderbptato2023-10-211-0/+11
|
* dom: add document.all, misc fixesbptato2023-09-191-1/+4
| | | | | | | | * 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/
* tojs: remove JSDictbptato2023-09-091-12/+0
| | | | it's broken anyway, and unused currently
* javascript: add JSDict typebptato2023-09-091-0/+14
| | | | And use that in extern().
* tojs: fix memory leakbptato2023-09-041-5/+12
| | | | | | Welp. GC_ref should only be called if a new reference is being created. This is what we did until 48f1306f, where this regression slipped in.
* buffer: basic click event supportbptato2023-08-311-1/+3
| | | | | | | Mostly a proof of concept. Just bubble it unconditionally for now and never prevent default. Also, fix fromJSFunction by Dup'ing its closure JSValue.
* javascript: refactorbptato2023-08-281-0/+273
Split out parts of the JS module, because it was starting to confuse the compiler a little. (Peakmem is back at 750M. Interesting.)