about summary refs log tree commit diff stats
path: root/src/js
Commit message (Collapse)AuthorAgeFilesLines
* dom: add onload content attribute to bodybptato2024-02-243-3/+26
|
* dom: print parse errors to consolebptato2024-02-241-6/+8
| | | | instead of trying to evaluate exceptions...
* Replace Chakasu with Chagashibptato2024-02-222-53/+147
| | | | | | The API is horrid :( but at least it copies less. TODO: think of a better API.
* regex: compileSearchRegex improvementsbptato2024-02-181-9/+7
| | | | | * do not eat \\c, \\C * emulate vi-style word boundary matching (\<, \>) with \b
* regex: re-work compileSearchRegexbptato2024-02-175-65/+62
| | | | | | | 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: fix fromJSEnumbptato2024-02-082-6/+17
| | | | std enum parsing uses Nim ident matching rules, which is incorrect here.
* regex: fix 8-bit narrow strings in JSbptato2024-02-051-1/+1
| | | | | The previous approach to add UTF-8 support to libregexp was broken. This time, we use a separate flag (cbuf_len == 3) to indicate UTF-8 input.
* js: always use var destructorbptato2024-01-291-8/+2
| | | | See https://forum.nim-lang.org/t/10807
* js: update pragma docsbptato2024-01-241-3/+9
|
* js: define toStringTag properlybptato2024-01-242-3/+12
|
* js: allow specifying static function name, small refactoringbptato2024-01-241-58/+60
| | | | | | | | * static function names can now be defined using the syntax `Class:functionName' (or just use `Class' to take the default name * fix URL.canParse with 1 argument only * do not store JSFuncGenerator for constructors; just put the function node in BoundFunctions
* js: small improvementsbptato2024-01-172-21/+53
| | | | | * turn JSFuncGenerator into a ref object (it's faster this way) * remove strformat dependency
* Use errDOMException template everywherebptato2024-01-111-4/+4
|
* js: merge some type modules into jstypesbptato2024-01-119-44/+45
| | | | They only had type definitions, no need to put them in separate modules.
* js: use Nim allocatorbptato2024-01-081-1/+19
|
* Use std/* imports everywherebptato2024-01-076-19/+19
|
* tojs: document + remove unused JSCFunction converterbptato2024-01-071-7/+41
|
* Fix some casing issuesbptato2024-01-061-4/+4
|
* Compile with styleCheck:usagesbptato2023-12-283-3/+3
| | | | much better
* dom: use JS_EvalFunction; add module fetching stubsbptato2023-12-251-0/+7
| | | | (still no module support in buffer...)
* bindings/quickjs: cint -> csize_tbptato2023-12-231-2/+3
| | | | | | cint was incorrect :/ Makes me wonder if maybe we should just use futhark after all...
* js: fix nil deref in jsgetpropbptato2023-12-201-4/+9
| | | | Turns out desc can in fact be nil.
* pager: add marksbptato2023-12-091-0/+15
| | | | | Default is vi-style, but w3m-style marks work as well; see bonus/w3m.toml.
* event: remove ctx from CustomEventbptato2023-12-032-23/+38
| | | | | Instead, make finalizers optionally pass their runtime for resource deallocation.
* pager, container: add text selection/copyingbptato2023-12-032-0/+26
| | | | | | | | | | * 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 `\'
* Get rid of clang 16 workaroundbptato2023-12-021-2/+3
| | | | | * bindings/quickjs: importc and use correct pointer types * add constcharp module for when it is unavoidable
* js: get rid of emitbptato2023-12-021-22/+15
| | | | now I know how to :P
* js: get rid of getJSValuebptato2023-12-021-10/+9
| | | | just use an UncheckedArray in the binding
* html: add HTMLElement.dataset (+ some twtstr cleanup)bptato2023-12-011-6/+14
|
* js: simplify toJSP0bptato2023-11-302-31/+11
| | | | | | | * 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-303-5/+50
|
* intl: stub out Intl.PluralRulesbptato2023-11-302-0/+26
|
* js: remove nonsensical comment linebptato2023-11-261-1/+0
|
* fromjs: fix fromJSOption with nilbptato2023-11-211-1/+1
| | | | Use option() instead of some()
* js: refine isInstanceOf check in functionsbptato2023-10-253-13/+30
| | | | Special case the global object, check for inheritance, etc.
* js: define global properties as CONFIGURABLE | WRITABLEbptato2023-10-252-2/+7
|
* reduce new() usagebptato2023-10-252-3/+2
|
* Add jspropnames, CSSStyleDeclaration stubbptato2023-10-252-3/+92
|
* dom: add outerHTML setterbptato2023-10-231-0/+3
| | | | Also, misc. refactorings
* fromjs: update FromJSAllowedTbptato2023-10-211-1/+2
|
* fromjs: remove IsNumber check from float, remove unused functionsbptato2023-10-211-21/+0
|
* fromJSInt: do not fail if not IsNumberbptato2023-10-211-2/+0
| | | | to match standard behavior (e.g. accept null as int, etc)
* base64: reduce pointless re-coding using JSStringbptato2023-10-214-35/+31
| | | | | We now expose some functions from QuickJS to interact with JavaScript strings without re-encoding them into UTF-8.
* javascript: add TextEncoder, TextDecoderbptato2023-10-216-0/+178
|
* XHR progressbptato2023-10-141-3/+4
| | | | still non-functional
* Refactor Consolebptato2023-10-131-0/+58
| | | | | * merge dom.console & client.Console * move client-specific stuff out of Console (into callbacks when necessary)
* js: improve optional argument handlingbptato2023-09-261-1/+4
| | | | | | | If a fallback argument has been specified, treat undefined as if no argument had been given. This removes the need for the ?? 1 checks in the config.
* client, timeout: simplifybptato2023-09-241-9/+9
| | | | | We don't use the generic feature of selectors, so just unify the client & buffer timeout types.
* regex: copy after compilingbptato2023-09-241-38/+17
| | | | | | | | | | | | Instead of the broken attempt at making regexes zero-copy (it copied anyway), copy once and forget about it. (There have been way too many problems with the destructor approach, including the latest one where the GC would happily zero out our regexes if they were in a sequence. Maybe we can make this work once we switched to ORC. For now, it's not worth the trouble.)
* dom: add document.all, misc fixesbptato2023-09-193-4/+12
| | | | | | | | * 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.