NJS test262 runner - #1125
Open
xeioex wants to merge 8 commits into
Open
Conversation
The lambda structure is allocated at the end of module compilation, and if the allocation fails, lambda is NULL. Since nothing fails after a successful allocation, lambda is always NULL on the failed path. Found by Coverity (CID 1701143).
Previously, a double was converted to uint32_t before its range was tested, so a property key that is NaN, negative or larger than 2^31 made the conversion undefined. UndefinedBehaviorSanitizer reported it for every VM creation, where an environment variable name is atomized. The fix is to test the range first and to share one njs_number_is_atom_index() helper between the four places that repeated the pattern.
xeioex
force-pushed
the
njs-test262-runner
branch
2 times, most recently
from
September 12, 2026 02:24
465fa5c to
7de1e26
Compare
The Date setters always converted their result as local time. Use the setter's UTC flag instead. Remove the intermediate range check in njs_make_date(). TimeClip already checks the result after local-to-UTC conversion, which can move a value across the valid time range boundary.
xeioex
force-pushed
the
njs-test262-runner
branch
2 times, most recently
from
September 12, 2026 03:43
352d4f1 to
48daaeb
Compare
xeioex
marked this pull request as ready for review
September 12, 2026 03:44
xeioex
force-pushed
the
njs-test262-runner
branch
from
September 12, 2026 05:03
48daaeb to
dd0ebaf
Compare
The timezone offset helper converted a double to int64_t before checking whether it was representable. Check the range first. UndefinedBehaviorSanitizer reports the out-of-range conversion.
Use adapters for memory pool allocators instead of casting their function pointers to the generic chain buffer callback types. Casting does not make an indirect call through an incompatible function pointer type valid. UndefinedBehaviorSanitizer reports these calls.
xeioex
force-pushed
the
njs-test262-runner
branch
3 times, most recently
from
September 12, 2026 05:47
6aed19c to
6a705dd
Compare
Opaque values are cast to njs_value_t pointers by the public API. Match njs_value_t alignment while retaining the four uint32_t filler fields. UndefinedBehaviorSanitizer reports unaligned njs_value_t accesses.
Build and run the base njs test suite with UndefinedBehaviorSanitizer.
xeioex
force-pushed
the
njs-test262-runner
branch
from
September 13, 2026 19:54
6a705dd to
3df8a56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
build/njs_test262, a native runner for the official TC39 test262 suite. Unlike the existingmake test262shell harness, it embeds njs directly and executes the upstream suite without spawning one CLI process per test.The runner:
The official suite is pinned in
test/njs_test262.version; the configured profile and expected failures are stored intest/njs_test262.confandtest/njs_test262.failures.A dedicated
test262GitHub Actions workflow runs the full profile in normal, ASan, and UBSan builds.