about summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Update monouchabptato2024-09-171-0/+0
| | | | I meant to fix this enum bug in the previous patch but then I forgot...
* dom: add forms, elements getter + misc fixesbptato2024-09-171-0/+0
| | | | | | | | | | | | * add document.forms * add form.elements * remove redundant jshasprop functions * use mpairs for attribute iteration (mpairs use pointers, but pairs copies) * fix remove() crash * fix remove() collection invalidation for children (if parent is not in the collection) * update monoucha
* Update chagashibptato2024-09-061-0/+0
|
* Update chagashibptato2024-09-011-0/+0
|
* Update monouchabptato2024-08-221-0/+0
|
* xhr: more progressbptato2024-08-151-0/+0
| | | | | | | | | | * add responseText, response * add net tests -> currently sync XHR only; should find a way to do async tests... * update monoucha -> simplified & updated some related code that no longer worked properly
* Update monouchabptato2024-08-091-0/+0
|
* Update monouchabptato2024-08-091-0/+0
|
* Update Chagashibptato2024-08-011-0/+0
|
* Update submodulesbptato2024-07-283-0/+0
|
* Update monouchabptato2024-07-181-0/+0
|
* Update monouchabptato2024-07-171-0/+0
|
* Update monouchabptato2024-06-221-0/+0
|
* buffer: decoding fixesbptato2024-06-141-0/+0
| | | | | | * simplify processData * set document charset on creation * update chagashi
* Update Chame, Chagashibptato2024-06-132-0/+0
|
* Move JS wrapper into Monouchabptato2024-06-0317-77220/+0
| | | | Operation "modularize Chawan somewhat" part 3
* js: fix runtime cleanupbptato2024-06-032-0/+11
| | | | | | | | | | | | | | This is a minefield. Intuitively, you would think that just clearing the opaque and manually freeing registered object should be enough. Unfortunately, this is not true; we do not store whether we are actually holding a reference to registered JS objects, so this approach leads to double frees. Instead, we add a QJS callback that is called right after the final GC cleanup, but before the list_free assertion. This way, we can be sure that any object still in our registry is referenced by us, and can therefore unreference them safely.
* regexp: fix non greedy quantizers with zero length matchesFabrice Bellard2024-05-301-8/+6
|
* Add `js_resolve_proxy` (#293)Charlie Gordon2024-05-301-20/+35
| | | | | - simplify `JS_IsArray` for proxy chains - remove `js_proxy_isArray`
* Add `JS_StrictEq()`, `JS_SameValue()`, and `JS_SameValueZero()` (#264)Kasper Isager Dalsgarð2024-05-302-5/+26
| | | | | | * add `JS_StrictEq()`, `JS_SameValue()`, and `JS_SameValueZero()` all accepting `JSValueConst` * make `js_strict_eq` accept `JSValueConst`, remove uses of this function internally and replace them with `js_strict_eq2` instead.
* Expose `JS_SetUncatchableError()` (#262)Kasper Isager Dalsgarð2024-05-302-1/+1
| | | | | | * Expose `JS_SetUncatchableError()` * Remove unnecessary `JS_SetUncatchableError` declaration
* Add `JS_HasException()` (#265)Kasper Isager Dalsgarð2024-05-302-0/+6
|
* Add `JS_NewTypedArray()` (#272)Dmitry Volyntsev2024-05-302-0/+27
|
* quickjs: revert SetUncatchableError patchbptato2024-05-301-1/+0
| | | | taking it from upstream
* libunicode: fix compilationbptato2024-05-071-1/+1
|
* Improve class parser (#289)Charlie Gordon2024-05-071-3/+9
| | | | | | - accept `class P { async = 1 }}` - accept `class P { static = 1 }}` etc. - Fixes #261
* fix class method with name get (#258)Richard Davison2024-05-071-1/+2
| | | | Co-authored-by: Richard Davison <ridaviso@amazon.com>
* Improve libunicode and libregexp headers (#288)Charlie Gordon2024-05-075-128/+237
| | | | | | | | - move all `lre_xxx` functions to libunicode - use flags table `lre_ctype_bits` instead of bitmaps - simplify `lre_is_space`, `lre_js_is_ident_first` and `lre_js_is_ident_next` - simplify `simple_next_token`, handle UTF-8 correctly - simplify `is_let`, remove dead code
* Improve unicode table handling (#286)Charlie Gordon2024-05-072-49/+148
| | | | | | | | - Document table and index formats - Add size statistics - Fix UBSAN issue in `get_le24()` Fixes #285
* client: make quit() actually quit, misc fixesbptato2024-05-041-0/+1
| | | | | | | * unwind the QJS stack with an uncatchable exception when quit is called * clean up JS references in JSRuntime free even when the Nim counterparts are still alive * simplify some tests
* sandbox: seccomp support on Linuxbptato2024-04-181-0/+6
| | | | | | | | | | | | | | | | | We use libseccomp, which is now a semi-mandatory dependency on Linux. (You can still build without it, but only if you pass a scary long flag to make.) For this to work I had to disable getTimezoneOffset, which would otherwise call localtime_r which in turn reads in some files from /usr/share/zoneinfo. To allow this we would have to give unrestricted openat(2) access to buffer processes, which is unacceptable. (Giving websites access to the local timezone is a fingerprinting vector so if this ever gets fixed then it should be an opt-in config setting.) This patch also includes misc fixes to buffer cloning, and fixes the LIBEXECDIR override in the makefile so that it is actually useful.
* quickjs: fix member accesses for non-decimal number literalsbptato2024-04-141-1/+2
| | | | e.g. 0x0.a should return undefined, not SyntaxError.
* Fix endianness handling in `js_dataview_getValue` / `js_dataview_setValue`Charlie Gordon2024-04-141-8/+8
|
* Improve error handlingCharlie Gordon2024-04-141-8/+17
| | | | | | | - detect and report invalid duplicate parameter names - throw RangeError for too many function arguments - throw RangeError for invalid string length - prevent `-Wcast-function-type` warnings
* Improve `JSON.stringify`Charlie Gordon2024-04-141-39/+43
| | | | | | | | - changed error messages - clarify `toJSON` method usage - simplify boxed objects handling - for ECMA conformity, BigInt objects need a toJSON method in the prototype chain including boxed objects
* Use more explicit magic values for array methodsCharlie Gordon2024-04-141-26/+24
|
* Simplify redundant initializers for `JS_NewBool()`Charlie Gordon2024-04-141-18/+17
|
* Fix compilation with -DCONFIG_BIGNUMCharlie Gordon2024-04-142-32/+43
| | | | | - disable BigDecimal convertion in `JS_ReadBigNum` - fix some error messages
* Improve Date.parse, small fixesCharlie Gordon2024-04-143-58/+81
| | | | | | | | - add `minimum_length` to enforce array length validation - add `JS_NewDate()` API - add `[Symbol.toStringTag]` property in the global object - simplify `string_get_milliseconds` - support more timezone abbrevs using `string_get_tzabbr` and array
* Revert bignum build fixesbptato2024-04-142-10/+0
| | | | | | | Importing patch from upstream instead. This reverts commits ccf177cc125e120b338612bbf24966faf3fd87fa and 6776f4dba975137f4034b1295c0f1958b752a2cb.
* Update Chamebptato2024-04-091-0/+0
|
* quickjs: fix OpenBSD compilationbptato2024-04-021-1/+1
| | | | it seems OpenBSD has no malloc_usable_size
* Prevent UB on memcpy and floating point conversionsCharlie Gordon2024-03-135-18/+26
| | | | | | | - add `memcpy_no_ub` that accepts null pointers for 0 count - prevent 0 length allocation in `js_worker_postMessage` - use safer test for `int` value in `JS_NewFloat64`, `JS_ToArrayLengthFree` and `js_typed_array_indexOf`
* Improve Date.parseCharlie Gordon2024-03-131-31/+106
| | | | | | | | | | - accept many more alternative date/time formats - add test cases in tests/test_builtin.js - match month and timezone names case insensitively - accept AM and PM markers - recognize US timezone names - skip parenthesized stuff - fix almost all v8 test cases
* man: rewrite in Nimbptato2024-03-131-0/+4
| | | | | | | | | | | | Depending on Perl just for this is silly. Now we use libregexp for filtering basically the same things as w3mman2html did. This required another patch to QuickJS to avoid pulling in the entire JS engine, but in return, we can now run regexes without a dummy JS context global variable. Also, man.nim now tries to find a man command on the system even if it's not in /usr/bin/man.
* Update chamebptato2024-03-031-0/+0
|
* quickjs: fix build without CONFIG_BIGNUMbptato2024-03-021-0/+8
| | | | broken in upstream :(
* Improve Number.prototype.toString for radix other than 10Charlie Gordon2024-03-021-9/+98
| | | | | | | - fix the conversions for integers and exact fractions - approximate approach for other cases. - bypass floating point conversions for JS_TAG_INT values - avoid divisions for base 10 integer conversions
* Improve Date.parseCharlie Gordon2024-03-021-224/+305
| | | | | | | | - rewrite Date.parse() with separate parsers - return `NaN` for out of bounds field values as specified - accept up to 9 decimals for millisecond fraction but truncate at 3 - accept many more alternative date/time formats - add test cases in tests/test_builtin.js
* Fix Map hash bugCharlie Gordon2024-03-021-2/+2
| | | | | | - `map_hash_key` must generate the same key for JS_INT and JS_FLOAT64 with the same value - add test cases in tests/test_builtin.js