Skip to content

fix: objectRemoveKey exclusions leaking across + inheritance boundaries#659

Merged
stephenamar-db merged 1 commit intomasterfrom
fix/objectRemoveKey-inheritance
Mar 23, 2026
Merged

fix: objectRemoveKey exclusions leaking across + inheritance boundaries#659
stephenamar-db merged 1 commit intomasterfrom
fix/objectRemoveKey-inheritance

Conversation

@stephenamar-db
Copy link
Collaborator

objectRemoveKey's excludedKeys mechanism suppressed re-added keys in both directions of object inheritance via +.

Two fixes in Val.Obj:

  1. gatherKeys: replaced global exclusion set with incremental processing during root-first iteration. Each object's excludedKeys removes keys from lower levels, but higher-level objects can re-introduce them. Fixes: removeKey(obj, k) + {k: v}

  2. addSuper: when the RHS has excludedKeys and the LHS provides those keys as visible, inject synthetic members that delegate to the LHS and clear the exclusion. Fixes: {k: v} + removeKey(obj, k)

objectRemoveKey's excludedKeys mechanism suppressed re-added keys in
both directions of object inheritance via +.

Two fixes in Val.Obj:

1. gatherKeys: replaced global exclusion set with incremental processing
   during root-first iteration. Each object's excludedKeys removes keys
   from lower levels, but higher-level objects can re-introduce them.
   Fixes: removeKey(obj, k) + {k: v}

2. addSuper: when the RHS has excludedKeys and the LHS provides those
   keys as visible, inject synthetic members that delegate to the LHS
   and clear the exclusion. Fixes: {k: v} + removeKey(obj, k)
@stephenamar-db stephenamar-db linked an issue Mar 23, 2026 that may be closed by this pull request
@stephenamar-db stephenamar-db merged commit d847581 into master Mar 23, 2026
5 checks passed
@stephenamar-db stephenamar-db deleted the fix/objectRemoveKey-inheritance branch March 23, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

std.objectRemoveKey prevents keys from being re-added

1 participant