test(ses): Verify namespace mutation parity with Node.js#3231
Open
kriskowal wants to merge 1 commit into
Open
Conversation
|
2848fad to
bace5d8
Compare
bace5d8 to
c6a779d
Compare
2 tasks
kriscendobot
pushed a commit
to endojs/endo-but-for-bots
that referenced
this pull request
May 21, 2026
Upstream endo's `yarn build:types:check` and typedoc-driven pass run TS with `useUnknownInCatchVariables: true`, which types the `catch (e)` binding as `unknown` and rejects bare `e.name`. The mirror's CI passes because its `lint:types` runs `tsc` against the package tsconfig only, which inherits a looser baseline; the upstream lint job (per endojs/endo#3231) flagged b.js:23:28 with TS18046. Apply the project's documented convention from CLAUDE.md (Cast catch error variables: /** @type {Error} */ (e).name) so the fixture compiles under both the mirror's relaxed tsconfig and upstream's stricter pipeline. Reproduced locally by extending packages/ses/tsconfig.json with `useUnknownInCatchVariables: true` and running `tsc`: before the cast the only namespace-mutation error is the exact upstream report (b.js(23,28) TS18046); after the cast the error is gone and `yarn lint` and the `namespace-mutation` test both pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Mirror of endojs/endo-but-for-bots#79 (head c6a779d). |
kriskowal
pushed a commit
to kriskowal/garden
that referenced
this pull request
Jun 7, 2026
…(1-line typecheck fix + base freshen)
c6a779d to
d704b3c
Compare
kriskowal
pushed a commit
to kriskowal/garden
that referenced
this pull request
Jun 7, 2026
…ypecheck fix; behind 77->0)
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.
Add a test that compares Node.js native ESM and a SES Compartment when one module does
import * as foo from './a'; foo.x = 'bar'and another module later importsxfrom the same module.Both runtimes prevent the override (assignment throws TypeError, later imports see the original value), but the protection mechanism differs in observable ways: Node.js exposes data descriptors with writable: true on a non-frozen, non-extensible namespace, while SES exposes accessor descriptors on a frozen target. The test pins down both the parity behaviors and the structural differences.
These differences are known discrepancies the authors have found no way to emulate faithfully.
The fixture is loaded once from disk and fed to both runtimes (Node.js via subprocess, the Compartment via @endo/module-source) so the two sides cannot drift.