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

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

Issue 3003263002: add support for native methods in class
Patch Set: update listeners Created 3 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 589b785bc1a09b9aafdca860fc4f7ee221d3bcae..5873b9095b15f9eb2583f5edfd9ff37b5b4759d1 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -940,11 +940,18 @@ void Function<A>(core.List<core.int> x) m() => null;
void test_parseClassMember_method_native() {
createParser('m() native "str";');
var method = parser.parseClassMember('C') as MethodDeclaration;
- assertNoErrors();
+ if (!allowNativeClause) {
+ assertErrorsWithCodes([
+ ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION,
+ ]);
+ } else {
+ assertNoErrors();
+ }
var body = method.body as NativeFunctionBody;
expect(body.nativeKeyword, isNotNull);
expect(body.stringLiteral, isNotNull);
+ expect(body.stringLiteral?.stringValue, "str");
expect(body.semicolon, isNotNull);
}

Powered by Google App Engine
This is Rietveld 408576698