| 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 264cb69154d76ddd3b0d5672c2e5133bbd3c21f6..6a9f678e653adcd369f30b588206f8c2207c230a 100644
|
| --- a/pkg/analyzer/test/generated/parser_test.dart
|
| +++ b/pkg/analyzer/test/generated/parser_test.dart
|
| @@ -1092,6 +1092,33 @@ abstract class ClassMemberParserTestMixin implements AbstractParserTestCase {
|
| expect(constructor.body, new isInstanceOf<EmptyFunctionBody>());
|
| }
|
|
|
| + void test_parseConstructor_initializers_field() {
|
| + createParser('C(x, y) : _x = x, this._y = y;');
|
| + ClassMember member = parser.parseClassMember('C');
|
| + expect(member, isNotNull);
|
| + assertNoErrors();
|
| + expect(member, new isInstanceOf<ConstructorDeclaration>());
|
| + ConstructorDeclaration constructor = member as ConstructorDeclaration;
|
| + NodeList<ConstructorInitializer> initializers = constructor.initializers;
|
| + expect(initializers, hasLength(2));
|
| +
|
| + {
|
| + var initializer = initializers[0] as ConstructorFieldInitializer;
|
| + expect(initializer.thisKeyword, isNull);
|
| + expect(initializer.period, isNull);
|
| + expect(initializer.fieldName.name, '_x');
|
| + expect(initializer.expression, isNotNull);
|
| + }
|
| +
|
| + {
|
| + var initializer = initializers[1] as ConstructorFieldInitializer;
|
| + expect(initializer.thisKeyword, isNotNull);
|
| + expect(initializer.period, isNotNull);
|
| + expect(initializer.fieldName.name, '_y');
|
| + expect(initializer.expression, isNotNull);
|
| + }
|
| + }
|
| +
|
| void test_parseConstructor_assert() {
|
| enableAssertInitializer = true;
|
| createParser('C(x, y) : _x = x, assert (x < y), _y = y;');
|
|
|