Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ay.prototype PropDesc and [[DefineOwnProperty]] (OrdinaryDefineOwnProperty and the Array exotic object's, ArraySetLength), ArrayCreate, [[Delete]], NewArray and DeleteProp handlers, array literals with trailing elisions, a bound on nested natives, and the Array constructor with the core of Array.prototype. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviver (InternalizeJSONProperty), replacer function and array, space and gap, toJSON, wrapper objects, the cycle TypeError, and the nesting bound (a SyntaxError for parse, a RangeError past 128 levels for stringify). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Included in #286, which verifies all open phase 7 pull requests together; this merges with it. |
atiernan
added a commit
that referenced
this pull request
Nov 22, 2026
Array literals now run (#290), so language/comments/S7.4_A5.js reaches eval, which is not there yet; the test catches the ReferenceError and throws a bare Test262Error, so the runners cannot class it by name. It is listed in both runners' KNOWN_GAPS with that reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
What this is
The second built-ins slice of phase 7 item 7.9: arrays and
JSON. Stacked on #269 (claude/js-builtins, itself on #265), so the base isclaude/js-builtins.tier = 0unchanged forclazel-js-vmandclazel-js-builtins; no change tospec.rs,ops.rs,lemmas.rs,mutations.json, andclazel-jsonis used as is (not edited).Continues the stopped previous agent's WIP commit (
heap.rsarray cell,Intrinsic::ArrayPrototype); kept what was sound, added the missingprops.rsit declared, and did not squash.In
clazel-js-vmprops.rs:PropDesc;Vm::define_own_property(OrdinaryDefineOwnProperty / ValidateAndApplyPropertyDescriptor for data properties, and the Array exotic object's[[DefineOwnProperty]], §10.4.2.1); ArraySetLength (§10.4.2.4, incl. the non-configurable-element stop and the deferredwritable: false); ArrayCreate (§10.4.2.2); CreateArrayFromList; CreateDataProperty(OrThrow); DefinePropertyOrThrow;[[Delete]]/ DeletePropertyOrThrow;SameValue;IsArray.lengthin slot 0 (the heap's elements are Phase 7.5: clazel-js-heap elements and symbols (second slice) #211, not on this base), so a huge sparse index or a longshiftis slow, not wrong.[[Set]]goes through[[DefineOwnProperty]]forlengthand indices; inline-cache stores never hit an array.NewArray,DeleteProp, andDefineProp/DefineElemon arrays. The compiler now setslengthfor trailing elisions of a literal ([1,,]had length 2).joinis aRangeError, not a host stack overflow).Intrinsic::ArrayConstructor;Vm::strict_equalsis public.In
clazel-js-builtinsarray.rs:Array(§23.1.1.1),Array.isArray,Array.of;Array.prototype(itself an array):push pop shift unshift slice splice concat join toString indexOf lastIndexOf includes reverse fill forEach map filter some every reduce reduceRight find findIndex sort(stable merge sort, SortCompare §23.1.3.30.2), each citing its algorithm and steps. The methods are generic over array-likes, as the standard writes them.json.rs:JSON.parseoverclazel-json's parser (reviver = InternalizeJSONProperty, §25.5.1.1) andJSON.stringify(§25.5.2: replacer function and array,space/gap with wrappers,toJSON, wrapper unwrapping, the cycleTypeError, QuoteJSONString fromclazel-json).Object.definePropertynow uses the VM's[[DefineOwnProperty]];Object.keysreturns a real array;Object.prototype.toStringtags arrays.Left for later (listed)
Array.from,entries,keys,values,@@iterator,@@species,@@isConcatSpreadable,@@unscopables.ArraySpeciesCreateuses the receiver'sconstructoritself where the standard reads@@species.GetIterator/IterNext, stillNotYet. Array literals (with elisions) work.CreateRestArrayisNotYet.at,copyWithin,flat,flatMap,findLast,findLastIndex,toLocaleString, change-by-copy methods.JSON.stringifystops at 128 nesting levels with aRangeError(host stack; unoptimised frames are several KB, tests run on 2 MB);JSON.parsekeepsclazel-json's 512-level bound (aSyntaxError). NoBigInt/Symbol steps; the reviver's source-text context argument is not passed.Evidence
built-ins/Arrayandbuilt-ins/JSONare not vendored (SOURCE.md: onlylanguage/andharness/; thebuilt-insdirectories join "with the items that record their results"), and I could not download them. So there are no per-directory counts to record. The Phase 7.9: the first built-ins (Object, Function, Error, Math, Number, String, Boolean) #269 runner over the vendored subset: pass 508 -> 542, xfail 4704 -> 4670, fail 0 (total 5212); the categories "global X is missing" went 10 -> 7 and the Array tests that were blocked onArraynow run. Per directory: 0 tests ofbuilt-ins/Arrayand 0 ofbuilt-ins/JSONexist in the table.tests/array.rs(7 tests, about 115 script cases: exotic object semantics, ArraySetLength, constructor, every method, generic array-likes, sort stability, bounds) andtests/json.rs(2 tests, about 65 cases: grammar, reviver order, replacer, gap, cycles, depth, round trip).Commands
cargo fmt: clean.cargo clippy -p clazel-js-vm -p clazel-js-builtins -p clazel-json --all-targets -- -D warnings: clean.cargo xtask check: STATIC CHECKS PASSED.cargo test -p clazel-js-vm -p clazel-js-builtins -p clazel-json: all pass.cargo +nightly-2026-08-21 miri test -p clazel-js-builtins: all pass (theMath.powexact-value test is stillignored under Miri). Under Miri the new tests run every eighth case; a rerun ofarray+jsonalone took 244 s and 172 s for the whole file (tests in parallel), the pre-existingbuiltinsfile 1030 s for its 12 tests in parallel. Miri does not print per-test times, so the slowest single test is not measured (run with every fourth case, the array file took 487 s as a whole before I lowered it).cargo xtask verify(full or--changed), Kani, Verus, mutations. CI's full verification has not run on this PR; the proof jobs need a reviewer's approval of thefull-verificationenvironment. Not touched:docs/STATUS.md,SPEC-REVIEWS.md,SYS-AUDITS.md. Nounsafe, no lint overrides.🤖 Generated with Claude Code