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
since 1970
When querying since 1970, it will be parsed into the UNIX timestamp 0. On the other hand, in caniuse-lite data, release date of unreleased versions are null.
0
caniuse-lite
null
Now, when processing since query, there is a comparison logic:
since
browserslist/index.js
Line 212 in 29cecf9
In JavaScript, null >= 0 will be evaluated to true, which causes unreleased versions will be included in the result when querying since 1970.
null >= 0
true
I'm not sure whether it's a bug or not. I found this problem when I was implementing since query in browserslist-rs, and currently I implemented this feature/bug as-is: https://github.com/g-plane/browserslist-rs/blob/35ed72f516ab1230d0c102169a9bbe25f493fedb/src/queries/since.rs#L53-L62 .
The text was updated successfully, but these errors were encountered:
Wow, crazy bug. Thanks.
I will add special logic for null. We should not use data.releaseDate[v] === null in any since X query.
data.releaseDate[v] === null
since X
Sorry, something went wrong.
browserslist/browserslist@b75cc16
No branches or pull requests
When querying
since 1970
, it will be parsed into the UNIX timestamp0
. On the other hand, incaniuse-lite
data, release date of unreleased versions arenull
.Now, when processing
since
query, there is a comparison logic:browserslist/index.js
Line 212 in 29cecf9
In JavaScript,
null >= 0
will be evaluated totrue
, which causes unreleased versions will be included in the result when queryingsince 1970
.I'm not sure whether it's a bug or not. I found this problem when I was implementing
since
query in browserslist-rs, and currently I implemented this feature/bug as-is: https://github.com/g-plane/browserslist-rs/blob/35ed72f516ab1230d0c102169a9bbe25f493fedb/src/queries/since.rs#L53-L62 .The text was updated successfully, but these errors were encountered: