-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(filterFilter): fix matching against null
/undefined
#11445
fix(filterFilter): fix matching against null
/undefined
#11445
Conversation
@gkalpak it looks good to me after taking a quick look, but one of the commits upsets TravisCI (jsce). Could you please have a look? |
ed3b3f1
to
ffd0643
Compare
Included fixes: * Do not convert `null`/`undefined` to strings for substring matching in non-strict comparison mode. Prevents `null`/`undefined` from being matched against e.g. 'u'. * Let `null` (as a top-level filter expression) match "deeply" (as do booleans, numbers and strings). E.g. let `filterFilter(arr, null)` match an item like `{someProp: null}`. Closes angular#11432
ffd0643
to
a543eda
Compare
@pkozlowski-opensource: I fixed the error and tests are green now. |
@gkalpak yeh, LGTM |
One question, are these regression fixes or is this something that never worked correctly before? |
@Narretz, they are regression fixes:
Broken since v1.3.6 / v1.4.0-beta.1.
Broken since v1.3.15 / v1.4.0-beta.6. |
@pkozlowski-opensource / @petebacondarwin, can you please take a look to make sure I got this right this time 😄 |
@gkalpak commits look fine and TravisCI is green so things look in order :-) |
Included fixes: * Do not convert `null`/`undefined` to strings for substring matching in non-strict comparison mode. Prevents `null`/`undefined` from being matched against e.g. 'u'. * Let `null` (as a top-level filter expression) match "deeply" (as do booleans, numbers and strings). E.g. let `filterFilter(arr, null)` match an item like `{someProp: null}`. Closes angular#11432 Closes angular#11445
Included fixes:
null
/undefined
to strings for substring matching innon-strict comparison mode. Prevents
null
/undefined
from beingmatched against e.g. 'u'.
null
(as a top-level filter expression) match "deeply" (as dobooleans, numbers and strings).
E.g. let
filterFilter(arr, null)
match an item like{someProp: null}
.Closes #11432
1st and 3rd commits are refactorings (not important for the fix).
The 2nd commit contains the actual fix(es).
I kept them separate, for easier reviewing or eclectic merging.I can squash them if you think it is better.