Index: test/webkit/fast/js/date-preserve-milliseconds.js |
diff --git a/test/webkit/dfg-inline-arguments-out-of-bounds.js b/test/webkit/fast/js/date-preserve-milliseconds.js |
similarity index 66% |
copy from test/webkit/dfg-inline-arguments-out-of-bounds.js |
copy to test/webkit/fast/js/date-preserve-milliseconds.js |
index 23b9184cacacfb4aa3c1bd5fc1dda6fd5c4f7349..4608bfc3289f814ebc7079304e4d7f4880f96b00 100644 |
--- a/test/webkit/dfg-inline-arguments-out-of-bounds.js |
+++ b/test/webkit/fast/js/date-preserve-milliseconds.js |
@@ -22,32 +22,23 @@ |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
description( |
-"Tests accessing arguments with an out-of-bounds index in an inlined function when the arguments have not been created but might be." |
+'The following test checks if an existing milliseconds value gets preserved if a call to setHours(), setMinutes() or setSeconds() does not specify the milliseconds. See <a href="https://bugs.webkit.org/show_bug.cgi?id=3759">https://bugs.webkit.org/show_bug.cgi?id=3759</a>' |
); |
-var p = false; |
+var d = new Date(0); |
+d.setMilliseconds(1); |
-function foo() { |
- if (p) |
- return arguments; |
- return arguments[0]; |
-} |
- |
-function bar() { |
- return foo(); |
-} |
- |
-var expected = "\"undefined\""; |
-for (var i = 0; i < 3000; ++i) { |
- if (i == 1000) { |
- p = true; |
- expected = "\"[object Arguments]\""; |
- } |
- if (i == 2000) { |
- p = false; |
- expected = "\"undefined\""; |
- } |
- result = "" + bar(); |
- shouldBe("result", expected); |
-} |
+var oldValue = d.getMilliseconds(); |
+d.setHours(8); |
+shouldBe("d.getMilliseconds()", oldValue.toString()); |
+d.setHours(8, 30); |
+shouldBe("d.getMilliseconds()", oldValue.toString()); |
+d.setHours(8, 30, 40); |
+shouldBe("d.getMilliseconds()", oldValue.toString()); |
+d.setMinutes(45); |
+shouldBe("d.getMilliseconds()", oldValue.toString()); |
+d.setMinutes(45, 40); |
+shouldBe("d.getMilliseconds()", oldValue.toString()); |
+d.setSeconds(50); |
+shouldBe("d.getMilliseconds()", oldValue.toString()); |