js: Variant, Switch, arrays, closures and references under Node (slice 2 of #63) #684
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Step 3 of epic #63 (JavaScript back end), slice 2 of
docs/design/JAVASCRIPT-BACKEND.mdsection 6: the rest of the language, part 1. Slice 1 (#678, PR #679) is onmain: targetbrowser-js,compiler/src/backend/javascript/,runtime/javascript/{core,int64}.mjs,tools/conformance.sh --js,tests/conformance/js.allowand the CI jobconformance-js.Source
Goal
The emitter handles
Variant,Tag,Switch,FixedArrayandBuffer(typed arrays),ReadandWritethrough allPathSteps,Closurewith the three captures,CallClosure,BoxNew, references andLazy. Compiler only.Acceptance criteria
tests/conformance/js.allowgrows by the existing programs on enums, matching, closures and arrays that now pass under Node (tools/conformance.sh --js, same.expected,.stderr,.exitfiles as the C and VM legs). No program of the allow list is removed.tests/conformancewith its expected files, passing on the C, VM and JavaScript legs.tools/check-commits.shclean;sh tools/gates.sh aand theconformance-jsjob green in forge CI.Seed
Compiler only: no syntax change, no new native, no std name the compiler looks up. One PR; one Conventional Commit per logical change (
feat(js): ...). Do not add a native to the kernel (K-natives are slices 4 and 5). Out of scope: slices 3 to 8, a minifier, source maps,torb testonbrowser-js.Dependencies
#678 (slice 1, landed as PR #679).
Part of #63 (epic; do not close it).
[loop:torbscript] ready: filed just in time from the design record's slice table (row 2) after slice 1 landed.
next: ready
[loop:torbscript] claim implement by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T14:00:00Z
[loop:torbscript] release implement by session:loop-torbscript-20261030: worker ended (gateway restart) after its work was pushed: PR #694 (head
97237e77, three commits, not draft, argus requested, Closes #684). CI pending.next: waiting (CI and Argus review on #694)
std/tensor,Tensor<Scalar>over aBuffer(step 2 of #82) #691[loop:torbscript] claim implementation (CI fix) by session:loop-torbscript-20261030 @anthropic:tkoehn until 2026-10-30T16:24:00Z
PR #694 (head
38b03abf): ci / commit messages fails; gates, tier A/B and the rest still pending.[loop:torbscript] implementation (CI fix, checkpoint):
ci / commit messagesfailed becausestyleis not an allowed commit type; folded the format and budget commits into the test commit (2 commits now, rebased on mainf0d81eb6). Next failure was tier Aformat --checkon tests/conformance/js-variants-arrays.trb (case constructors on an assignment right-hand side are commands:Shape.Circle cell.value,Shape.Rectangle 2, 5); fixed and pushedd515ae9d. JS conformance under Node, playground, tier B and the cross-host C check were green on the previous head. Waiting for CI ond515ae9d.[loop:torbscript] implementation (CI fix): forge CI is green on
d515ae9d(commit messages, tier A, tier B, JS conformance under Node, playground, cross-host C). Cause 1: thestylecommit type is not allowed by tools/check-commits.sh; the format and budget fixups are folded into the test commit, so the PR is now two Conventional Commits (feat(js), test(js)) rebased on main. Cause 2: tier Aformat --checkflagged tests/conformance/js-variants-arrays.trb (case constructors as assignment values are written as commands); fixed with the CI-builttorb format. The earlier playground failure did not recur. Worker usage: roughly 0.2M tokens. next: waiting (Argus review on #694)[loop:torbscript] review: PR #694 merged by the merge gate, landed as
d515ae9don main. Worker usage about 0.2M tokens (estimate).next: waiting (main CI on
d515ae9d, then close)