| 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 001de940344aa08579c56cd88a2d71f253c69358..ba3cd83792d81234a530eb0f86e1af975921b10e 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
|
| @@ -3132,6 +3132,8 @@ public class Parser {
|
| * @return the function declaration statement that was parsed
|
| */
|
| private Statement parseFunctionDeclarationStatement() {
|
| + Modifiers modifiers = parseModifiers();
|
| + validateModifiersForFunctionDeclarationStatement(modifiers);
|
| return parseFunctionDeclarationStatement(parseCommentAndMetadata(), parseOptionalReturnType());
|
| }
|
|
|
| @@ -6085,6 +6087,20 @@ public class Parser {
|
| }
|
|
|
| /**
|
| + * Validate that the given set of modifiers is appropriate for a local function.
|
| + *
|
| + * @param modifiers the modifiers being validated
|
| + */
|
| + private void validateModifiersForFunctionDeclarationStatement(Modifiers modifiers) {
|
| + if (modifiers.getAbstractKeyword() != null || modifiers.getConstKeyword() != null
|
| + || modifiers.getExternalKeyword() != null || modifiers.getFactoryKeyword() != null
|
| + || modifiers.getFinalKeyword() != null || modifiers.getStaticKeyword() != null
|
| + || modifiers.getVarKeyword() != null) {
|
| + reportError(ParserErrorCode.LOCAL_FUNCTION_DECLARATION_MODIFIER);
|
| + }
|
| + }
|
| +
|
| + /**
|
| * Validate that the given set of modifiers is appropriate for a getter, setter, or method.
|
| *
|
| * @param modifiers the modifiers being validated
|
|
|