refactor: PR-44 audit follow-up — shared applyPhaseGuarded, select throw routing, doc consistency - #45
Merged
Conversation
…row routing, doc consistency Post-merge cleanup on top of spec 039 (PR #44): - Extract the `$$phase`-guarded `$apply`/`$evalAsync` dispatch into a single shared `src/compiler/apply-phase-guarded.ts` helper. The spec-026 event directives, forms `applyDuringEvent` (input-types), `form` submit, and `select`'s `applyChange` now all route through it with their own cause token instead of duplicating the try/catch. - Fix `select`: `applyChange` previously lacked the try/catch, so a throwing `$parser` during the native change commit escaped the listener without reaching `$exceptionHandler`. It now injects `$exceptionHandler` and routes via `'$compile'`. Adds a regression test in select.test.ts. - De-duplicate `stashController` — remove the local copy in compile.ts and import the shared one from element-slots.ts. - Rename runControllerSeam-widening.test.ts → kebab-case run-controller-seam-widening.test.ts (file-naming convention). - Add inline justifications to the eslint-disable comments in core/utils.ts (isFunction, TypedArray copy cast, dynamic delete). - Doc consistency: update the stale "EXCEPTION_HANDLER_CAUSES stays at 10" comments across compiler/controller/bootstrap error files (the tuple is now 13 after spec 037) and refresh CLAUDE.md + roadmap.md. typecheck + lint clean; 4243 tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mgrdich
force-pushed
the
forms-pr44-audit-followup
branch
from
July 6, 2026 18:08
a59e0e3 to
cfaaf1d
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.
Summary
Post-merge follow-up on top of spec 039 (PR #44). Small, self-contained cleanup — no new features, no behavior change except the one
selectfix noted below.applyPhaseGuardedhelper (src/compiler/apply-phase-guarded.ts) for the$$phase-guarded$apply/$evalAsyncdispatch that four call sites had each duplicated. The spec-026 event directives, formsapplyDuringEvent(input-types.ts), theformsubmit handler, andselect'sapplyChangenow all funnel through it, each passing its own cause token ('eventListener'for events,'$compile'for forms).selectthrow routing —applyChangepreviously had no try/catch, so a throwing$parserduring the nativechangecommit escaped the listener without ever reaching$exceptionHandler. It now injects$exceptionHandlerand routes via'$compile'. Adds a regression test.stashController— drop the local copy incompile.ts, import the shared one fromelement-slots.ts.runControllerSeam-widening.test.ts→run-controller-seam-widening.test.ts(kebab-case file-naming convention).eslint-disablecomments incore/utils.ts.EXCEPTION_HANDLER_CAUSES stays at 10comments (the tuple is 13 since spec 037) across the compiler/controller/bootstrap error files, plus CLAUDE.md and roadmap.md touch-ups.Test plan
pnpm typecheckcleanpnpm lintcleanpnpm test— 4243 passed, 26 skipped$parserduring aselectchange commit reports via$exceptionHandlerinstead of escaping the listener.🤖 Generated with Claude Code