-
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
Contradiction in 20.3.4.41 Date.prototype.toString note 2 #1268
Comments
Date.porotype.toString is not generic. Fixes tc39#1268
Date.prototype.toString is not generic. Fixes tc39#1268
Note that in ES2015 it was generic because it used NaN as the TimeValue the [[DateValue]] field was not present. Hopefully, there was a reason that was changed and why the generic method note is out of date. |
See #850. Here is the broader context for those that weren’t born during the heroic times of es6 standardisation: In the beginning, |
As speculated in #850 the ES6 specification for Date.prototype.toString was indeed based upon the long and nuanced discussion at https://mail.mozilla.org/pipermail/es-discuss/2014-June/037630.html Unfortunately, there is no indication in the May 2017 meeting notes that any of the points from that thread were presented or discussed when asking the committee to change the ES6 design. |
Date#toString is generic in ES2015 [1] and it doesn't throw, so we also check Map#get (which on the other hand doesn't exist in ES5 browsers). [1]: tc39/ecma262#1268 (comment)
Date#toString is generic in ES2015 [1] and it doesn't throw, so we also check Map#get (which on the other hand doesn't exist in ES5 browsers). [1]: tc39/ecma262#1268 (comment)
Date#toString is generic in ES2015 [1] and it doesn't throw, but it returns "Invalid Date" [1]: tc39/ecma262#1268 (comment)
The second note for Date.prototype.toString states:
However, the algorithm begins with this step:
The
thisTimeValue
operation is not generic; it throws a TypeError if the receiver does not have a[[DateValue]]
slot.I believe this note is likely a mistake, unless I am misunderstanding what “generic” signifies here.
The text was updated successfully, but these errors were encountered: