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

Side by Side Diff: pkg/compiler/lib/src/resolution/class_hierarchy.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.class_hierarchy; 5 library dart2js.resolution.class_hierarchy;
6 6
7 import '../compiler.dart' show 7 import '../compiler.dart' show
8 Compiler, 8 Compiler;
9 isPrivateName;
10 import '../dart_types.dart'; 9 import '../dart_types.dart';
11 import '../diagnostics/invariant.dart' show 10 import '../diagnostics/invariant.dart' show
12 invariant; 11 invariant;
13 import '../diagnostics/messages.dart' show 12 import '../diagnostics/messages.dart' show
14 MessageKind; 13 MessageKind;
15 import '../elements/elements.dart'; 14 import '../elements/elements.dart';
16 import '../elements/modelx.dart' show 15 import '../elements/modelx.dart' show
17 BaseClassElementX, 16 BaseClassElementX,
18 ErroneousElementX, 17 ErroneousElementX,
19 MixinApplicationElementX, 18 MixinApplicationElementX,
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 399
401 assert(mixinApplication.mixinType == null); 400 assert(mixinApplication.mixinType == null);
402 mixinApplication.mixinType = resolveMixinFor(mixinApplication, mixinType); 401 mixinApplication.mixinType = resolveMixinFor(mixinApplication, mixinType);
403 402
404 // Create forwarding constructors for constructor defined in the superclass 403 // Create forwarding constructors for constructor defined in the superclass
405 // because they are now hidden by the mixin application. 404 // because they are now hidden by the mixin application.
406 superclass.forEachLocalMember((Element member) { 405 superclass.forEachLocalMember((Element member) {
407 if (!member.isGenerativeConstructor) return; 406 if (!member.isGenerativeConstructor) return;
408 FunctionElement forwarder = 407 FunctionElement forwarder =
409 createForwardingConstructor(member, mixinApplication); 408 createForwardingConstructor(member, mixinApplication);
410 if (isPrivateName(member.name) && 409 if (Name.isPrivateName(member.name) &&
411 mixinApplication.library != superclass.library) { 410 mixinApplication.library != superclass.library) {
412 // Do not create a forwarder to the super constructor, because the mixin 411 // Do not create a forwarder to the super constructor, because the mixin
413 // application is in a different library than the constructor in the 412 // application is in a different library than the constructor in the
414 // super class and it is not possible to call that constructor from the 413 // super class and it is not possible to call that constructor from the
415 // library using the mixin application. 414 // library using the mixin application.
416 return; 415 return;
417 } 416 }
418 mixinApplication.addConstructor(forwarder); 417 mixinApplication.addConstructor(forwarder);
419 }); 418 });
420 calculateAllSupertypes(mixinApplication); 419 calculateAllSupertypes(mixinApplication);
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 Identifier selector = node.selector.asIdentifier(); 673 Identifier selector = node.selector.asIdentifier();
675 var e = prefixElement.lookupLocalMember(selector.source); 674 var e = prefixElement.lookupLocalMember(selector.source);
676 if (e == null || !e.impliesType) { 675 if (e == null || !e.impliesType) {
677 error(node.selector, MessageKind.CANNOT_RESOLVE_TYPE, 676 error(node.selector, MessageKind.CANNOT_RESOLVE_TYPE,
678 {'typeName': node.selector}); 677 {'typeName': node.selector});
679 return; 678 return;
680 } 679 }
681 loadSupertype(e, node); 680 loadSupertype(e, node);
682 } 681 }
683 } 682 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_backend.dart ('k') | pkg/compiler/lib/src/resolution/class_members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698