Title: [181886] trunk/LayoutTests
Revision
181886
Author
[email protected]
Date
2015-03-23 18:48:54 -0700 (Mon, 23 Mar 2015)

Log Message

Move the bulk of the js/dom/const test into js/const, so that run-jsc-stress-tests runs it.

Rubber stamped by Andreas Kling and Michael Saboff.

* js/const-expected.txt: Copied from LayoutTests/js/dom/const-expected.txt.
* js/const.html: Copied from LayoutTests/js/dom/const.html.
* js/dom/const-expected.txt: Replaced.
* js/dom/const.html: Replaced.
* js/resources/const.js: Removed.
* js/script-tests/const.js: Copied from LayoutTests/js/resources/const.js.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (181885 => 181886)


--- trunk/LayoutTests/ChangeLog	2015-03-24 01:28:06 UTC (rev 181885)
+++ trunk/LayoutTests/ChangeLog	2015-03-24 01:48:54 UTC (rev 181886)
@@ -1,3 +1,16 @@
+2015-03-23  Filip Pizlo  <[email protected]>
+
+        Move the bulk of the js/dom/const test into js/const, so that run-jsc-stress-tests runs it.
+
+        Rubber stamped by Andreas Kling and Michael Saboff.
+
+        * js/const-expected.txt: Copied from LayoutTests/js/dom/const-expected.txt.
+        * js/const.html: Copied from LayoutTests/js/dom/const.html.
+        * js/dom/const-expected.txt: Replaced.
+        * js/dom/const.html: Replaced.
+        * js/resources/const.js: Removed.
+        * js/script-tests/const.js: Copied from LayoutTests/js/resources/const.js.
+
 2015-03-23  Andy Estes  <[email protected]>
 
         [Content Filtering] Fix up a few mistakes in LayoutTests/contentfiltering/

Copied: trunk/LayoutTests/js/const-expected.txt (from rev 181875, trunk/LayoutTests/js/dom/const-expected.txt) (0 => 181886)


--- trunk/LayoutTests/js/const-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/const-expected.txt	2015-03-24 01:48:54 UTC (rev 181886)
@@ -0,0 +1,68 @@
+This test checks that const declarations in _javascript_ work and are readonly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+FAIL const redef='a'; const redef='a'; should throw an exception. Was undefined.
+PASS x is "RIGHT"
+PASS y is "RIGHT"
+PASS a is 1
+PASS one is 1
+PASS a is 1
+PASS one is 1
+PASS a is 2
+PASS one is 1
+PASS a is 0
+PASS one is 1
+PASS a is 3
+PASS one is 1
+PASS a is 2
+PASS one is 1
+PASS function f() { const _one_ = 1; one++; return one; } f(); is 1
+PASS function f() { const _oneString_ = '1'; return oneString++; } f(); is 1
+PASS function f() { const _one_ = 1; return one++; } f(); is 1
+PASS function f() { const _one_ = 1; one--; return one; } f(); is 1
+PASS function f() { const _oneString_ = '1'; return oneString--; } f(); is 1
+PASS function f() { const _one_ = 1; return one--; } f(); is 1
+PASS function f() { const _one_ = 1; ++one; return one; } f(); is 1
+PASS function f() { const _one_ = 1; return ++one; } f(); is 2
+PASS function f() { const _one_ = 1; --one; return one; } f(); is 1
+PASS function f() { const _one_ = 1; return --one; } f(); is 0
+PASS function f() { const _one_ = 1; one += 2; return one; } f(); is 1
+PASS function f() { const _one_ = 1; return one += 2; } f(); is 3
+PASS function f() { const _one_ = 1; _one_ = 2; return one; } f(); is 1
+PASS function f() { const _one_ = 1; return _one_ = 2; } f(); is 2
+PASS one++ is 1
+PASS one is 1
+PASS one-- is 1
+PASS one is 1
+PASS ++one is 2
+PASS one is 1
+PASS --one is 0
+PASS one is 1
+PASS one += 1 is 2
+PASS one is 1
+PASS _one_ = 2 is 2
+PASS one is 1
+PASS object.inWith1 is 'RIGHT'
+PASS inWith2 is 'RIGHT'
+PASS (function(){ _one_ = 2; return one; })() is 1
+PASS f() is f
+PASS const a; is undefined
+PASS tryCatch1Result is 5
+PASS tryCatch2Result is 5
+PASS with1Result is 5
+PASS with2Result is 5
+PASS PASS: ++x should be 2 and is.
+PASS PASS: --x should be 0 and is.
+PASS PASS: x should be 1 and is.
+PASS PASS: x++ should be 1 and is.
+PASS PASS: x should be 1 and is.
+PASS PASS: ++x should be 2 and is.
+PASS PASS: x should be 1 and is.
+PASS PASS: x++ should be 1 and is.
+PASS PASS: x should be 1 and is.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Copied: trunk/LayoutTests/js/const.html (from rev 181875, trunk/LayoutTests/js/dom/const.html) (0 => 181886)


