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 for out-of-range time value #4615

Merged
merged 1 commit into from
Mar 16, 2018
Merged

Date.UTC should return NaN for out-of-range time value #4615

merged 1 commit into from
Mar 16, 2018

Conversation

xiaoyinl
Copy link
Contributor

@xiaoyinl xiaoyinl commented Jan 30, 2018

According to spec Section 20.3.3.4, if the time value is larger than ktvMax or smaller than ktvMin, then Date.UTC should return NaN rather than return the actual value.

Also updated the link at L1645 to #1665: "Date.UTC(x) [single-argument case] semantics update".

Test case:
Date.UTC(2001, 1, 5e+9)
ChakraCore: 432000980899200000
SpiderMonkey and v8: NaN

According to spec Section 20.3.3.4, if the time value is larger than ktvMax or smaller than
ktvMin, then Date.UTC should return NaN rather than return the actual value.

Also updated the link at L1645 to #1665: "Date.UTC(x) [single-argument
case] semantics update".
@xiaoyinl
Copy link
Contributor Author

xiaoyinl commented Jan 30, 2018

/cc @dilijev @bterlson @obastemur Please review. Also should I target this to master, release/1.8 or release/1.9?

@xiaoyinl xiaoyinl changed the title Date.UTC should return NaN if out-of-range Date.UTC should return NaN for out-of-range time value Jan 30, 2018
@dilijev
Copy link
Contributor

dilijev commented Jan 30, 2018

@xiaoyinl master is good.

Copy link
Contributor

@dilijev dilijev left a comment

Choose a reason for hiding this comment

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

LGTM

@dilijev dilijev requested a review from bterlson March 1, 2018 02:01
@dilijev
Copy link
Contributor

dilijev commented Mar 1, 2018

We're having issues with the commit signing service at the moment. When that is resolved I'll merge this.

@xiaoyinl
Copy link
Contributor Author

xiaoyinl commented Mar 1, 2018

I see. Thanks for the review!

@dilijev dilijev self-assigned this Mar 15, 2018
@dilijev
Copy link
Contributor

dilijev commented Mar 16, 2018

@dotnet-bot test this please

@chakrabot chakrabot merged commit 5173d5f into chakra-core:master Mar 16, 2018
chakrabot pushed a commit that referenced this pull request Mar 16, 2018
…ime value

Merge pull request #4615 from xiaoyinl:dateUTCoverflow

According to spec [Section 20.3.3.4](https://tc39.github.io/ecma262/#sec-date.utc), if the time value is larger than `ktvMax` or smaller than `ktvMin`, then `Date.UTC` should return `NaN` rather than return the actual value.

Also updated the link at L1645 to #1665: "Date.UTC(x) [single-argument case] semantics update".

Test case:
`Date.UTC(2001, 1, 5e+9)`
ChakraCore: 432000980899200000
SpiderMonkey and v8: NaN
@xiaoyinl xiaoyinl deleted the dateUTCoverflow branch March 16, 2018 01:34
@dilijev
Copy link
Contributor

dilijev commented Mar 17, 2018

@xiaoyinl apologies for the delay in landing this. Thanks for your contribution!

@xiaoyinl
Copy link
Contributor Author

@dilijev No problem! Thanks for landing it.

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

Successfully merging this pull request may close these issues.

3 participants