Repository navigation
refactor(errors): move ErrorInstance implementation to a private class - #91
Merged
Merged
Conversation
Applied as a single consolidated commit on top of staging (post-#84). Original PR #89 was a 6-commit stack; this collapses to the final state so the structural rewrite (class internals) lands cleanly without incremental rebase conflicts. - New private class ErrorInstanceImpl in internal/error-instance-impl.ts - New private class ErrorFactoryImpl in internal/error-factory-impl.ts - error() now returns a callable bound to an ErrorFactoryImpl - ErrorInstance extends Error at runtime; instance instanceof Error is true - Brand marker (ErrorInstanceBrand) set as readonly class property - FACTORY_SYMBOL consolidated in types.ts (single source of truth) - ErrorConfig renamed to ErrorFactoryConfig and now exported - Tests cover instance class, brand marker, and Error prototype Closes #88.
This was referenced Oct 7, 2026
codewizdave
pushed a commit
that referenced
this pull request
Oct 7, 2026
Resync after #91 was merged to staging but main had moved to 1.4.0 with RFC 0001 already published. Staging is now rebased on main; this merge publishes the 4 pending changesets as version 1.5.0. Changesets in this release: - fix-71: FACTORY_SYMBOL as a typed property - fix-74: structural guard in causes() - feat-83: Standard Schema inference (subsumed by RFC 0001 in 1.4.0) - feat-88: class-based internals (replaced by 1.4.0's function-based impl)
codewizdave
pushed a commit
that referenced
this pull request
Oct 7, 2026
Resync after #91 was merged to staging but main had moved to 1.4.0 with RFC 0001 already published. Staging is now rebased on main; this merge publishes the 4 pending changesets as version 1.5.0. Changesets in this release: - fix-71: FACTORY_SYMBOL as a typed property - fix-74: structural guard in causes() - feat-83: Standard Schema inference (subsumed by RFC 0001 in 1.4.0) - feat-88: class-based internals (replaced by 1.4.0's function-based impl)
codewizdave
pushed a commit
that referenced
this pull request
Oct 7, 2026
Resync after #91 was merged to staging but main had moved to 1.4.0 with RFC 0001 already published. Staging is now rebased on main; this merge publishes the 4 pending changesets as version 1.5.0. Changesets in this release: - fix-71: FACTORY_SYMBOL as a typed property - fix-74: structural guard in causes() - feat-83: Standard Schema inference (subsumed by RFC 0001 in 1.4.0) - feat-88: class-based internals (replaced by 1.4.0's function-based impl)
codewizdave
pushed a commit
that referenced
this pull request
Oct 7, 2026
Resync after #91 was merged to staging but main had moved to 1.4.0 with RFC 0001 already published. Staging is now rebased on main; this merge publishes the 4 pending changesets as version 1.5.0. Changesets in this release: - fix-71: FACTORY_SYMBOL as a typed property - fix-74: structural guard in causes() - feat-83: Standard Schema inference (subsumed by RFC 0001 in 1.4.0) - feat-88: class-based internals (replaced by 1.4.0's function-based impl) Also applies prettier --write across the repo to clear the accumulated format drift that was failing the Lint CI on every push. Pure formatting changes; no functional impact. All 167 tests still pass.
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.
Closes #88. Consolidated version of the original spike/88-class-internals PR #89, squashed into one commit and rebased on staging (post-#82, #85, #84).
What
Moves the ErrorInstance implementation to a private class (ErrorInstanceImpl) while keeping the function-based public API. The class extends Error so instance instanceof Error is true. The brand marker is a readonly class property.
Why one commit
PR #89 was a 6-commit stack (class intro → drop casts → split into internal/ → extract config type → final polish → style). Rebasing the full stack on top of #82, #85, and #84 produced cascading conflicts on every commit. Consolidating to the final state of the diff sidesteps the conflicts and lands the same end result.
Verification