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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParser.java

Issue 11533010: Issue 6710. Report error for function libteral with return type and name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/parser/DartParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index 91a7a095e565db6a71cf81d9bb69410d442cb0a4..129eb6a45e704b42c75b9775166495a7e48ccbb7 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -3570,6 +3570,11 @@ public class DartParser extends CompletionHooksParserBase {
rollback();
return null;
}
+ if (function != null && function.getReturnTypeNode() != null) {
+ reportError(function.getReturnTypeNode(), ParserErrorCode.DEPRECATED_FUNCTION_LITERAL);
+ } else if (namePtr[0] != null) {
+ reportError(namePtr[0], ParserErrorCode.DEPRECATED_FUNCTION_LITERAL);
+ }
return done(new DartFunctionExpression(namePtr[0], doneWithoutConsuming(function), false));
}
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/parser/ParserErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698