WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
26594
JSC needs to support Date.toISOString
https://bugs.webkit.org/show_bug.cgi?id=26594
Summary
JSC needs to support Date.toISOString
Oliver Hunt
Reported
2009-06-21 18:23:57 PDT
Date.toJSON depends on Date.toISOString
Attachments
Support Date.toISOString
(5.78 KB, patch)
2009-06-21 18:38 PDT
,
Oliver Hunt
no flags
Details
Formatted Diff
Diff
Updated patch
(6.39 KB, patch)
2009-06-21 19:12 PDT
,
Oliver Hunt
sam
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Oliver Hunt
Comment 1
2009-06-21 18:38:14 PDT
Created
attachment 31627
[details]
Support Date.toISOString
Oliver Hunt
Comment 2
2009-06-21 19:12:52 PDT
Created
attachment 31628
[details]
Updated patch
Sam Weinig
Comment 3
2009-06-21 21:02:12 PDT
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.
Sam Weinig
Comment 4
2009-06-21 22:01:22 PDT
Comment on
attachment 31628
[details]
Updated patch Oliver and I discussed this a bit on IRC.
Sam Weinig
Comment 5
2009-06-21 22:01:53 PDT
Comment on
attachment 31628
[details]
Updated patch Oliver and I discussed this a bit on IRC.
Oliver Hunt
Comment 6
2009-06-21 22:08:38 PDT
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
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug