Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Unified Diff: test/webkit/fast/js/kde/iteration.js

Issue 21070002: Migrate more tests from blink repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/webkit/fast/js/kde/iteration.js
diff --git a/test/webkit/dfg-side-effect-assignment-osr-exit.js b/test/webkit/fast/js/kde/iteration.js
similarity index 61%
copy from test/webkit/dfg-side-effect-assignment-osr-exit.js
copy to test/webkit/fast/js/kde/iteration.js
index 696393fbf775d6a0b70e380f828e3444f0819f6b..7004be054b2668e6f596b9d845afae1e5952842e 100644
--- a/test/webkit/dfg-side-effect-assignment-osr-exit.js
+++ b/test/webkit/fast/js/kde/iteration.js
@@ -21,27 +21,59 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-description(
-"Tests what happens if we OSR exit on an assignment that was part of a side-effecting bytecode instruction."
-);
-
-function foo(f) {
- var x = f();
- if (x)
- return x;
+description("KDE JS Test");
+// 12.6.1
+var count = 0;
+do {
+ count++;
+} while (count < 10);
+shouldBe("count", "10");
+
+count = 0;
+for (var i = 0; i < 10; i++) {
+ if (i == 5)
+ break;
+ count++;
}
+shouldBe("count", "5");
-var count = 0;
-function bar() {
- count++;
- return eval(baz);
+// 12.6.3
+count = 0;
+for (i = 0; i < 10; i++) {
+ count++;
}
+shouldBe("count", "10");
+
+// 12.6.4
+obj = new Object();
+obj.a = 11;
+obj.b = 22;
-var baz = "42";
+properties = "";
+for ( prop in obj )
+ properties += (prop + "=" + obj[prop] + ";");
+
+shouldBe("properties", "'a=11;b=22;'");
+
+// now a test verifying the order. not standardized but common.
+obj.y = 33;
+obj.x = 44;
+properties = "";
+for ( prop in obj )
+ properties += prop;
+// shouldBe("properties", "'abyx'");
+
+arr = new Array;
+arr[0] = 100;
+arr[1] = 101;
+list = "";
+for ( var j in arr ) {
+ list += "[" + j + "]=" + arr[j] + ";";
+}
+shouldBe("list","'[0]=100;[1]=101;'");
-for (var i = 0; i < 500; ++i) {
- if (i == 450)
- baz = "\"stuff\"";
- shouldBe("foo(bar)", baz);
- shouldBe("count", "" + (i + 1));
+list = "";
+for (var a = [1,2,3], length = a.length, i = 0; i < length; i++) {
+ list += a[i];
}
+shouldBe("list", "'123'");
« no previous file with comments | « test/webkit/fast/js/kde/inbuilt_function_proto-expected.txt ('k') | test/webkit/fast/js/kde/iteration-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698