[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

tkent at chromium.org tkent at chromium.org
Thu Feb 4 21:36:06 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 539394132b5a3e9407f71d7f93f9ce5de58de087
Author: tkent at chromium.org <tkent at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 2 04:56:28 2010 +0000

    2010-02-01  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Darin Adler.
    
            Date.UTC() should apply TimeClip operation.
            https://bugs.webkit.org/show_bug.cgi?id=34461
    
            ECMAScript 5 15.9.4.3:
            > 9 Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))).
    
            * runtime/DateConstructor.cpp:
            (JSC::dateUTC): Calls WTF::timeClip().
    
    2010-02-01  Kent Tamura  <tkent at chromium.org>
    
            Reviewed by Darin Adler.
    
            Date.UTC() should apply TimeClip operation.
            https://bugs.webkit.org/show_bug.cgi?id=34461
    
            Add tests for corner cases of Date.UTC().
    
            * fast/js/date-utc-timeclip-expected.txt: Added.
            * fast/js/date-utc-timeclip.html: Added.
            * fast/js/script-tests/date-utc-timeclip.js: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54199 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 60796b4..53d7ff9 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -2,6 +2,19 @@
 
         Reviewed by Darin Adler.
 
+        Date.UTC() should apply TimeClip operation.
+        https://bugs.webkit.org/show_bug.cgi?id=34461
+
+        ECMAScript 5 15.9.4.3:
+        > 9 Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))).
+
+        * runtime/DateConstructor.cpp:
+        (JSC::dateUTC): Calls WTF::timeClip().
+
+2010-02-01  Kent Tamura  <tkent at chromium.org>
+
+        Reviewed by Darin Adler.
+
         Fix a bug that Math.round() retunrs incorrect results for huge integers
         https://bugs.webkit.org/show_bug.cgi?id=34462
 
diff --git a/JavaScriptCore/runtime/DateConstructor.cpp b/JavaScriptCore/runtime/DateConstructor.cpp
index 2e476b3..e9a5c29 100644
--- a/JavaScriptCore/runtime/DateConstructor.cpp
+++ b/JavaScriptCore/runtime/DateConstructor.cpp
@@ -177,7 +177,7 @@ static JSValue JSC_HOST_CALL dateUTC(ExecState* exec, JSObject*, JSValue, const
     t.minute = args.at(4).toInt32(exec);
     t.second = args.at(5).toInt32(exec);
     double ms = (n >= 7) ? args.at(6).toNumber(exec) : 0;
-    return jsNumber(exec, gregorianDateTimeToMS(exec, t, ms, true));
+    return jsNumber(exec, timeClip(gregorianDateTimeToMS(exec, t, ms, true)));
 }
 
 } // namespace JSC
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 66031b0..f74b652 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,18 @@
 2010-02-01  Kent Tamura  <tkent at chromium.org>
 
+        Reviewed by Darin Adler.
+
+        Date.UTC() should apply TimeClip operation.
+        https://bugs.webkit.org/show_bug.cgi?id=34461
+
+        Add tests for corner cases of Date.UTC().
+
+        * fast/js/date-utc-timeclip-expected.txt: Added.
+        * fast/js/date-utc-timeclip.html: Added.
+        * fast/js/script-tests/date-utc-timeclip.js: Added.
+
+2010-02-01  Kent Tamura  <tkent at chromium.org>
+
         Unreviewed. Add two more test cases which I forgot to add in r54197.
         https://bugs.webkit.org/show_bug.cgi?id=34462
 
diff --git a/LayoutTests/fast/js/date-utc-timeclip-expected.txt b/LayoutTests/fast/js/date-utc-timeclip-expected.txt
new file mode 100644
index 0000000..e078fd3
--- /dev/null
+++ b/LayoutTests/fast/js/date-utc-timeclip-expected.txt
@@ -0,0 +1,17 @@
+Date.UTC() should apply TimeClip operation according to ECMA-262.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS Date.UTC(275760, 8, 12, 23, 59, 59, 999) is 8639999999999999
+PASS Date.UTC(275760, 8, 13) is 8640000000000000
+PASS isNaN(Date.UTC(275760, 8, 13, 0, 0, 0, 1)) is true
+PASS isNaN(Date.UTC(275760, 8, 14)) is true
+PASS Date.UTC(-271821, 3, 20, 0, 0, 0, 1) is -8639999999999999
+PASS Date.UTC(-271821, 3, 20) is -8640000000000000
+PASS isNaN(Date.UTC(-271821, 3, 19, 23, 59, 59, 999)) is true
+PASS isNaN(Date.UTC(-271821, 3, 19)) is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/date-utc-timeclip.html b/LayoutTests/fast/js/date-utc-timeclip.html
new file mode 100644
index 0000000..d5d88f3
--- /dev/null
+++ b/LayoutTests/fast/js/date-utc-timeclip.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/date-utc-timeclip.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/script-tests/date-utc-timeclip.js b/LayoutTests/fast/js/script-tests/date-utc-timeclip.js
new file mode 100644
index 0000000..1ca167b
--- /dev/null
+++ b/LayoutTests/fast/js/script-tests/date-utc-timeclip.js
@@ -0,0 +1,13 @@
+description('Date.UTC() should apply TimeClip operation according to ECMA-262.');
+
+shouldBe('Date.UTC(275760, 8, 12, 23, 59, 59, 999)', '8639999999999999');
+shouldBe('Date.UTC(275760, 8, 13)', '8640000000000000');
+shouldBeTrue('isNaN(Date.UTC(275760, 8, 13, 0, 0, 0, 1))');
+shouldBeTrue('isNaN(Date.UTC(275760, 8, 14))');
+
+shouldBe('Date.UTC(-271821, 3, 20, 0, 0, 0, 1)', '-8639999999999999');
+shouldBe('Date.UTC(-271821, 3, 20)', '-8640000000000000');
+shouldBeTrue('isNaN(Date.UTC(-271821, 3, 19, 23, 59, 59, 999))');
+shouldBeTrue('isNaN(Date.UTC(-271821, 3, 19))');
+
+var successfullyParsed = true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list