Summary: | JSC needs to support Date.toISOString | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Oliver Hunt <oliver> | ||||||
Component: | JavaScriptCore | Assignee: | Oliver Hunt <oliver> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | ||||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Mac | ||||||||
OS: | OS X 10.5 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 26592 | ||||||||
Attachments: |
|
Description
Oliver Hunt
2009-06-21 18:23:57 PDT
Created attachment 31627 [details]
Support Date.toISOString
Created attachment 31628 [details]
Updated patch
Comment on attachment 31628 [details] Updated patch > + > + const bool utc = true; > + > + DateInstance* thisDateObj = asDateInstance(thisValue); > + double milli = thisDateObj->internalNumber(); > + if (isnan(milli)) > + return jsNontrivialString(exec, "Invalid Date"); According to http://wiki.ecmascript.org/lib/exe/fetch.php?id=es3.1%3Aes3.1_proposal_working_draft&cache=cache&media=es3.1:es5_candidate_errata_june_17.pdf, we should throwing a RangeError for non-finite values. > + > + GregorianDateTime t; > + thisDateObj->msToGregorianDateTime(milli, true, t); I believe the intent of the utc constant is to use it here instead of passing true. r- for the isnan bit. Comment on attachment 31628 [details]
Updated patch
Oliver and I discussed this a bit on IRC.
Comment on attachment 31628 [details]
Updated patch
Oliver and I discussed this a bit on IRC.
Committing to http://svn.webkit.org/repository/webkit/trunk ... M JavaScriptCore/ChangeLog M JavaScriptCore/runtime/DatePrototype.cpp M LayoutTests/ChangeLog A LayoutTests/fast/js/date-toisostring-expected.txt A LayoutTests/fast/js/date-toisostring.html A LayoutTests/fast/js/resources/date-toisostring.js Committed r44929 |