--- trunk/LayoutTests/js/const.html	                        (rev 0)
+++ trunk/LayoutTests/js/const.html	2015-03-24 01:48:54 UTC (rev 181886)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Deleted: trunk/LayoutTests/js/dom/const-expected.txt (181885 => 181886)


--- trunk/LayoutTests/js/dom/const-expected.txt	2015-03-24 01:28:06 UTC (rev 181885)
+++ trunk/LayoutTests/js/dom/const-expected.txt	2015-03-24 01:48:54 UTC (rev 181886)
@@ -1,70 +0,0 @@
-This test checks that const declarations in _javascript_ work and are readonly.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-FAIL const redef='a'; const redef='a'; should throw an exception. Was undefined.
-PASS x is "RIGHT"
-PASS y is "RIGHT"
-PASS a is 1
-PASS one is 1
-PASS a is 1
-PASS one is 1
-PASS a is 2
-PASS one is 1
-PASS a is 0
-PASS one is 1
-PASS a is 3
-PASS one is 1
-PASS a is 2
-PASS one is 1
-PASS function f() { const _one_ = 1; one++; return one; } f(); is 1
-PASS function f() { const _oneString_ = '1'; return oneString++; } f(); is 1
-PASS function f() { const _one_ = 1; return one++; } f(); is 1
-PASS function f() { const _one_ = 1; one--; return one; } f(); is 1
-PASS function f() { const _oneString_ = '1'; return oneString--; } f(); is 1
-PASS function f() { const _one_ = 1; return one--; } f(); is 1
-PASS function f() { const _one_ = 1; ++one; return one; } f(); is 1
-PASS function f() { const _one_ = 1; return ++one; } f(); is 2
-PASS function f() { const _one_ = 1; --one; return one; } f(); is 1
-PASS function f() { const _one_ = 1; return --one; } f(); is 0
-PASS function f() { const _one_ = 1; one += 2; return one; } f(); is 1
-PASS function f() { const _one_ = 1; return one += 2; } f(); is 3
-PASS function f() { const _one_ = 1; _one_ = 2; return one; } f(); is 1
-PASS function f() { const _one_ = 1; return _one_ = 2; } f(); is 2
-PASS one++ is 1
-PASS one is 1
-PASS one-- is 1
-PASS one is 1
-PASS ++one is 2
-PASS one is 1
-PASS --one is 0
-PASS one is 1
-PASS one += 1 is 2
-PASS one is 1
-PASS _one_ = 2 is 2
-PASS one is 1
-PASS object.inWith1 is 'RIGHT'
-PASS inWith2 is 'RIGHT'
-PASS (function(){ _one_ = 2; return one; })() is 1
-PASS f() is f
-PASS const a; is undefined
-PASS bodyId is document.getElementById('bodyId')
-PASS ranConstInitialiser is true
-PASS tryCatch1Result is 5
-PASS tryCatch2Result is 5
-PASS with1Result is 5
-PASS with2Result is 5
-PASS PASS: ++x should be 2 and is.
-PASS PASS: --x should be 0 and is.
-PASS PASS: x should be 1 and is.
-PASS PASS: x++ should be 1 and is.
-PASS PASS: x should be 1 and is.
-PASS PASS: ++x should be 2 and is.
-PASS PASS: x should be 1 and is.
-PASS PASS: x++ should be 1 and is.
-PASS PASS: x should be 1 and is.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Added: trunk/LayoutTests/js/dom/const-expected.txt (0 => 181886)


--- trunk/LayoutTests/js/dom/const-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/dom/const-expected.txt	2015-03-24 01:48:54 UTC (rev 181886)
@@ -0,0 +1,11 @@
+This test checks that const declarations in _javascript_ work and are readonly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS bodyId is document.getElementById('bodyId')
+PASS ranConstInitialiser is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Deleted: trunk/LayoutTests/js/dom/const.html (181885 => 181886)


--- trunk/LayoutTests/js/dom/const.html	2015-03-24 01:28:06 UTC (rev 181885)
+++ trunk/LayoutTests/js/dom/const.html	2015-03-24 01:48:54 UTC (rev 181886)
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</head>
-<body id="bodyId">
-<script src=""
-<script src=""
-</body>
-</html>

Added: trunk/LayoutTests/js/dom/const.html (0 => 181886)


--- trunk/LayoutTests/js/dom/const.html	                        (rev 0)
+++ trunk/LayoutTests/js/dom/const.html	2015-03-24 01:48:54 UTC (rev 181886)
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Const test</title>
+<script src=""
+</head>
+<body id="bodyId">
+<script>
+description(
+"This test checks that const declarations in _javascript_ work and are readonly."
+);
+
+// Make sure we don't override properties placed on the global object
+var ranConstInitialiser = false;
+const bodyId = (ranConstInitialiser = true, "Const initialiser overwrote existing property");
+shouldBe("bodyId", "document.getElementById('bodyId')");
+shouldBeTrue("ranConstInitialiser");
+</script>
+<script src=""
+</body>
+</html>

Deleted: trunk/LayoutTests/js/resources/const.js (181885 => 181886)


--- trunk/LayoutTests/js/resources/const.js	2015-03-24 01:28:06 UTC (rev 181885)
+++ trunk/LayoutTests/js/resources/const.js	2015-03-24 01:48:54 UTC (rev 181886)
@@ -1,190 +0,0 @@
-description(
-"This test checks that const declarations in _javascript_ work and are readonly."
-);
-
-
-shouldThrow("const redef='a'; const redef='a';");
-
-const x = "RIGHT";
-x = "WRONG";
-shouldBe("x", '"RIGHT"');
-
-const z = "RIGHT", y = "RIGHT";
-y = "WRONG";
-shouldBe("y", '"RIGHT"');
-
-const _one_ = 1;
-
-var a;
-
-// PostIncResolveNode
-a = one++;
-shouldBe("a", "1");
-shouldBe("one", "1");
-
-// PostDecResolveNode
-a = one--;
-shouldBe("a", "1");
-shouldBe("one", "1");
-
-// PreIncResolveNode
-a = ++one;
-shouldBe("a", "2");
-shouldBe("one", "1");
-
-// PreDecResolveNode
-a = --one;
-shouldBe("a", "0");
-shouldBe("one", "1");
-
-// ReadModifyConstNode
-a = one += 2;
-shouldBe("a", "3");
-shouldBe("one", "1");
-
-// AssignConstNode
-a = _one_ = 2;
-shouldBe("a", "2");
-shouldBe("one", "1");
-
-// PostIncResolveNode
-shouldBe("function f() { const _one_ = 1; one++; return one; } f();", "1");
-shouldBe("function f() { const _oneString_ = '1'; return oneString++; } f();", "1");
-shouldBe("function f() { const _one_ = 1; return one++; } f();", "1");
-
-// PostDecResolveNode
-shouldBe("function f() { const _one_ = 1; one--; return one; } f();", "1");
-shouldBe("function f() { const _oneString_ = '1'; return oneString--; } f();", "1");
-shouldBe("function f() { const _one_ = 1; return one--; } f();", "1");
-
-// PreIncResolveNode
-shouldBe("function f() { const _one_ = 1; ++one; return one; } f();", "1");
-shouldBe("function f() { const _one_ = 1; return ++one; } f();", "2");
-
-// PreDecResolveNode
-shouldBe("function f() { const _one_ = 1; --one; return one; } f();", "1");
-shouldBe("function f() { const _one_ = 1; return --one; } f();", "0");
-
-// ReadModifyConstNode
-shouldBe("function f() { const _one_ = 1; one += 2; return one; } f();", "1");
-shouldBe("function f() { const _one_ = 1; return one += 2; } f();", "3");
-
-// AssignConstNode
-shouldBe("function f() { const _one_ = 1; _one_ = 2; return one; } f();", "1");
-shouldBe("function f() { const _one_ = 1; return _one_ = 2; } f();", "2");
-
-// PostIncResolveNode
-shouldBe("one++", "1");
-shouldBe("one", "1");
-
-// PostDecResolveNode
-shouldBe("one--", "1");
-shouldBe("one", "1");
-
-// PreIncResolveNode
-shouldBe("++one", "2");
-shouldBe("one", "1");
-
-// PreDecResolveNode
-shouldBe("--one", "0");
-shouldBe("one", "1");
-
-// ReadModifyConstNode
-shouldBe("one += 1", "2");
-shouldBe("one", "1");
-
-// AssignConstNode
-shouldBe("_one_ = 2", "2");
-shouldBe("one", "1");
-
-var object = { inWith1: "RIGHT", inWith2: ""}
-with (object) {
-    const inWith1 = "WRONG";
-    const inWith2 = "RIGHT";
-    inWith2 = "WRONG";
-}
-shouldBe("object.inWith1", "'RIGHT'");
-shouldBe("inWith2", "'RIGHT'");
-
-shouldBe("(function(){ _one_ = 2; return one; })()", "1")
-var f = function g() { g="FAIL"; return g; };
-shouldBe("f()", "f");
-
-shouldBe("const a;", "undefined");
-
-// Make sure we don't override properties placed on the global object
-var ranConstInitialiser = false;
-const bodyId = (ranConstInitialiser = true, "Const initialiser overwrote existing property");
-shouldBe("bodyId", "document.getElementById('bodyId')");
-shouldBeTrue("ranConstInitialiser");
-
-// Make sure that dynamic scopes (catch, with) don't break const declarations
-function tryCatch1() {
-    var bar;
-    eval("try {\
-        stuff();\
-    } catch (e) {\
-        const bar = 5;\
-    }");
-    return bar;
-}
-
-function tryCatch2() {
-    var bar;
-    try {
-        stuff();
-    } catch (e) {
-        const bar = 5;
-    }
-    return bar;
-}
-
-tryCatch1Result = tryCatch1();
-shouldBe("tryCatch1Result", "5");
-tryCatch2Result = tryCatch2();
-shouldBe("tryCatch2Result", "5");
-
-function with1() {
-    var bar;
-    eval("with({foo:42}) const bar = 5;");
-    return bar;
-}
-
-function with2() {
-    var bar;
-    with({foo:42}) const bar = 5;
-    return bar;
-}
-
-with1Result = with1();
-shouldBe("with1Result", "5");
-with2Result = with2();
-shouldBe("with2Result", "5");
-
-(function () {
-    function shouldBe(aDescription, a, b)
-    {
-        if (a === b) {
-            testPassed("PASS: " + aDescription + " should be " + b + " and is.");
-            return;
-        }
-
-        testFailed("FAIL: " + aDescription + " should be " + b + " but instead is " + a + ".");
-    }
-
-    (function() {
-        const x = "1";
-        shouldBe("++x", ++x, 2);
-        shouldBe("--x", --x, 0);
-        shouldBe("x", x, "1");
-        shouldBe("x++", x++, 1);
-        shouldBe("x", x, "1");
-    })();
-    (function() {
-        const x = 1;
-        shouldBe("++x", ++x, 2);
-        shouldBe("x", x, 1);
-        shouldBe("x++", x++, 1);
-        shouldBe("x", x, 1);
-    })();
-})();

Copied: trunk/LayoutTests/js/script-tests/const.js (from rev 181875, trunk/LayoutTests/js/resources/const.js) (0 => 181886)


--- trunk/LayoutTests/js/script-tests/const.js	                        (rev 0)
+++ trunk/LayoutTests/js/script-tests/const.js	2015-03-24 01:48:54 UTC (rev 181886)
@@ -0,0 +1,184 @@
+description(
+"This test checks that const declarations in _javascript_ work and are readonly."
+);
+
+
+shouldThrow("const redef='a'; const redef='a';");
+
+const x = "RIGHT";
+x = "WRONG";
+shouldBe("x", '"RIGHT"');
+
+const z = "RIGHT", y = "RIGHT";
+y = "WRONG";
+shouldBe("y", '"RIGHT"');
+
+const _one_ = 1;
+
+var a;
+
+// PostIncResolveNode
+a = one++;
+shouldBe("a", "1");
+shouldBe("one", "1");
+
+// PostDecResolveNode
+a = one--;
+shouldBe("a", "1");
+shouldBe("one", "1");
+
+// PreIncResolveNode
+a = ++one;
+shouldBe("a", "2");
+shouldBe("one", "1");
+
+// PreDecResolveNode
+a = --one;
+shouldBe("a", "0");
+shouldBe("one", "1");
+
+// ReadModifyConstNode
+a = one += 2;
+shouldBe("a", "3");
+shouldBe("one", "1");
+
+// AssignConstNode
+a = _one_ = 2;
+shouldBe("a", "2");
+shouldBe("one", "1");
+
+// PostIncResolveNode
+shouldBe("function f() { const _one_ = 1; one++; return one; } f();", "1");
+shouldBe("function f() { const _oneString_ = '1'; return oneString++; } f();", "1");
+shouldBe("function f() { const _one_ = 1; return one++; } f();", "1");
+
+// PostDecResolveNode
+shouldBe("function f() { const _one_ = 1; one--; return one; } f();", "1");
+shouldBe("function f() { const _oneString_ = '1'; return oneString--; } f();", "1");
+shouldBe("function f() { const _one_ = 1; return one--; } f();", "1");
+
+// PreIncResolveNode
+shouldBe("function f() { const _one_ = 1; ++one; return one; } f();", "1");
+shouldBe("function f() { const _one_ = 1; return ++one; } f();", "2");
+
+// PreDecResolveNode
+shouldBe("function f() { const _one_ = 1; --one; return one; } f();", "1");
+shouldBe("function f() { const _one_ = 1; return --one; } f();", "0");
+
+// ReadModifyConstNode
+shouldBe("function f() { const _one_ = 1; one += 2; return one; } f();", "1");
+shouldBe("function f() { const _one_ = 1; return one += 2; } f();", "3");
+
+// AssignConstNode
+shouldBe("function f() { const _one_ = 1; _one_ = 2; return one; } f();", "1");
+shouldBe("function f() { const _one_ = 1; return _one_ = 2; } f();", "2");
+
+// PostIncResolveNode
+shouldBe("one++", "1");
+shouldBe("one", "1");
+
+// PostDecResolveNode
+shouldBe("one--", "1");
+shouldBe("one", "1");
+
+// PreIncResolveNode
+shouldBe("++one", "2");
+shouldBe("one", "1");
+
+// PreDecResolveNode
+shouldBe("--one", "0");
+shouldBe("one", "1");
+
+// ReadModifyConstNode
+shouldBe("one += 1", "2");
+shouldBe("one", "1");
+
+// AssignConstNode
+shouldBe("_one_ = 2", "2");
+shouldBe("one", "1");
+
+var object = { inWith1: "RIGHT", inWith2: ""}
+with (object) {
+    const inWith1 = "WRONG";
+    const inWith2 = "RIGHT";
+    inWith2 = "WRONG";
+}
+shouldBe("object.inWith1", "'RIGHT'");
+shouldBe("inWith2", "'RIGHT'");
+
+shouldBe("(function(){ _one_ = 2; return one; })()", "1")
+var f = function g() { g="FAIL"; return g; };
+shouldBe("f()", "f");
+
+shouldBe("const a;", "undefined");
+
+// Make sure that dynamic scopes (catch, with) don't break const declarations
+function tryCatch1() {
+    var bar;
+    eval("try {\
+        stuff();\
+    } catch (e) {\
+        const bar = 5;\
+    }");
+    return bar;
+}
+
+function tryCatch2() {
+    var bar;
+    try {
+        stuff();
+    } catch (e) {
+        const bar = 5;
+    }
+    return bar;
+}
+
+tryCatch1Result = tryCatch1();
+shouldBe("tryCatch1Result", "5");
+tryCatch2Result = tryCatch2();
+shouldBe("tryCatch2Result", "5");
+
+function with1() {
+    var bar;
+    eval("with({foo:42}) const bar = 5;");
+    return bar;
+}
+
+function with2() {
+    var bar;
+    with({foo:42}) const bar = 5;
+    return bar;
+}
+
+with1Result = with1();
+shouldBe("with1Result", "5");
+with2Result = with2();
+shouldBe("with2Result", "5");
+
+(function () {
+    function shouldBe(aDescription, a, b)
+    {
+        if (a === b) {
+            testPassed("PASS: " + aDescription + " should be " + b + " and is.");
+            return;
+        }
+
+        testFailed("FAIL: " + aDescription + " should be " + b + " but instead is " + a + ".");
+    }
+
+    (function() {
+        const x = "1";
+        shouldBe("++x", ++x, 2);
+        shouldBe("--x", --x, 0);
+        shouldBe("x", x, "1");
+        shouldBe("x++", x++, 1);
+        shouldBe("x", x, "1");
+    })();
+    (function() {
+        const x = 1;
+        shouldBe("++x", ++x, 2);
+        shouldBe("x", x, 1);
+        shouldBe("x++", x++, 1);
+        shouldBe("x", x, 1);
+    })();
+})();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to