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

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

Issue 2797343003: Support for parsing native function bodies with Fasta. (Closed)
Patch Set: Created 3 years, 8 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 | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | 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 e7a3725cd62ef2771e93e018aaee1908822aac24..2e7a6b7e20d827e9bb15ebeac3f66bd970ae51e4 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -784,6 +784,17 @@ abstract class ClassMemberParserTestMixin implements AbstractParserTestCase {
expect(method.body, isNotNull);
}
+ void test_parseClassMember_method_native() {
+ createParser('m() native "str";');
+ var method = parser.parseClassMember('C') as MethodDeclaration;
+ assertNoErrors();
+
+ var body = method.body as NativeFunctionBody;
+ expect(body.nativeKeyword, isNotNull);
+ expect(body.stringLiteral, isNotNull);
+ expect(body.semicolon, isNotNull);
+ }
+
void test_parseClassMember_method_operator_noType() {
createParser('operator() {}');
ClassMember member = parser.parseClassMember('C');
@@ -11056,18 +11067,6 @@ void''');
expect(body.isSynchronous, isFalse);
}
- void test_parseFunctionBody_nativeFunctionBody() {
- createParser('native "str";');
- FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
- expectNotNullIfNoErrors(functionBody);
- listener.assertNoErrors();
- expect(functionBody, new isInstanceOf<NativeFunctionBody>());
- NativeFunctionBody body = functionBody;
- expect(body.nativeKeyword, isNotNull);
- expect(body.stringLiteral, isNotNull);
- expect(body.semicolon, isNotNull);
- }
-
void test_parseFunctionBody_skip_block() {
ParserTestCase.parseFunctionBodies = false;
createParser('{}');
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698