Title: [129902] trunk/LayoutTests
Revision
129902
Author
[email protected]
Date
2012-09-28 08:51:16 -0700 (Fri, 28 Sep 2012)

Log Message

Adding regression test to ensure that cached call uninitialized arguments
correctly defaults to undefined.
https://bugs.webkit.org/show_bug.cgi?id=97836.

Reviewed by Geoffrey Garen.

* fast/js/cached-call-uninitialized-arguments-expected.txt: Added.
* fast/js/cached-call-uninitialized-arguments.html: Added.
* fast/js/script-tests/cached-call-uninitialized-arguments.js: Added.
(doForEach.callback.shouldBeUndefined):
(doForEach.callback):
(doForEach):
(callAfterRecursingForDepth):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (129901 => 129902)


--- trunk/LayoutTests/ChangeLog	2012-09-28 15:45:20 UTC (rev 129901)
+++ trunk/LayoutTests/ChangeLog	2012-09-28 15:51:16 UTC (rev 129902)
@@ -1,3 +1,19 @@
+2012-09-28  Mark Lam  <[email protected]>
+
+        Adding regression test to ensure that cached call uninitialized arguments
+        correctly defaults to undefined.
+        https://bugs.webkit.org/show_bug.cgi?id=97836.
+
+        Reviewed by Geoffrey Garen.
+
+        * fast/js/cached-call-uninitialized-arguments-expected.txt: Added.
+        * fast/js/cached-call-uninitialized-arguments.html: Added.
+        * fast/js/script-tests/cached-call-uninitialized-arguments.js: Added.
+        (doForEach.callback.shouldBeUndefined):
+        (doForEach.callback):
+        (doForEach):
+        (callAfterRecursingForDepth):
+
 2012-09-28  Zoltan Arvai  <[email protected]>
 
         [Qt] Gardening. Cleanup some Qt specific expectation.

Added: trunk/LayoutTests/fast/js/cached-call-uninitialized-arguments-expected.txt (0 => 129902)


--- trunk/LayoutTests/fast/js/cached-call-uninitialized-arguments-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/js/cached-call-uninitialized-arguments-expected.txt	2012-09-28 15:51:16 UTC (rev 129902)
@@ -0,0 +1,12 @@
+This test checks that uninitialized parameters for cached call functions correctly defaults to undefined.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS arg4 is undefined.
+PASS arg5 is undefined.
+PASS arg6 is undefined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/js/cached-call-uninitialized-arguments.html (0 => 129902)


--- trunk/LayoutTests/fast/js/cached-call-uninitialized-arguments.html	                        (rev 0)
+++ trunk/LayoutTests/fast/js/cached-call-uninitialized-arguments.html	2012-09-28 15:51:16 UTC (rev 129902)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/js/script-tests/cached-call-uninitialized-arguments.js (0 => 129902)


--- trunk/LayoutTests/fast/js/script-tests/cached-call-uninitialized-arguments.js	                        (rev 0)
+++ trunk/LayoutTests/fast/js/script-tests/cached-call-uninitialized-arguments.js	2012-09-28 15:51:16 UTC (rev 129902)
@@ -0,0 +1,43 @@
+description(
+"This test checks that uninitialized parameters for cached call functions correctly defaults to undefined."
+
+);
+
+function doForEach(arr) {
+    function callback(element, index, array, arg4, arg5, arg6) {
+
+        function shouldBeUndefined(_a) {
+            var exception;
+            var _av;
+            try {
+                _av = eval(_a);
+            } catch (e) {
+                exception = e;
+            }
+
+            if (exception)
+                testFailed(_a + " should be undefined. Threw exception " + exception);
+            else if (typeof _av == "undefined")
+                testPassed(_a + " is undefined.");
+            else
+                testFailed(_a + " should be undefined. Was " + _av);
+        }
+
+        shouldBeUndefined("arg4");
+        shouldBeUndefined("arg5");
+        shouldBeUndefined("arg6");
+    }
+
+    arr.forEach(callback);
+}
+
+function callAfterRecursingForDepth(depth, func, arr) {
+    if (depth > 0) {
+        callAfterRecursingForDepth(depth - 1, func, arr);
+    } else {
+        func(arr);
+    }
+}
+
+var arr = [1];
+callAfterRecursingForDepth(20, doForEach, arr);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to