Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Align match behavior with case/== #11935

Merged
merged 1 commit into from
May 18, 2018
Merged

[core] Align match behavior with case/== #11935

merged 1 commit into from
May 18, 2018

Conversation

jfirebaugh
Copy link
Contributor

Makes ["match", ["get", k], label, match, otherwise] equivalent to ["case", ["==", ["get", k], label], match, otherwise]. This changes the behavior of match expressions where the runtime type of the input does not match the type of the labels: previously such expressions produced a runtime type error and then fell back to the property default value; now they produce the fallback value from the match expression.

Ports mapbox/mapbox-gl-js#6684.

@jfirebaugh jfirebaugh force-pushed the fix-6680 branch 3 times, most recently from aa6f337 to 2373eaf Compare May 18, 2018 00:08
Makes `["match", ["get", k], label, match, otherwise]` equivalent to `["case", ["==", ["get", k], label], match, otherwise]`. This changes the behavior of match expressions where the runtime type of the input does not match the type of the labels: previously such expressions produced a runtime type error and then fell back to the property default value; now they produce the fallback value from the match expression.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants