Update all the tests, and include new file.
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2013 22:45:37 +0000 (22:45 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2013 22:45:37 +0000 (22:45 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156920 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/js/script-tests/basic-for-of.js [new file with mode: 0644]
LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T4-expected.txt
LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T5-expected.txt
LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T6-expected.txt
LayoutTests/sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T7-expected.txt

index 71ecd68..6ae60da 100644 (file)
@@ -1,3 +1,13 @@
+2013-10-04  Oliver Hunt  <oliver@apple.com>
+
+        Update all the tests, and include new file.
+        
+        * js/script-tests/basic-for-of.js: Added.
+        * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T4-expected.txt:
+        * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T5-expected.txt:
+        * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T6-expected.txt:
+        * sputnik/Conformance/07_Lexical_Conventions/7.9_Automatic_Semicolon_Insertion/S7.9_A6.3_T7-expected.txt:
+
 2013-10-04  Bear Travis  <betravis@adobe.com>
 
         [CSS Shapes] Basic shapes should be animatable for shape-outside
diff --git a/LayoutTests/js/script-tests/basic-for-of.js b/LayoutTests/js/script-tests/basic-for-of.js
new file mode 100644 (file)
index 0000000..5f22f33
--- /dev/null
@@ -0,0 +1,62 @@
+description(
+"This test checks the behavior of the for-of construct."
+);
+
+
+var testArray = [1,2,3,4,5,6]
+
+var i = 0;
+for (var value of testArray.values())
+    shouldBe("value", "testArray[" + i++ + "]")
+
+shouldBe("testArray.length", String(i))
+
+var i = 0;
+for (var value of testArray)
+    shouldBe("value", "testArray[" + i++ + "]")
+
+shouldBe("testArray.length", String(i))
+
+var i = 0;
+for (var key of testArray.keys())
+    shouldBe("key", "" + i++ )
+
+shouldBe("testArray.length", String(i))
+
+var i = 0;
+for (this.prop1 of testArray.keys())
+    shouldBe("this.prop1", "" + i++ )
+
+shouldBe("testArray.length", String(i))
+
+var i = 0;
+var prop2 = "asdf"
+for (this[prop2] of testArray.keys())
+    shouldBe("this[prop2]", "" + i++ )
+
+shouldBe("testArray.length", String(i))
+
+
+var i = 0;
+for (var [key, value] of testArray.entries()) {
+    shouldBe("key", "" + i++)
+    shouldBe("value", "" + i)
+}
+
+shouldBe("testArray.length", String(i))
+
+var i = 0;
+for (var [key, value] of testArray.entries()) {
+    shouldBe("value", "testArray[key]")
+    shouldBe("key", "i")
+    i++
+    if (i % 2 == 0)
+        testArray[i] *= 2;
+    if (i < 4)
+        testArray.push(testArray.length)
+    if (i == 4)
+        delete testArray[4]
+    if (i == 5)
+        testArray[4] = 5
+}
+shouldBe("testArray.length", String(i))