| OLD | NEW |
| 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 library kernel.transformations.mixin_full_resolution; | 4 library kernel.transformations.mixin_full_resolution; |
| 5 | 5 |
| 6 import '../ast.dart'; | 6 import '../ast.dart'; |
| 7 import '../class_hierarchy.dart'; | 7 import '../class_hierarchy.dart'; |
| 8 import '../clone.dart'; | 8 import '../clone.dart'; |
| 9 import '../core_types.dart'; | 9 import '../core_types.dart'; |
| 10 import '../type_algebra.dart'; | 10 import '../type_algebra.dart'; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 this.hierarchy, this.coreTypes, this.lookupClass); | 172 this.hierarchy, this.coreTypes, this.lookupClass); |
| 173 | 173 |
| 174 TreeNode visit(TreeNode node) => node.accept(this); | 174 TreeNode visit(TreeNode node) => node.accept(this); |
| 175 | 175 |
| 176 visitSuperPropertyGet(SuperPropertyGet node) { | 176 visitSuperPropertyGet(SuperPropertyGet node) { |
| 177 Member target = hierarchy.getDispatchTarget(lookupClass, node.name); | 177 Member target = hierarchy.getDispatchTarget(lookupClass, node.name); |
| 178 if (target != null) { | 178 if (target != null) { |
| 179 return new DirectPropertyGet(new ThisExpression(), target); | 179 return new DirectPropertyGet(new ThisExpression(), target); |
| 180 } else { | 180 } else { |
| 181 return _callNoSuchMethod(node.name.name, new Arguments.empty(), node, | 181 return _callNoSuchMethod(node.name.name, new Arguments.empty(), node, |
| 182 isGetter: true); | 182 isGetter: true, isSuper: true); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 | 185 |
| 186 visitSuperPropertySet(SuperPropertySet node) { | 186 visitSuperPropertySet(SuperPropertySet node) { |
| 187 Member target = | 187 Member target = |
| 188 hierarchy.getDispatchTarget(lookupClass, node.name, setter: true); | 188 hierarchy.getDispatchTarget(lookupClass, node.name, setter: true); |
| 189 if (target != null) { | 189 if (target != null) { |
| 190 return new DirectPropertySet( | 190 return new DirectPropertySet( |
| 191 new ThisExpression(), target, visit(node.value)); | 191 new ThisExpression(), target, visit(node.value)); |
| 192 } else { | 192 } else { |
| 193 // Call has to return right-hand-side. | 193 // Call has to return right-hand-side. |
| 194 VariableDeclaration rightHandSide = | 194 VariableDeclaration rightHandSide = |
| 195 new VariableDeclaration.forValue(visit(node.value)); | 195 new VariableDeclaration.forValue(visit(node.value)); |
| 196 Expression result = _callNoSuchMethod( | 196 Expression result = _callNoSuchMethod( |
| 197 node.name.name, new Arguments([new VariableGet(rightHandSide)]), node, | 197 node.name.name, new Arguments([new VariableGet(rightHandSide)]), node, |
| 198 isSetter: true); | 198 isSetter: true, isSuper: true); |
| 199 VariableDeclaration call = new VariableDeclaration.forValue(result); | 199 VariableDeclaration call = new VariableDeclaration.forValue(result); |
| 200 return new Let( | 200 return new Let( |
| 201 rightHandSide, new Let(call, new VariableGet(rightHandSide))); | 201 rightHandSide, new Let(call, new VariableGet(rightHandSide))); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 visitSuperMethodInvocation(SuperMethodInvocation node) { | 205 visitSuperMethodInvocation(SuperMethodInvocation node) { |
| 206 Member target = hierarchy.getDispatchTarget(lookupClass, node.name); | 206 Member target = hierarchy.getDispatchTarget(lookupClass, node.name); |
| 207 Arguments visitedArguments = visit(node.arguments); | 207 Arguments visitedArguments = visit(node.arguments); |
| 208 if (target is Procedure && | 208 if (target is Procedure && |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 return null; | 360 return null; |
| 361 } | 361 } |
| 362 } | 362 } |
| 363 | 363 |
| 364 throw new Exception( | 364 throw new Exception( |
| 365 'Could not find a generative constructor named "${constructor.name}" ' | 365 'Could not find a generative constructor named "${constructor.name}" ' |
| 366 'in lookup class "${lookupClass.name}"!'); | 366 'in lookup class "${lookupClass.name}"!'); |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 } | 369 } |
| OLD | NEW |