| 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);
|
| }
|
|
|
|
|