Skip to content

fix: return false for absent selector nodes in type guards - #377

Open
Aschenbath wants to merge 1 commit into
postcss:mainfrom
Aschenbath:fix/oss-20-round4-20261125-77d1-selector-null-guards
Open

Aschenbath wants to merge 1 commit into
postcss:mainfrom
Aschenbath:fix/oss-20-round4-20261125-77d1-selector-null-guards

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Public node guards currently throw for null, and isNode({}) returns undefined. Make the shared guard return a boolean for absent values and unrelated objects, including objects whose type names an inherited Object member.

Added regressions for all 17 public guards and the inherited-name cases. All 18 new tests fail against unchanged main; npm test passes with the fix (1,094 tests, including the repository's lint, declaration, build, and coverage checks). Changed-file formatting and git diff --check pass. The full formatting check reports existing issues in unchanged exceptions.mjs and pseudos.mjs, reproduced on the original base.

Developed with OpenAI Codex assistance and independently reviewed against the tested file hashes.

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