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

Unified Diff: test/cctest/test-ast-expression-visitor.cc

Issue 1634553002: Fix bug where generators got closed prematurely. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 4 years, 11 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/parsing/parser.cc ('k') | test/mjsunit/es6/generators-states.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-ast-expression-visitor.cc
diff --git a/test/cctest/test-ast-expression-visitor.cc b/test/cctest/test-ast-expression-visitor.cc
index b6cca6ac386f2f50483f23e78934933d7097f099..a40f87ccfeb5541fe4c6aa12a0e5b8876dfe3b08 100644
--- a/test/cctest/test-ast-expression-visitor.cc
+++ b/test/cctest/test-ast-expression-visitor.cc
@@ -343,7 +343,6 @@ TEST(VisitThrow) {
v8::V8::Initialize();
HandleAndZoneScope handles;
ZoneVector<ExpressionTypeEntry> types(handles.main_zone());
- // Check that traversing an empty for statement works.
const char test_function[] =
"function foo() {\n"
" throw 123;\n"
@@ -364,7 +363,6 @@ TEST(VisitYield) {
v8::V8::Initialize();
HandleAndZoneScope handles;
ZoneVector<ExpressionTypeEntry> types(handles.main_zone());
- // Check that traversing an empty for statement works.
const char test_function[] =
"function* foo() {\n"
" yield 123;\n"
@@ -372,7 +370,7 @@ TEST(VisitYield) {
CollectTypes(&handles, test_function, &types);
CHECK_TYPES_BEGIN {
CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) {
- // Generator function yields generator on entry.
+ // Implicit initial yield
CHECK_EXPR(Yield, Bounds::Unbounded()) {
CHECK_VAR(.generator_object, Bounds::Unbounded());
CHECK_EXPR(Assignment, Bounds::Unbounded()) {
@@ -380,16 +378,20 @@ TEST(VisitYield) {
CHECK_EXPR(CallRuntime, Bounds::Unbounded());
}
}
- // Then yields undefined.
+ // Explicit yield
CHECK_EXPR(Yield, Bounds::Unbounded()) {
CHECK_VAR(.generator_object, Bounds::Unbounded());
CHECK_EXPR(Literal, Bounds::Unbounded());
}
- // Then yields 123.
+ // Implicit final yield
CHECK_EXPR(Yield, Bounds::Unbounded()) {
CHECK_VAR(.generator_object, Bounds::Unbounded());
CHECK_EXPR(Literal, Bounds::Unbounded());
}
+ // Implicit finally clause
+ CHECK_EXPR(CallRuntime, Bounds::Unbounded()) {
+ CHECK_VAR(.generator_object, Bounds::Unbounded());
+ }
}
}
CHECK_TYPES_END
@@ -400,7 +402,6 @@ TEST(VisitSkipping) {
v8::V8::Initialize();
HandleAndZoneScope handles;
ZoneVector<ExpressionTypeEntry> types(handles.main_zone());
- // Check that traversing an empty for statement works.
const char test_function[] =
"function foo(x) {\n"
" return (x + x) + 1;\n"
« no previous file with comments | « src/parsing/parser.cc ('k') | test/mjsunit/es6/generators-states.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698