Skip to content

Commit

Permalink
Allow needle argument to 'in' expression to be false (mapbox#9295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Hamley authored and mike-unearth committed Mar 18, 2020
1 parent 348b948 commit 2e5a895
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/style-spec/expression/definitions/in.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class In implements Expression {
const needle = (this.needle.evaluate(ctx): any);
const haystack = (this.haystack.evaluate(ctx): any);

if (!needle || !haystack) return false;
if (needle == null || !haystack) return false;

if (!isComparableRuntimeValue(needle)) {
throw new RuntimeError(`Expected first argument to be of type boolean, string or number, but found ${toString(typeOf(needle))} instead.`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
false,
true,
true,
false,
true,
true,
false
],
Expand Down

0 comments on commit 2e5a895

Please sign in to comment.