Skip to content

Unreleased versions will be included when querying since 1970 #646

@g-plane

Description

@g-plane

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.

Now, when processing since query, there is a comparison logic:

return data.releaseDate[v] >= since
.

In JavaScript, null >= 0 will be evaluated to true, which causes unreleased versions will be included in the result when querying since 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 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions