- some JavaScript syntax test cases

        * layout-tests/fast/js/delete-syntax-expected.txt: Added.
        * layout-tests/fast/js/delete-syntax.html: Added.
        * layout-tests/fast/js/postfix-syntax-expected.txt: Added.
        * layout-tests/fast/js/postfix-syntax.html: Added.
        * layout-tests/fast/js/prefix-syntax-expected.txt: Added.
        * layout-tests/fast/js/prefix-syntax.html: Added.
        * layout-tests/fast/js/typeof-syntax-expected.txt: Added.
        * layout-tests/fast/js/typeof-syntax.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@10622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/js/delete-syntax-expected.txt b/LayoutTests/fast/js/delete-syntax-expected.txt
new file mode 100644
index 0000000..adc52ba
--- /dev/null
+++ b/LayoutTests/fast/js/delete-syntax-expected.txt
@@ -0,0 +1,24 @@
+This test checks whether various forms of delete expression are allowed. It should print the numbers 1-10 on separate lines, and nothing else (besides this paragraph).
+
+
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+
diff --git a/LayoutTests/fast/js/delete-syntax.html b/LayoutTests/fast/js/delete-syntax.html
new file mode 100644
index 0000000..b293ac0
--- /dev/null
+++ b/LayoutTests/fast/js/delete-syntax.html
@@ -0,0 +1,72 @@
+<body>
+<p>
+This test checks whether various forms of delete expression are
+allowed. It should print the numbers 1-10 on separate lines, and
+nothing else (besides this paragraph).
+<p>
+<hr>
+<pre id="console">
+</pre>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function log(s)
+{
+    document.getElementById('console').innerHTML += s + '<br>';
+}
+
+window.x = 0;
+window.y = 0;
+
+try { eval ('log(delete x);'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete window.x);'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete window["x"]);'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete (x));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete (window.x));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete (window["x"]));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log((y, delete x));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete ((x)));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete ((window.x)));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete ((window["x"])));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete (y, x));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+try { eval ('log(delete (true ? x : y));'); } catch (e) { log("FAIL"); }
+window.x = 0;
+window.y = 0;
+
+try { eval ('log(delete nonexistent)'); } catch (e) { log("FAIL"); }
+try { eval ('log(delete window.nonexistent)'); } catch (e) { log("FAIL"); }
+try { eval ('log(delete window["nonexistent"])'); } catch (e) { log("FAIL");}
+try { eval ('log(delete (nonexistent))'); } catch (e) { log("FAIL");}
+try { eval ('log(delete (window.nonexistent))'); } catch (e) { log("FAIL"); }
+try { eval ('log(delete (window["nonexistent"]))'); } catch (e) { log("FAIL"); }
+
+try { eval ('log(delete "x")'); } catch (e) { log("FAIL"); }
+try { eval ('log(delete (2 + 3))'); } catch (e) { log("FAIL"); }
+
+
+</script>
+
+</body>
diff --git a/LayoutTests/fast/js/postfix-syntax-expected.txt b/LayoutTests/fast/js/postfix-syntax-expected.txt
new file mode 100644
index 0000000..29a4d08
--- /dev/null
+++ b/LayoutTests/fast/js/postfix-syntax-expected.txt
@@ -0,0 +1,14 @@
+This test checks whether various forms of postincrement expression are allowed. It should print the numbers 0-9 on separate lines, and nothing else (besides this paragraph).
+
+
+0
+1
+2
+3
+4
+5
+6
+7
+8
+9
+
diff --git a/LayoutTests/fast/js/postfix-syntax.html b/LayoutTests/fast/js/postfix-syntax.html
new file mode 100644
index 0000000..5e7c7ba
--- /dev/null
+++ b/LayoutTests/fast/js/postfix-syntax.html
@@ -0,0 +1,38 @@
+<body>
+<p>
+This test checks whether various forms of postincrement expression are
+allowed. It should print the numbers 0-9 on separate lines, and
+nothing else (besides this paragraph).
+<p>
+<hr>
+<pre id="console">
+</pre>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function log(s)
+{
+    document.getElementById('console').innerHTML += s + '<br>';
+}
+
+var x = 0;
+var y = 0;
+
+try { eval ('log(x++);'); } catch (e) {}
+try { eval ('log(window.x++);'); } catch (e) {}
+try { eval ('log(window["x"]++);'); } catch (e) {}
+try { eval ('log((x)++);'); } catch (e) {}
+try { eval ('log((window.x)++);'); } catch (e) {}
+try { eval ('log((window["x"])++);'); } catch (e) {}
+try { eval ('log((y, x++));'); } catch (e) {}
+try { eval ('log(((x))++);'); } catch (e) {}
+try { eval ('log(((window.x))++);'); } catch (e) {}
+try { eval ('log(((window["x"]))++);'); } catch (e) {}
+try { eval ('log((y, x)++);'); } catch (e) {}
+try { eval ('log((true ? x : y)++);'); } catch (e) {}
+try { eval ('log(x++++);'); } catch (e) {}
+
+</script>
+
+</body>
diff --git a/LayoutTests/fast/js/prefix-syntax-expected.txt b/LayoutTests/fast/js/prefix-syntax-expected.txt
new file mode 100644
index 0000000..156c52c
--- /dev/null
+++ b/LayoutTests/fast/js/prefix-syntax-expected.txt
@@ -0,0 +1,14 @@
+This test checks whether various forms of preincrement expression are allowed. It should print the numbers 1-10 on separate lines, and nothing else (besides this paragraph).
+
+
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+
diff --git a/LayoutTests/fast/js/prefix-syntax.html b/LayoutTests/fast/js/prefix-syntax.html
new file mode 100644
index 0000000..afad220
--- /dev/null
+++ b/LayoutTests/fast/js/prefix-syntax.html
@@ -0,0 +1,38 @@
+<body>
+<p>
+This test checks whether various forms of preincrement expression are
+allowed. It should print the numbers 1-10 on separate lines, and
+nothing else (besides this paragraph).
+<p>
+<hr>
+<pre id="console">
+</pre>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function log(s)
+{
+    document.getElementById('console').innerHTML += s + '<br>';
+}
+
+var x = 0;
+var y = 0;
+
+try { eval ('log(++x);'); } catch (e) {}
+try { eval ('log(++window.x);'); } catch (e) {}
+try { eval ('log(++window["x"]);'); } catch (e) {}
+try { eval ('log(++(x));'); } catch (e) {}
+try { eval ('log(++(window.x));'); } catch (e) {}
+try { eval ('log(++(window["x"]));'); } catch (e) {}
+try { eval ('log((y, ++x));'); } catch (e) {}
+try { eval ('log(++((x)));'); } catch (e) {}
+try { eval ('log(++((window.x)));'); } catch (e) {}
+try { eval ('log(++((window["x"])));'); } catch (e) {}
+try { eval ('log(++(y, x));'); } catch (e) {}
+try { eval ('log(++(true ? x : y));'); } catch (e) {}
+try { eval ('log(++++x);'); } catch (e) {}
+
+</script>
+
+</body>
diff --git a/LayoutTests/fast/js/typeof-syntax-expected.txt b/LayoutTests/fast/js/typeof-syntax-expected.txt
new file mode 100644
index 0000000..efbb605
--- /dev/null
+++ b/LayoutTests/fast/js/typeof-syntax-expected.txt
@@ -0,0 +1,21 @@
+This test checks whether various forms of typeof expression are allowed. It should printf number 12 times and unknown 6 times on separate lines, and nothing else (besides this paragraph). In particular it should not say FAIL.
+
+number
+number
+number
+number
+number
+number
+number
+number
+number
+number
+number
+number
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+
diff --git a/LayoutTests/fast/js/typeof-syntax.html b/LayoutTests/fast/js/typeof-syntax.html
new file mode 100644
index 0000000..432d37e
--- /dev/null
+++ b/LayoutTests/fast/js/typeof-syntax.html
@@ -0,0 +1,45 @@
+<body>
+<p>
+This test checks whether various forms of typeof expression are
+allowed. It should printf number 12 times and unknown 6 times on
+separate lines, and nothing else (besides this paragraph). In
+particular it should not say FAIL.
+</p>
+<hr>
+<pre id="console">
+</pre>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function log(s)
+{
+    document.getElementById('console').innerHTML += s + '<br>';
+}
+
+var x = 0;
+var y = 0;
+
+try { eval ('log(typeof x);'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof window.x);'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof window["x"]);'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof (x));'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof (window.x));'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof (window["x"]));'); } catch (e) { log("FAIL"); }
+try { eval ('log((y, typeof x));'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof ((x)));'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof ((window.x)));'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof ((window["x"])));'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof (y, x));'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof (true ? x : y));'); } catch (e) { log("FAIL"); }
+
+try { eval ('log(typeof nonexistent)'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof window.nonexistent)'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof window["nonexistent"])'); } catch (e) { log("FAIL");}
+try { eval ('log(typeof (nonexistent))'); } catch (e) { log("FAIL");}
+try { eval ('log(typeof (window.nonexistent))'); } catch (e) { log("FAIL"); }
+try { eval ('log(typeof (window["nonexistent"]))'); } catch (e) { log("FAIL"); }
+
+</script>
+
+</body>
diff --git a/WebCore/ChangeLog-2005-12-19 b/WebCore/ChangeLog-2005-12-19
index f96be3f..175a86a 100644
--- a/WebCore/ChangeLog-2005-12-19
+++ b/WebCore/ChangeLog-2005-12-19
@@ -1,3 +1,16 @@
+2005-09-24  Maciej Stachowiak  <mjs@apple.com>
+
+        - some JavaScript syntax test cases
+
+        * layout-tests/fast/js/delete-syntax-expected.txt: Added.
+        * layout-tests/fast/js/delete-syntax.html: Added.
+        * layout-tests/fast/js/postfix-syntax-expected.txt: Added.
+        * layout-tests/fast/js/postfix-syntax.html: Added.
+        * layout-tests/fast/js/prefix-syntax-expected.txt: Added.
+        * layout-tests/fast/js/prefix-syntax.html: Added.
+        * layout-tests/fast/js/typeof-syntax-expected.txt: Added.
+        * layout-tests/fast/js/typeof-syntax.html: Added.
+
 2005-09-24  Duncan Wilcox  <duncan@mclink.it>
 
         - patch for <http://bugzilla.opendarwin.org/show_bug.cgi?id=4963>