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 34c4c5303fb8f326efb6bdbb15f55dc940694ee3..8ec5fb0fa7b24f3522bfd4f46f53f1e1fbd91c5a 100644 |
--- a/test/cctest/test-ast-expression-visitor.cc |
+++ b/test/cctest/test-ast-expression-visitor.cc |
@@ -273,6 +273,33 @@ TEST(VisitExpressions) { |
} |
+TEST(VisitConditional) { |
+ v8::V8::Initialize(); |
+ HandleAndZoneScope handles; |
+ ZoneVector<ExpressionTypeEntry> types(handles.main_zone()); |
+ // Check that traversing the ternary operator works. |
+ const char test_function[] = |
+ "function foo() {\n" |
+ " var a, b, c;\n" |
+ " var x = a ? b : c;\n" |
+ "}\n"; |
+ CollectTypes(&handles, test_function, &types); |
+ CHECK_TYPES_BEGIN { |
+ CHECK_EXPR(FunctionLiteral, Bounds::Unbounded()) { |
+ CHECK_EXPR(Assignment, Bounds::Unbounded()) { |
+ CHECK_VAR(x, Bounds::Unbounded()); |
+ CHECK_EXPR(Conditional, Bounds::Unbounded()) { |
+ CHECK_VAR(a, Bounds::Unbounded()); |
+ CHECK_VAR(b, Bounds::Unbounded()); |
+ CHECK_VAR(c, Bounds::Unbounded()); |
+ } |
+ } |
+ } |
+ } |
+ CHECK_TYPES_END |
+} |
+ |
+ |
TEST(VisitEmptyForStatment) { |
v8::V8::Initialize(); |
HandleAndZoneScope handles; |