Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upWhat is the motivation for the Date.prototype.toString() non-Date receiver support? #849
Comments
littledan
added
question
web reality
labels
Mar 17, 2017
added a commit
to littledan/ecma262
that referenced
this issue
Mar 18, 2017
littledan
referenced this issue
Mar 18, 2017
Merged
Normative: Date.prototype.toString throws on non-Date receiver #850
added a commit
to littledan/test262
that referenced
this issue
Mar 21, 2017
littledan
referenced this issue
Mar 21, 2017
Merged
Test that Date.prototype.toString throws for non-Date receiver #924
added a commit
to littledan/test262
that referenced
this issue
Mar 23, 2017
bterlson
closed this
in
#850
Jun 28, 2017
added a commit
that referenced
this issue
Jun 28, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
littledan commentedMar 17, 2017
In the spec,
Date.prototype.toStringfalls back to"Invalid Date"when the receiver is a non-Date Object. However, apparently d8 and jsc don't implement this and throw a TypeError, both forDate.prototypeand for{}. ChakraCore seems to return"Invalid Date"forDate.prototypeand throw for other objects, and SpiderMonkey implements the spec properly.What was the motivation for this path in
Date.prototype.toString? Was it web compatibility? If so, it seems like we have some evidence that it could be removed. It looks like this path wasn't present in the ES 5.1 version.