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

Side by Side Diff: pkg/compiler/lib/src/elements/common.dart

Issue 1856953003: Test closed world model after deserialization. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /// Mixins that implement convenience methods on [Element] subclasses. 5 /// Mixins that implement convenience methods on [Element] subclasses.
6 6
7 library elements.common; 7 library elements.common;
8 8
9 import '../common/names.dart' show 9 import '../common/names.dart' show
10 Names, 10 Names,
11 Uris; 11 Uris;
12 import '../core_types.dart' show
13 CoreClasses;
12 import '../dart_types.dart' show 14 import '../dart_types.dart' show
13 DartType, 15 DartType,
14 InterfaceType, 16 InterfaceType,
15 FunctionType; 17 FunctionType;
16 import '../util/util.dart' show 18 import '../util/util.dart' show
17 Link; 19 Link;
18 20
19 import 'elements.dart'; 21 import 'elements.dart';
20 22
21 abstract class ElementCommon implements Element { 23 abstract class ElementCommon implements Element {
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 return false; 425 return false;
424 } 426 }
425 427
426 @override 428 @override
427 bool implementsInterface(ClassElement intrface) { 429 bool implementsInterface(ClassElement intrface) {
428 return this != intrface && 430 return this != intrface &&
429 allSupertypesAndSelf.asInstanceOf(intrface) != null; 431 allSupertypesAndSelf.asInstanceOf(intrface) != null;
430 } 432 }
431 433
432 @override 434 @override
435 bool implementsFunction(CoreClasses coreClasses) {
436 return asInstanceOf(coreClasses.functionClass) != null ||
437 callType != null;
438 }
439
440 @override
433 bool isSubclassOf(ClassElement cls) { 441 bool isSubclassOf(ClassElement cls) {
434 // Use [declaration] for both [this] and [cls], because 442 // Use [declaration] for both [this] and [cls], because
435 // declaration classes hold the superclass hierarchy. 443 // declaration classes hold the superclass hierarchy.
436 cls = cls.declaration; 444 cls = cls.declaration;
437 for (ClassElement s = declaration; s != null; s = s.superclass) { 445 for (ClassElement s = declaration; s != null; s = s.superclass) {
438 if (identical(s, cls)) return true; 446 if (identical(s, cls)) return true;
439 } 447 }
440 return false; 448 return false;
441 } 449 }
442 450
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 545 }
538 546
539 @override 547 @override
540 void forEachLocalMember(void f(Element member)) { 548 void forEachLocalMember(void f(Element member)) {
541 constructors.forEach(f); 549 constructors.forEach(f);
542 if (mixin != null) mixin.forEachLocalMember((Element mixedInElement) { 550 if (mixin != null) mixin.forEachLocalMember((Element mixedInElement) {
543 if (mixedInElement.isInstanceMember) f(mixedInElement); 551 if (mixedInElement.isInstanceMember) f(mixedInElement);
544 }); 552 });
545 } 553 }
546 } 554 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698