Skip to content
New issue

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

mktime/0: remove unnecessary length>=6 input requirement #3162

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

emanuele6
Copy link
Member

@emanuele6 emanuele6 commented Aug 20, 2024

This check was redundant and useless since jv2tm() used to require 8 elements, and errored anyway if not enough elements were provided.
After commit bc96146, this check also prevents mktime/0 from accepting now supported inputs with less than 8 elements.

Ref: #3070 (comment)

Reported-by: itchyny itchyny@cybozu.co.jp

This check was redundant and useless since jv2tm() used to require 8
elements, and errored anyway if not enough elements were provided.
After commit bc96146, this check also prevents mktime/0 from accepting
now supported inputs with less than 8 elements.

Ref: jqlang#3070 (comment)

Reported-by: itchyny <itchyny@cybozu.co.jp>
@itchyny
Copy link
Contributor

itchyny commented Aug 21, 2024

Is it intended behavior that [] | todate is also accepted?

@emanuele6
Copy link
Member Author

emanuele6 commented Aug 21, 2024

@itchyny Yes. I made it so, if a value is missing, 0 is assumed; that is the same as [0,0,0,0,0,0,0,0]

Copy link
Contributor

@itchyny itchyny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@itchyny itchyny merged commit da2a0b9 into jqlang:master Aug 21, 2024
28 checks passed
@emanuele6 emanuele6 deleted the mktimeopt branch August 21, 2024 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants