OLD | NEW |
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 import 'common/names.dart' show Identifiers; | 5 import 'common/names.dart' show Identifiers; |
6 import 'common/resolution.dart' show ParsingContext, Resolution; | 6 import 'common/resolution.dart' show ParsingContext, Resolution; |
7 import 'common/tasks.dart' show CompilerTask, Measurer; | 7 import 'common/tasks.dart' show CompilerTask, Measurer; |
8 import 'common.dart'; | 8 import 'common.dart'; |
9 import 'compiler.dart' show Compiler; | 9 import 'compiler.dart' show Compiler; |
10 import 'constants/expressions.dart'; | 10 import 'constants/expressions.dart'; |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
608 @override | 608 @override |
609 bool get hasConstant => false; | 609 bool get hasConstant => false; |
610 | 610 |
611 @override | 611 @override |
612 ConstantExpression get constant => null; | 612 ConstantExpression get constant => null; |
613 } | 613 } |
614 | 614 |
615 /// A local variable used encode the direct (uncaptured) references to [this]. | 615 /// A local variable used encode the direct (uncaptured) references to [this]. |
616 class ThisLocal extends Local { | 616 class ThisLocal extends Local { |
617 final MemberEntity memberContext; | 617 final MemberEntity memberContext; |
618 final hashCode = ElementX.newHashCode(); | |
619 | 618 |
620 ThisLocal(this.memberContext); | 619 ThisLocal(this.memberContext); |
621 | 620 |
622 Entity get executableContext => memberContext; | 621 Entity get executableContext => memberContext; |
623 | 622 |
624 String get name => 'this'; | 623 String get name => 'this'; |
625 | 624 |
626 ClassEntity get enclosingClass => memberContext.enclosingClass; | 625 ClassEntity get enclosingClass => memberContext.enclosingClass; |
| 626 |
| 627 bool operator ==(other) { |
| 628 return other is ThisLocal && |
| 629 other.name == name && |
| 630 other.memberContext == memberContext && |
| 631 other.enclosingClass == enclosingClass; |
| 632 } |
| 633 |
| 634 int get hashCode => memberContext.hashCode + enclosingClass.hashCode; |
627 } | 635 } |
628 | 636 |
629 /// Call method of a closure class. | 637 /// Call method of a closure class. |
630 // ignore: STRONG_MODE_INVALID_METHOD_OVERRIDE_FROM_BASE | 638 // ignore: STRONG_MODE_INVALID_METHOD_OVERRIDE_FROM_BASE |
631 class SynthesizedCallMethodElementX extends BaseFunctionElementX | 639 class SynthesizedCallMethodElementX extends BaseFunctionElementX |
632 implements MethodElement { | 640 implements MethodElement { |
633 final LocalFunctionElement expression; | 641 final LocalFunctionElement expression; |
634 final FunctionExpression node; | 642 final FunctionExpression node; |
635 final TreeElements treeElements; | 643 final TreeElements treeElements; |
636 | 644 |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1552 /// | 1560 /// |
1553 /// Move the below classes to a JS model eventually. | 1561 /// Move the below classes to a JS model eventually. |
1554 /// | 1562 /// |
1555 abstract class JSEntity implements MemberEntity { | 1563 abstract class JSEntity implements MemberEntity { |
1556 Local get declaredEntity; | 1564 Local get declaredEntity; |
1557 } | 1565 } |
1558 | 1566 |
1559 abstract class PrivatelyNamedJSEntity implements JSEntity { | 1567 abstract class PrivatelyNamedJSEntity implements JSEntity { |
1560 Entity get rootOfScope; | 1568 Entity get rootOfScope; |
1561 } | 1569 } |
OLD | NEW |