-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Normative: Require at least four digits in string representations of negative years #1407
Normative: Require at least four digits in string representations of negative years #1407
Conversation
Spec text looks good to me. FWIW, it seems like ChakraCore and SpiderMonkey currently ship these semantics. |
Tests: tc39/test262#2114 |
XS (and only XS) seems to always format negative years with six digits: https://circleci.com/gh/tc39/test262/340?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link#action-107 This is interesting because that behavior is required of I personally foresee more problems than benefits stemming from e.g. "Mon, 01 Jul +065535 10:23:42 GMT", so I'm inclined to keep the tests as they are (requiring the minimum number of digits greater than or equal to 4, with no tainting from ISO 8601 year expansion). |
…ars (#2114) * Add tests for string representations of Date objects with negative years Ref tc39/ecma262#1035 Ref tc39/ecma262#1407
Update: I have introduced a StringPad operation as suggested above by @ljharb, for precisely defining the representation of negative years in a way that prohibits e.g. "-001234" (as undesirably exhibited by XS). |
@gibson042 5e0b005 seems editorial to me, and something i'd love to land separately/first. Would you be willing to make a separate PR for that commit? (you can leave it here, ofc, it will rebase out after the other one lands) |
87d27bf
to
c414add
Compare
c414add
to
f158df1
Compare
Fixes #1035