about summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* base64: reduce pointless re-coding using JSStringbptato2023-10-212-1/+35
| | | | | 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/+0
|
* add_eval_variables: do not close over `this' twicebptato2023-10-131-1/+2
| | | | | See https://github.com/bellard/quickjs/issues/192. (Thanks to @dchest for the proposed fix.)
* Update chamebptato2023-09-301-0/+0
|
* update chamebptato2023-09-241-0/+0
|
* update chakasubptato2023-09-241-0/+0
|
* Fix stack overflow in CVE-2023-31922Nick Vatamaniuc2023-09-231-0/+6
| | | | | | | | | | | | | | | | | | | isArray and proxy isArray can call each other indefinitely in a mutually recursive loop. Add a stack overflow check in the js_proxy_isArray function before calling JS_isArray(ctx, s->target). With ASAN the the poc.js from issue 178: ``` ./qjs ./poc.js InternalError: stack overflow at isArray (native) at <eval> (./poc.js:4) ``` Fix: https://github.com/bellard/quickjs/issues/178
* fix undefined behavior: shift 32 bits for uint32_t in bf_set_uiBo Yao2023-09-231-1/+6
|
* update chamebptato2023-09-191-0/+0
| | | | and with that, resolve the unknown input type issue
* Update submodulesbptato2023-09-142-0/+0
|
* quickjs: add Array.prototype.atbptato2023-09-031-0/+30
|
* Move HTML parsing into Chamebptato2023-08-151-0/+0
| | | | Operation "modularize Chawan somewhat" part 2
* Update chakasubptato2023-08-151-0/+0
|
* Move charsets into chakasubptato2023-08-141-0/+0
| | | | Operation "modularize Chawan somewhat" part 1
* Fixes & workarounds to compile on Nim 2.0.0bptato2023-08-011-0/+211
| | | | | | | | | | | | | | * Import punycode, as it has been removed from stdlib. * Fix some syntax errors * Apparently you can no longer compare distinct pointers with nil. Add explicit comparisons with typeof(nil) instead. * htmlparser: rename _ to other, as semantics of _ have changed. (Quite a shame, it looked better with _. Oh well.) * Explicitly specify mm:refc, as the browser OOMs with orc for some reason. Confirmed to compile & run on 2.0.0, 1.6.14, 1.6.12, 1.6.10 and 1.6.8. (<1.6.8 it's broken & wontfix.)
* Add utf-8 support to libregexpbptato2023-07-041-6/+14
| | | | | | | This allows us to greatly simplify exec(Regex). In particular, we no longer have to convert any line containing non-ascii characters into UTF-16 (which was a significant inefficiency in regex search until now).
* Remove getClassID hackbptato2023-06-272-0/+10
| | | | Add a JS_GetClassID function to QJS instead.
* Working Nim-QuickJS GC integrationbptato2023-06-242-2/+60
| | | | I believe this works correctly. Hopefully I'm not wrong.
* Include QuickJS sources in the repositorybptato2023-06-2216-0/+74804
| | | | Taken from txiki.js, so it includes zamofex's top-level await patch.
* Add indexed color, other png improvementsbptato2023-06-091-186/+0
|
* Add support for canvas and multipartbptato2023-06-051-0/+186
Quite incomplete canvas implementation. Crucially, the layout engine can't do much with whatever is drawn because it doesn't support images yet. I've re-introduced multipart as well, with the FormData API. For the append function I've also introduced a hack to the JS binding generator that allows requesting the JSContext pointer in nim procs. Really I should just fix the union generator thing and add support for overloading. In conclusion, for now the only thing canvas can be used for is exporting it as PNG and uploading it somewhere. Also, we now have PNG encoding and decoding too. (Now if only we had sixels as well...)