Stop reporting error when not parsing function bodies (issue 23460)

R=scheglov@google.com

Review URL: https://codereview.chromium.org//1145733002
This commit is contained in:
Brian Wilkerson 2015-05-18 10:43:53 -07:00
parent 1a3e349409
commit c4a723465b

View file

@ -5066,7 +5066,9 @@ class Parser {
externalKeyword == null) {
_reportErrorForToken(ParserErrorCode.CONST_FACTORY, factoryKeyword);
} else if (body is EmptyFunctionBody) {
if (factoryKeyword != null && externalKeyword == null) {
if (factoryKeyword != null &&
externalKeyword == null &&
_parseFunctionBodies) {
_reportErrorForToken(
ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword);
}