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

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

Issue 2742283003: Fix for parsing named constructors with Fasta. (Closed)
Patch Set: Created 3 years, 9 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 | pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart » ('j') | 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 638c5c323d861259e8502bd5ffe704305b47d4b6..76249a4b8f8e9313a1823c459959baa80b3e4ddf 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -1064,6 +1064,25 @@ abstract class ClassMemberParserTestMixin implements AbstractParserTestCase {
expect(body.semicolon, isNotNull);
}
+ void test_parseConstructor_named() {
+ createParser('C.foo();');
+ var constructor = parser.parseClassMember('C') as ConstructorDeclaration;
+ assertNoErrors();
+ expect(constructor, isNotNull);
+ expect(constructor.externalKeyword, isNull);
+ expect(constructor.constKeyword, isNull);
+ expect(constructor.factoryKeyword, isNull);
+ expect(constructor.returnType.name, 'C');
+ expect(constructor.period.type, TokenType.PERIOD);
+ expect(constructor.name.name, 'foo');
+ 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<EmptyFunctionBody>());
+ }
+
void test_parseClassMember_redirectingFactory_nonConst() {
createParser('factory C() = B;');
ClassMember member = parser.parseClassMember('C');
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/analyzer/ast_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698