Skip to content

[parse] Reject unexpected punctuation in color function arguments - #767

Open
ScribleSean wants to merge 1 commit into
color-js:mainfrom
ScribleSean:fix/reject-unparsed-color-separators
Open

ScribleSean wants to merge 1 commit into
color-js:mainfrom
ScribleSean:fix/reject-unparsed-color-separators

Conversation

@ScribleSean

Copy link
Copy Markdown

Fixes #614.

color(--lchuv 86.8% 42.9)230) currently parses successfully because argument extraction silently discards unmatched punctuation. Reject the function when unmatched content contains anything other than commas or whitespace.

Adds 19 invalid-input regressions and four valid-input controls, including alpha, scientific notation, none, and calc(NaN). Also removes an extra closing parenthesis in an existing gamut test's expected value, exposed by the stricter parser. This change is limited to unconsumed punctuation; it does not attempt full CSS grammar validation.

Validation on base 19eb89f8995d2139436b6d38c7042944bb23a718:

  • All 19 new rejection cases fail before the source fix and pass afterward.
  • Full suite: 817 passed, 72 existing skipped, zero failures.
  • Full build, changed-file ESLint, parser/test formatting and diff whitespace checks pass. The gamut file retains an unrelated pre-existing formatting warning.

Prepared with OpenAI Codex assistance using GPT-6 Astra (gpt-6-astra), medium reasoning. I review all contributions before submission and remain responsible for the code and this message. The commit includes Codex co-author attribution.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@netlify

netlify Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for colorjs ready!

Name Link
🔨 Latest commit 6dda8b7
🔍 Latest deploy log https://app.netlify.com/projects/colorjs/deploys/6aa59e6b21c37e0008fb9431
😎 Deploy Preview https://deploy-preview-767--colorjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

new Color() accepts serialized coordinates with right paren as separator

1 participant