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

Side by Side Diff: pkg/compiler/lib/src/resolution/class_members.dart

Issue 1313893004: Move isPrivateName and isPublicName to Name. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.resolution.compute_members; 5 library dart2js.resolution.compute_members;
6 6
7 import '../common/names.dart' show 7 import '../common/names.dart' show
8 Identifiers; 8 Identifiers;
9 import '../compiler.dart' show 9 import '../compiler.dart' show
10 Compiler, 10 Compiler;
11 isPrivateName;
12 import '../dart_types.dart'; 11 import '../dart_types.dart';
13 import '../diagnostics/invariant.dart' show 12 import '../diagnostics/invariant.dart' show
14 invariant; 13 invariant;
15 import '../diagnostics/messages.dart' show 14 import '../diagnostics/messages.dart' show
16 MessageKind; 15 MessageKind;
17 import '../elements/elements.dart' show 16 import '../elements/elements.dart' show
18 ClassElement, 17 ClassElement,
19 Element, 18 Element,
20 LibraryElement, 19 LibraryElement,
21 Member, 20 Member,
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 computedMemberNames, classMembers, interfaceMembers); 831 computedMemberNames, classMembers, interfaceMembers);
833 } 832 }
834 833
835 static Iterable<String> _EMPTY_MEMBERS_NAMES = const <String>[]; 834 static Iterable<String> _EMPTY_MEMBERS_NAMES = const <String>[];
836 835
837 /// Compute the members by the name [name] for this class. [names] collects 836 /// Compute the members by the name [name] for this class. [names] collects
838 /// the set of possible variations of [name], including getter, setter and 837 /// the set of possible variations of [name], including getter, setter and
839 /// and private names. 838 /// and private names.
840 void computeClassMember(Compiler compiler, String name, Setlet<Name> names) { 839 void computeClassMember(Compiler compiler, String name, Setlet<Name> names) {
841 if (isMemberComputed(name)) return; 840 if (isMemberComputed(name)) return;
842 if (isPrivateName(name)) { 841 if (Name.isPrivateName(name)) {
843 names..add(new Name(name, library)) 842 names..add(new Name(name, library))
844 ..add(new Name(name, library, isSetter: true)); 843 ..add(new Name(name, library, isSetter: true));
845 } 844 }
846 MembersCreator creator = _prepareCreator(compiler); 845 MembersCreator creator = _prepareCreator(compiler);
847 creator.computeMembersByName(name, names); 846 creator.computeMembersByName(name, names);
848 if (computedMemberNames == null) { 847 if (computedMemberNames == null) {
849 computedMemberNames = _EMPTY_MEMBERS_NAMES; 848 computedMemberNames = _EMPTY_MEMBERS_NAMES;
850 } 849 }
851 if (name != Identifiers.call) { 850 if (name != Identifiers.call) {
852 Setlet<String> set; 851 Setlet<String> set;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 message: "Members have not been fully computed for $this.")); 908 message: "Members have not been fully computed for $this."));
910 if (interfaceMembersAreClassMembers) { 909 if (interfaceMembersAreClassMembers) {
911 classMembers.forEach((_, member) { 910 classMembers.forEach((_, member) {
912 if (!member.isStatic) f(member); 911 if (!member.isStatic) f(member);
913 }); 912 });
914 } else { 913 } else {
915 interfaceMembers.forEach((_, member) => f(member)); 914 interfaceMembers.forEach((_, member) => f(member));
916 } 915 }
917 } 916 }
918 } 917 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_hierarchy.dart ('k') | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698