-
-
Notifications
You must be signed in to change notification settings - Fork 93
Fix prototype keys causing crash in color parsing and invalid colors in color coercion expressions #1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
HarelM
merged 5 commits into
maplibre:main
from
cxcorp:fix-color-validation-prototype-issues
Mar 8, 2025
Merged
Fix prototype keys causing crash in color parsing and invalid colors in color coercion expressions #1036
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fa719fe
Fix error thrown when validating certain color strings
cxcorp e212106
Fix color coercion expressions returning array of nulls
cxcorp 5a8ca93
Update CHANGELOG.md
cxcorp 2e69da8
Group prototype key related fixes in CHANGELOG.md
cxcorp 89d3c87
Use Map instead of an object in EvaluationContext's cache
cxcorp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/integration/style-spec/tests/light-malformed-color.input.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "version": 8, | ||
| "sources": { | ||
| "vector": { | ||
| "type": "vector", | ||
| "url": "https://demotiles.maplibre.org/tiles/tiles.json" | ||
| } | ||
| }, | ||
| "light": { | ||
| "anchor": "map", | ||
| "position": [1, 90, 90], | ||
| "color": "__proto__", | ||
| "intensity": 0.75 | ||
| }, | ||
| "layers": [] | ||
| } |
6 changes: 6 additions & 0 deletions
6
test/integration/style-spec/tests/light-malformed-color.output.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| [ | ||
| { | ||
| "message": "color: color expected, \"__proto__\" found", | ||
| "line": 12 | ||
| } | ||
| ] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that there were both
*.output-api-supported.jsonand*.output.jsonfiles in the tests, but was unable to find references tooutput-api-supportedorapi-supportedin the codebase, other than a changelog entry saying--mapbox-api-supportedhad been removed fromgl-style-validationin 14.0.0. Are the.output-api-supported.jsonfiles still used, or subject for removal in a later PR?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find anything related to this in the history of the repo, I'm not sure they were ever used, and also from a very shallow test I made these looks duplicates of the output files, so I would recommend removing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. Remove in this PR or shall I make a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A separate PR seems like the right approach.