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

Side by Side Diff: pkg/kernel/lib/ast.dart

Issue 2615193003: Make DirectMethodInvocation a subclass of InvocationExpression. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /// ----------------------------------------------------------------------- 5 /// -----------------------------------------------------------------------
6 /// ERROR HANDLING 6 /// ERROR HANDLING
7 /// ----------------------------------------------------------------------- 7 /// -----------------------------------------------------------------------
8 /// 8 ///
9 /// As a rule of thumb, errors that can be detected statically are handled by 9 /// As a rule of thumb, errors that can be detected statically are handled by
10 /// the frontend, typically by translating the erroneous code into a 'throw' or 10 /// the frontend, typically by translating the erroneous code into a 'throw' or
(...skipping 1484 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 value?.parent = this; 1495 value?.parent = this;
1496 } 1496 }
1497 } 1497 }
1498 1498
1499 accept(ExpressionVisitor v) => v.visitDirectPropertySet(this); 1499 accept(ExpressionVisitor v) => v.visitDirectPropertySet(this);
1500 1500
1501 DartType getStaticType(TypeEnvironment types) => value.getStaticType(types); 1501 DartType getStaticType(TypeEnvironment types) => value.getStaticType(types);
1502 } 1502 }
1503 1503
1504 /// Directly call an instance method, bypassing ordinary dispatch. 1504 /// Directly call an instance method, bypassing ordinary dispatch.
1505 class DirectMethodInvocation extends Expression { 1505 class DirectMethodInvocation extends InvocationExpression {
1506 Expression receiver; 1506 Expression receiver;
1507 Procedure target; 1507 Procedure target;
1508 Arguments arguments; 1508 Arguments arguments;
1509 1509
1510 DirectMethodInvocation(this.receiver, this.target, this.arguments) { 1510 DirectMethodInvocation(this.receiver, this.target, this.arguments) {
1511 receiver?.parent = this; 1511 receiver?.parent = this;
1512 arguments?.parent = this; 1512 arguments?.parent = this;
1513 } 1513 }
1514 1514
1515 Name get name => target?.name;
1516
1515 visitChildren(Visitor v) { 1517 visitChildren(Visitor v) {
1516 receiver?.accept(v); 1518 receiver?.accept(v);
1517 target?.acceptReference(v); 1519 target?.acceptReference(v);
1518 arguments?.accept(v); 1520 arguments?.accept(v);
1519 } 1521 }
1520 1522
1521 transformChildren(Transformer v) { 1523 transformChildren(Transformer v) {
1522 if (receiver != null) { 1524 if (receiver != null) {
1523 receiver = receiver.accept(v); 1525 receiver = receiver.accept(v);
1524 receiver?.parent = this; 1526 receiver?.parent = this;
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after
3644 3646
3645 @override 3647 @override
3646 defaultTreeNode(TreeNode node) { 3648 defaultTreeNode(TreeNode node) {
3647 if (node == child) { 3649 if (node == child) {
3648 return replacement; 3650 return replacement;
3649 } else { 3651 } else {
3650 return node; 3652 return node;
3651 } 3653 }
3652 } 3654 }
3653 } 3655 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698