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

Unified Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 2803113002: Fix for parsing named factory constructors with Fasta. (Closed)
Patch Set: Restore toAnalyzerToken() invocation. Created 3 years, 8 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 | « pkg/analyzer/lib/src/fasta/ast_builder.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 2e7a6b7e20d827e9bb15ebeac3f66bd970ae51e4..bf816452f190dbc80bccdaec47b7cb314677022f 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -1118,6 +1118,27 @@ abstract class ClassMemberParserTestMixin implements AbstractParserTestCase {
expect(assertInitializer.message, isNull);
}
+ void test_parseConstructor_factory_named() {
+ createParser('factory C.foo() => null;');
+ var constructor = parser.parseClassMember('C') as ConstructorDeclaration;
+ assertNoErrors();
+ expect(constructor, isNotNull);
+ expect(constructor.externalKeyword, isNull);
+ expect(constructor.constKeyword, isNull);
+ expect(constructor.factoryKeyword, isNotNull);
+ expect(constructor.returnType.name, 'C');
+ _assertIsDeclarationName(constructor.returnType, false);
+ expect(constructor.period.type, TokenType.PERIOD);
+ expect(constructor.name.name, 'foo');
+ _assertIsDeclarationName(constructor.name);
+ expect(constructor.parameters, isNotNull);
+ expect(constructor.parameters.parameters, isEmpty);
+ expect(constructor.separator, isNull);
+ expect(constructor.initializers, isEmpty);
+ expect(constructor.redirectedConstructor, isNull);
+ expect(constructor.body, new isInstanceOf<ExpressionFunctionBody>());
+ }
+
void test_parseConstructor_initializers_field() {
createParser('C(x, y) : _x = x, this._y = y;');
ClassMember member = parser.parseClassMember('C');
« no previous file with comments | « pkg/analyzer/lib/src/fasta/ast_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698