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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java

Issue 15758006: Ensure that 'throw' has expression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/ErrorParserTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
index 46f5d6aad73664c59ed9e867207c9ad0f841dcc9..bff26bda7989419c98943de5a8194dad1103b54a 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/parser/Parser.java
@@ -4841,10 +4841,8 @@ public class Parser {
private Expression parseThrowExpression() {
Token keyword = expect(Keyword.THROW);
if (matches(TokenType.SEMICOLON) || matches(TokenType.CLOSE_PAREN)) {
- // TODO(brianwilkerson) Uncomment the lines below once 'rethrow' is supported everywhere.
-// reportError(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, currentToken);
-// return new ThrowExpression(keyword, createSyntheticIdentifier());
- return new ThrowExpression(keyword, null);
+ reportError(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, currentToken);
+ return new ThrowExpression(keyword, createSyntheticIdentifier());
}
Expression expression = parseExpression();
return new ThrowExpression(keyword, expression);
@@ -4863,10 +4861,8 @@ public class Parser {
private Expression parseThrowExpressionWithoutCascade() {
Token keyword = expect(Keyword.THROW);
if (matches(TokenType.SEMICOLON) || matches(TokenType.CLOSE_PAREN)) {
- // TODO(brianwilkerson) Uncomment the lines below once 'rethrow' is supported everywhere.
-// reportError(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, currentToken);
-// return new ThrowExpression(keyword, createSyntheticIdentifier());
- return new ThrowExpression(keyword, null);
+ reportError(ParserErrorCode.MISSING_EXPRESSION_IN_THROW, currentToken);
+ return new ThrowExpression(keyword, createSyntheticIdentifier());
}
Expression expression = parseExpressionWithoutCascade();
return new ThrowExpression(keyword, expression);
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/parser/ErrorParserTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698