| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
* simplify processData
* set document charset on creation
* update chagashi
|
| |
|
|
|
|
| |
Operation "modularize Chawan somewhat" part 3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
- simplify `JS_IsArray` for proxy chains
- remove `js_proxy_isArray`
|
|
|
|
|
|
| |
* 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()`
* Remove unnecessary `JS_SetUncatchableError` declaration
|
| |
|
| |
|
|
|
|
| |
taking it from upstream
|
| |
|
|
|
|
|
|
| |
- accept `class P { async = 1 }}`
- accept `class P { static = 1 }}` etc.
- Fixes #261
|
|
|
|
| |
Co-authored-by: Richard Davison <ridaviso@amazon.com>
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
| |
- Document table and index formats
- Add size statistics
- Fix UBSAN issue in `get_le24()`
Fixes #285
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
e.g. 0x0.a should return undefined, not SyntaxError.
|
| |
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
| |
|
|
|
|
|
| |
- disable BigDecimal convertion in `JS_ReadBigNum`
- fix some error messages
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
| |
Importing patch from upstream instead.
This reverts commits ccf177cc125e120b338612bbf24966faf3fd87fa and
6776f4dba975137f4034b1295c0f1958b752a2cb.
|
| |
|
|
|
|
| |
it seems OpenBSD has no malloc_usable_size
|
|
|
|
|
|
|
| |
- 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`
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
broken in upstream :(
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
| |
- `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
|
|
|
|
|
|
|
|
|
|
|
|
| |
- use `double` arithmetic where necessary to match the spec
- use `volatile` to ensure correct order of evaluation
and prevent FMA code generation
- reject some border cases.
- avoid undefined behavior in `double` -> `int64_t` conversions
- improved tests/test_builtin.js `assert` function to compare
values more reliably.
- added some tests in `test_date()`
- disable some of these tests on win32 and cygwin targets
|
|
|
|
|
|
|
|
|
| |
If you want to extend a built-in class you need it's class ID and there
is no robust way to get that without this accessor.
* add JS_INVALID_CLASS_ID constant for invalid class ID.
Signed-off-by: Tyler Rockwood <rockwood@redpanda.com>
|
|
|
|
|
|
|
|
|
| |
- add inline function to test and convert surrogates
is_surrogate(c), is_hi_surrogate(c), is_lo_surrogate(c),
get_hi_surrogate(c), get_lo_surrogate(c), from_surrogate(hi, lo)
- use names for BC header offsets and lengths in libregexp.c
- remove strict aliasing violations in `lre_exec_backtrack()`
- pass all context variables to XXX_CHAR macros in `lre_exec_backtrack()`
|
|
|
|
|
| |
- rename is_utf16 structure member to is_unicode
- rename flag LRE_FLAG_UTF16 as LRE_FLAG_UNICODE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Big endian serialization was broken because:
- it partially relied on `WORDS_ENDIAN` (unconditionally undef'd in cutils.h)
- endianness was not handled at all in the bc reader.
Modifications:
- remove `WORDS_ENDIAN`
- use `bc_put_u32()` / `bc_put_u64()` in `JS_WriteBigInt()`
- use `bc_get_u32()` / `bc_get_u64()` in `JS_ReadBigInt()`
- handle host endianness in `bc_get_u16()`, `bc_get_u32()`, `bc_get_u64()` and
`JS_ReadFunctionBytecode()`
- handle optional littleEndian argument as specified in
`js_dataview_getValue()` and `js_dataview_setValue()`
|
|
|
|
|
|
|
| |
- Use uint32_t arithmetics and Standard conformant conversion to
avoid UB in js_math_imul.
- add builtin tests
- use specific object directories for SAN targets
|
| |
|
|
|
|
|
|
|
|
| |
ssize_t is not always available and the cast it was used in wasn't
necessary in the first place, the value already has the right type.
Note that the field malloc_limit is an int64_t in JSMemoryUsage whereas it
is a size_t in JSMallocState.
|
|
|
|
|
|
| |
- add more cases of in place string concatenation
this temporary hack improves the microbench timing by 30% but
has little impact on the test262 timings.
|
|
|
|
|
|
|
| |
- remove temporary fix for MemorySanitizer:
setting p->u.array.count to 0 silenced a warning in JS_GetPropertyValue on a
hacky test agains the length of fast_array object.
This hack was removed by commit c3635861f63931255c7a953bccbb0e2e90cc75aa.
|
|
|
|
|
|
| |
- force evaluation order in `set_date_fields`
- fix evaluation error in test262/test/built-ins/Date/UTC/fp-evaluation-order.js:19:
unexpected error: Test262Error: precision in MakeDate Expected SameValue(«34448384», «34447360») to be true
|
|
|
|
|
|
| |
MemorySanitizer complained about uninitialized reads in
the indexed property code path in JS_GetPropertyValue()
with JS_CLASS_MAPPED_ARGUMENTS objects.
|