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

Unified Diff: pkg/front_end/lib/src/fasta/builder/member_builder.dart

Issue 2930093002: Complain about external methods with a body. (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | runtime/tests/vm/vm.status » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/builder/member_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/builder/member_builder.dart b/pkg/front_end/lib/src/fasta/builder/member_builder.dart
index f21dff6da0f44ad0f979b1905297e28ded3f83a3..0838145468efdc6721f537d919e13fdcebae6677 100644
--- a/pkg/front_end/lib/src/fasta/builder/member_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/member_builder.dart
@@ -4,7 +4,8 @@
library fasta.member_builder;
-import 'builder.dart' show Builder, ClassBuilder, ModifierBuilder;
+import 'builder.dart'
+ show Builder, ClassBuilder, LibraryBuilder, ModifierBuilder;
abstract class MemberBuilder extends ModifierBuilder {
/// For top-level members, the parent is set correctly during
@@ -28,6 +29,16 @@ abstract class MemberBuilder extends ModifierBuilder {
bool get isRedirectingGenerativeConstructor => false;
+ LibraryBuilder get library {
+ if (parent is LibraryBuilder) {
+ LibraryBuilder library = parent;
+ return library.partOfLibrary ?? library;
+ } else {
+ ClassBuilder cls = parent;
+ return cls.library;
+ }
+ }
+
@override
String get fullNameForErrors => name;
}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | runtime/tests/vm/vm.status » ('J')

Powered by Google App Engine
This is Rietveld 408576698