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

Date.UTC should return NaN with < 2 arguments #1318

Closed
bterlson opened this issue Jul 22, 2016 · 7 comments
Closed

Date.UTC should return NaN with < 2 arguments #1318

bterlson opened this issue Jul 22, 2016 · 7 comments

Comments

@bterlson
Copy link
Contributor

Currently, the spec says this behavior is implementation defined. We have decided that means to default these parameters to zero. All other implementations simply return NaN. I think we should align if possible and update the spec to mandate this behavior. Are there compelling reasons to keep our current behavior? It'd be a compat break for UWP/etc. but this behavior doesn't seem particularly useful so hopefully it's not used...

See also whatwg/javascript#31

@dilijev
Copy link
Contributor

dilijev commented Jul 22, 2016

I'll take a crack at this. :)

dilijev added a commit to dilijev/ChakraCore that referenced this issue Jul 26, 2016
@claudepache
Copy link

Date.UTC should return NaN with <= 2 arguments (?)

... with < 2 arguments (??)

@bterlson
Copy link
Contributor Author

Uhh yeah, title is wrong (and so is PR). @claudepache you rock.

@dilijev dilijev changed the title Date.UTC should return NaN with <= 2 arguments (?) Date.UTC should return NaN with < 2 arguments (?) Jul 26, 2016
@dilijev
Copy link
Contributor

dilijev commented Jul 26, 2016

@bterlson Yes, I was wondering about this aspect when I compared behavior with Chrome. The PR is easy to fix. I'll await concensus before making fixes.

@dilijev
Copy link
Contributor

dilijev commented Aug 1, 2016

Note: TC39 did not reach a consensus on this and may not have a further decision for a while (see whatwg/javascript#31). Still it seems worth changing to the implementation currently provided by the other browsers (return NaN for 0 or 1 argument).

@ianwjhalliday
Copy link
Collaborator

Agreed

@bterlson
Copy link
Contributor Author

bterlson commented Aug 1, 2016

Agreed.

@dilijev dilijev changed the title Date.UTC should return NaN with < 2 arguments (?) Date.UTC should return NaN with < 2 arguments Aug 17, 2016
dilijev added a commit to dilijev/ChakraCore that referenced this issue Aug 17, 2016
dilijev added a commit to dilijev/ChakraCore that referenced this issue Aug 17, 2016
chakrabot pushed a commit that referenced this issue Aug 17, 2016
… arguments.

Merge pull request #1333 from dilijev:dateutc

Fixes #1318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants