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 f4c1028ab2b16c932820a4a609c6b06c53373cf9..448552c914d717e2b1469b7a99c98c89dce2b737 100644 |
--- a/test/cctest/test-ast-expression-visitor.cc |
+++ b/test/cctest/test-ast-expression-visitor.cc |
@@ -51,7 +51,8 @@ static void CollectTypes(HandleAndZoneScope* handles, const char* source, |
TEST(VisitExpressions) { |
v8::V8::Initialize(); |
HandleAndZoneScope handles; |
- ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); |
+ Zone* zone = handles.main_zone(); |
+ ZoneVector<ExpressionTypeEntry> types(zone); |
titzer
2015/08/31 18:08:53
You can put this subexpression back in now. (and b
bradn
2015/08/31 18:34:59
Done.
|
const char test_function[] = |
"function GeometricMean(stdlib, foreign, buffer) {\n" |
" \"use asm\";\n" |
@@ -273,7 +274,8 @@ TEST(VisitExpressions) { |
TEST(VisitEmptyForStatment) { |
v8::V8::Initialize(); |
HandleAndZoneScope handles; |
- ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); |
+ Zone* zone = handles.main_zone(); |
+ ZoneVector<ExpressionTypeEntry> types(zone); |
// Check that traversing an empty for statement works. |
const char test_function[] = |
"function foo() {\n" |
@@ -290,7 +292,8 @@ TEST(VisitEmptyForStatment) { |
TEST(VisitSwitchStatment) { |
v8::V8::Initialize(); |
HandleAndZoneScope handles; |
- ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); |
+ Zone* zone = handles.main_zone(); |
+ ZoneVector<ExpressionTypeEntry> types(zone); |
// Check that traversing a switch with a default works. |
const char test_function[] = |
"function foo() {\n" |
@@ -315,7 +318,8 @@ TEST(VisitSwitchStatment) { |
TEST(VisitThrow) { |
v8::V8::Initialize(); |
HandleAndZoneScope handles; |
- ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); |
+ Zone* zone = handles.main_zone(); |
+ ZoneVector<ExpressionTypeEntry> types(zone); |
// Check that traversing an empty for statement works. |
const char test_function[] = |
"function foo() {\n" |
@@ -334,7 +338,8 @@ TEST(VisitThrow) { |
TEST(VisitYield) { |
v8::V8::Initialize(); |
HandleAndZoneScope handles; |
- ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); |
+ Zone* zone = handles.main_zone(); |
+ ZoneVector<ExpressionTypeEntry> types(zone); |
// Check that traversing an empty for statement works. |
const char test_function[] = |
"function* foo() {\n" |
@@ -365,3 +370,27 @@ TEST(VisitYield) { |
} |
CHECK_TYPES_END |
} |
+ |
+ |
+TEST(VisitSkipping) { |
+ v8::V8::Initialize(); |
+ HandleAndZoneScope handles; |
+ Zone* zone = handles.main_zone(); |
+ ZoneVector<ExpressionTypeEntry> types(zone); |
+ // Check that traversing an empty for statement works. |
+ const char test_function[] = |
+ "function foo(x) {\n" |
+ " return (x + x) + 1;\n" |
+ "}\n"; |
+ CollectTypes(&handles, test_function, &types); |
+ CHECK_TYPES_BEGIN { |
+ CHECK_EXPR(FunctionLiteral, DEFAULT_TYPE) { |
+ CHECK_EXPR(BinaryOperation, DEFAULT_TYPE) { |
+ // Skip x + x |
+ CHECK_SKIP(); |
+ CHECK_EXPR(Literal, DEFAULT_TYPE); |
+ } |
+ } |
+ } |
+ CHECK_TYPES_END |
+} |