| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
- `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.
|
|
|
|
|
| |
Prep work for enabling the sanitizers on macos CI since they are marked
as deprecated and cause the build to fail when -Werror is enabled.
|
| |
|
| |
|
|
|
|
|
| |
- fix string leak in `js_printf_internal` on errors
- read `errno` before potential side effects in `js_os_stat`
|
| |
|
|
|
|
| |
represented as a double (bnoordhuis)
|
|
|
|
| |
std.evalScript() (github issue #231)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
* the uint8array thing is probably from txiki.js, but we never used it
* upstream now has JS_GetClassID, importing that instead... (so this
commit won't build :/)
|
|
|
|
| |
obviously for ident tokens we must check value, not unit
|
| |
|
| |
|
|
|
|
|
| |
* skip whitespace in some places where we didn't but should
* fix crash in get_tok when eof comes after whitespace
|
|
|
|
|
|
|
|
| |
so that e.g.
a<span style="background-color: red"> </span>b
makes the span width exactly one space.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> The right outer edge of a left-floating box may not be to the right
> of the left outer edge of any right-floating box that is next to
> it. Analogous rules hold for right-floating elements.
says the standard
therefore it does not really matter where the beginning of the float is;
if it's float: left, then `left' must be set to the right edge, and if
it's float: right, then `right' must be set to the left edge.
(this was breaking some negative margin float abominations such that
floats were suddenly overlapping and that's certainly not what we want)
|
|
|
|
| |
it's a good idea to use the return value, but it must substitute atEnd.
|
|
|
|
|
|
|
| |
buffering output kind of defeats the purpose of the entire loader select
machinery
(we don't buffer streams either for the same reason)
|
|
|
|
|
| |
slightly more efficient, but more importantly does not choke on NUL and
weird \r\n
|
| |
|
|
|
|
| |
this is more or less how it works in w3m
|
|
|
|
|
|
| |
setCursorX only moves the screen backwards if the intended X position is
lower than the actual X position. Pass it -1 so that this is true even
with zero-width lines.
|
|
|
|
|
|
|
|
| |
left/right never really worked correctly, is non-standard, and the
only browser that supported it (Firefox) removed it years ago.
bottom was adding the table width to its offset instead of the height,
that is now fixed.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is an ancient bug, but it got much easier to trigger with mouse
scrolling support so it's time to fix it.
(The bug itself was that since both the client and buffer ends of the
controlling stream are blocking, they could get stuck when both were
trying to send() data to the other end but the buffer was full. So now
we set the client end to non-blocking.)
|
|
|
|
| |
background & list-style did not override unspecified values
|
| |
|
|
|
|
|
| |
should finally convert the code to strictDefs, implicit result is a
horrible footgun
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we are going to round things in layout, let's do it properly. Adding
fake height has negative utility (things get more annoying to read),
so now we don't.
TODO: finding the correct positioning of the baseline after adding
padding is an open question. Probably have to revise the algorithm
somewhat to get it right.
(This should also fix the bug where error correction would make inline
box backgrounds shift into unrelated text, causing much confusion for
the reader.)
|
|
|
|
|
|
|
| |
Split up load into loadSubmit, gotoURL: loadSubmit is a replacement for
load(s + '\n'), and gotoURL is a load that does no URL expansion.
Also, fix a bug where load("\n") would crash the browser.
|
|
|
|
|
| |
it is useful to round them so that they don't get positioned somewhere
in the middle of a line (which is rounded to the same precision as well)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous retrofitting of the old renderdocument error correction
usually worked, but it still had a horrible flaw in that it assumed that
all line boxes are of equal height. So if error was lower for some line
than another, it would move *all* lines by a somewhat lower error, and
that resulted in overlapping lines.
Now we do something much simpler: in flushLine, round each line's height
downwards before moving on to the next line. This gets rid of any blanks
inbetween lines, and also works much better with cleared floats.
|
|
|
|
|
|
|
|
|
| |
* fix cursor jumping back to the start of the line (instead of the end
of the line) when it is outside the viewport and a leftwards update is
requested
* save setxsave too when line is not loaded yet
* always set needslines in onMatch when hlon (this was causing a blank
screen when incremental search was jumping around in large documents)
|
|
|
|
|
|
|
|
|
|
| |
It is in fact quite simple to calculate: charwidth is the width
of printing characters until now, and whitespacenum the number of
(non-flushed) spaces. So we just have to subtract this from the target
width to get the number of spaces missing from the next tab stop.
(Of course, it gets much harder to understand when the whole thing is
formatted as a convoluted multi-line equation...)
|