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

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

Issue 2282233002: Add support for parsing, but not capturing, assers in constructor initializer lists (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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
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 e48c4dca05c43a1a360aa3af00b602df058c92f9..72d36496457ea346ad1ff3db35f8e29311bc7453 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -7094,6 +7094,15 @@ void''');
// null, null, null, null, null, null}, "");
}
+ void test_parseConstructor_assert() {
+ ClassMember classMember = parse("parseClassMember", <Object>["C"],
+ "C(x, y) : _x = x, assert (x < y), _y = y;");
+ expect(classMember, new isInstanceOf<ConstructorDeclaration>());
+ ConstructorDeclaration constructor = classMember as ConstructorDeclaration;
+ NodeList<ConstructorInitializer> initializers = constructor.initializers;
+ expect(initializers, hasLength(2));
+ }
+
void test_parseConstructor_with_pseudo_function_literal() {
// "(b) {}" should not be misinterpreted as a function literal even though
// it looks like one.
« pkg/analyzer/lib/src/generated/parser.dart ('K') | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698