Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 53e7f67ab6267bc746d8824f94d430868f8b741b..b923a7f1c10b1e92422a38aa573f94a37f70dfb6 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -1,4 +1,4 @@ |
-// Copyright 2006-2008 the V8 project authors. All rights reserved. |
+// Copyright 2010 the V8 project authors. All rights reserved. |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
// met: |
@@ -2645,6 +2645,7 @@ DoWhileStatement* Parser::ParseDoWhileStatement(ZoneStringList* labels, |
} |
Expression* cond = ParseExpression(true, CHECK_OK); |
+ if (cond != NULL) cond->set_is_loop_condition(true); |
Expect(Token::RPAREN, CHECK_OK); |
// Allow do-statements to be terminated with and without |
@@ -2671,6 +2672,7 @@ WhileStatement* Parser::ParseWhileStatement(ZoneStringList* labels, bool* ok) { |
Expect(Token::WHILE, CHECK_OK); |
Expect(Token::LPAREN, CHECK_OK); |
Expression* cond = ParseExpression(true, CHECK_OK); |
+ if (cond != NULL) cond->set_is_loop_condition(true); |
Expect(Token::RPAREN, CHECK_OK); |
Statement* body = ParseStatement(NULL, CHECK_OK); |
@@ -2764,9 +2766,7 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) { |
Expression* cond = NULL; |
if (peek() != Token::SEMICOLON) { |
cond = ParseExpression(true, CHECK_OK); |
- if (cond && cond->AsCompareOperation()) { |
- cond->AsCompareOperation()->set_is_for_loop_condition(); |
- } |
+ if (cond != NULL) cond->set_is_loop_condition(true); |
} |
Expect(Token::SEMICOLON, CHECK_OK); |