Skip to content

fix: use own-property resource lookups - #362

Open
han4wluc wants to merge 1 commit into
mainfrom
fix/prototype-lookups
Open

han4wluc wants to merge 1 commit into
mainfrom
fix/prototype-lookups

Conversation

@han4wluc

Copy link
Copy Markdown
Contributor

Resource registries and section maps are read with plain property access, so an ID equal to an Object.prototype member resolves to the inherited value: a missing section toString returns a function, and a missing colour constructor produces a misleading hex-colour error.

Reproduce: look up a section or resource whose ID is toString or constructor when no such entry exists (regression tests).

Fix: registries and section maps are read with own-property lookups; valid own keys with those names still work.

Tests: the new regressions; the full suite (2,166 tests) and lint pass.

This branch has not been deployed

No deployments
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.

1 participant