Commit ba12dbe
fix(sheaves): use Object.hasOwn in decomposeMetadata to avoid prototype chain
Replace `key in obj` with `Object.hasOwn(obj, key)` in two places inside
decomposeMetadata:
- Sharing check (line 127): `key in meta` would pass for prototype-inherited
names (e.g. 'constructor'), causing a key to be treated as present in a
candidate that does not own it. If the inherited value also happens to match
via Object.is, the key is wrongly promoted to a shared constraint.
- Stripping step (line 137): `key in constraints` is true for prototype
property names on an empty {} object, so any metadata key that shadows a
prototype name gets silently dropped from stripped candidates even when it
was never added to constraints.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 98d4c58 commit ba12dbe
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
0 commit comments