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

Unified Diff: test/cctest/compiler/test-run-jsbranches.cc

Issue 502043002: Fix continue statements within for-in loops. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/compiler/test-run-jsbranches.cc
diff --git a/test/cctest/compiler/test-run-jsbranches.cc b/test/cctest/compiler/test-run-jsbranches.cc
index 2eb4fa6d0f758763672a50d743ef72382c0e4807..df2fcdcb6d68c5573a175e95eac8d5062a52b6e2 100644
--- a/test/cctest/compiler/test-run-jsbranches.cc
+++ b/test/cctest/compiler/test-run-jsbranches.cc
@@ -148,6 +148,26 @@ TEST(ForInStatement) {
}
+TEST(ForInContinueStatement) {
+ const char* src =
+ "(function(a,b) {"
+ " var r = '-';"
+ " for (var x in a) {"
+ " r += 'A-';"
+ " if (b) continue;"
+ " r += 'B-';"
+ " }"
+ " return r;"
+ "})";
+ FunctionTester T(src);
+
+ T.CheckCall(T.Val("-A-B-"), T.NewObject("({x:1})"), T.false_value());
+ T.CheckCall(T.Val("-A-B-A-B-"), T.NewObject("({x:1,y:2})"), T.false_value());
+ T.CheckCall(T.Val("-A-"), T.NewObject("({x:1})"), T.true_value());
+ T.CheckCall(T.Val("-A-A-"), T.NewObject("({x:1,y:2})"), T.true_value());
+}
+
+
TEST(SwitchStatement) {
const char* src =
"(function(a,b) {"
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698