| OLD | NEW |
| 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 part of dart2js.semantics_visitor; | 5 part of dart2js.semantics_visitor; |
| 6 | 6 |
| 7 enum SendStructureKind { | 7 enum SendStructureKind { |
| 8 GET, | 8 GET, |
| 9 SET, | 9 SET, |
| 10 INVOKE, | 10 INVOKE, |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 return new ConstantAccess.typedefTypeLiteral(constant); | 333 return new ConstantAccess.typedefTypeLiteral(constant); |
| 334 case TypeKind.TYPE_VARIABLE: | 334 case TypeKind.TYPE_VARIABLE: |
| 335 return new StaticAccess.typeParameterTypeLiteral(dartType.element); | 335 return new StaticAccess.typeParameterTypeLiteral(dartType.element); |
| 336 case TypeKind.DYNAMIC: | 336 case TypeKind.DYNAMIC: |
| 337 return new ConstantAccess.dynamicTypeLiteral(constant); | 337 return new ConstantAccess.dynamicTypeLiteral(constant); |
| 338 default: | 338 default: |
| 339 return internalError(node, "Unexpected type literal type: $dartType"); | 339 return internalError(node, "Unexpected type literal type: $dartType"); |
| 340 } | 340 } |
| 341 } else if (node.isSuperCall) { | 341 } else if (node.isSuperCall) { |
| 342 if (Elements.isUnresolved(element)) { | 342 if (Elements.isUnresolved(element)) { |
| 343 return new StaticAccess.unresolvedSuper(element); | 343 if (isCompound) { |
| 344 if (Elements.isUnresolved(getter)) { |
| 345 // TODO(johnniwinther): Ensure that [getter] is not null. This |
| 346 // happens in the case of missing super getter. |
| 347 return new CompoundAccessSemantics( |
| 348 CompoundAccessKind.SUPER_UNRESOLVED_GETTER, getter, element); |
| 349 } else { |
| 350 return new CompoundAccessSemantics( |
| 351 CompoundAccessKind.SUPER_UNRESOLVED_SETTER, getter, element); |
| 352 } |
| 353 } else { |
| 354 return new StaticAccess.unresolvedSuper(element); |
| 355 } |
| 344 } else if (isCompound && Elements.isUnresolved(getter)) { | 356 } else if (isCompound && Elements.isUnresolved(getter)) { |
| 345 // TODO(johnniwinther): Ensure that [getter] is not null. This happens | 357 // TODO(johnniwinther): Ensure that [getter] is not null. This happens |
| 346 // in the case of missing super getter. | 358 // in the case of missing super getter. |
| 347 return new StaticAccess.unresolved(getter); | 359 return new CompoundAccessSemantics( |
| 360 CompoundAccessKind.SUPER_UNRESOLVED_GETTER, getter, element); |
| 348 } else if (element.isField) { | 361 } else if (element.isField) { |
| 349 if (getter != null && getter != element) { | 362 if (getter != null && getter != element) { |
| 350 CompoundAccessKind accessKind; | 363 CompoundAccessKind accessKind; |
| 351 if (getter.isField) { | 364 if (getter.isField) { |
| 352 accessKind = CompoundAccessKind.SUPER_FIELD_FIELD; | 365 accessKind = CompoundAccessKind.SUPER_FIELD_FIELD; |
| 353 } else if (getter.isGetter) { | 366 } else if (getter.isGetter) { |
| 354 accessKind = CompoundAccessKind.SUPER_GETTER_FIELD; | 367 accessKind = CompoundAccessKind.SUPER_GETTER_FIELD; |
| 355 } else { | 368 } else { |
| 356 return internalError(node, | 369 return internalError(node, |
| 357 "Unsupported super call: $node : $element/$getter."); | 370 "Unsupported super call: $node : $element/$getter."); |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 return internalError(node, "Unexpected variable $element."); | 803 return internalError(node, "Unexpected variable $element."); |
| 791 } | 804 } |
| 792 if (element.isConst) { | 805 if (element.isConst) { |
| 793 ConstantExpression constant = elements.getConstant(element.initializer); | 806 ConstantExpression constant = elements.getConstant(element.initializer); |
| 794 return new ConstantVariableStructure(kind, node, element, constant); | 807 return new ConstantVariableStructure(kind, node, element, constant); |
| 795 } else { | 808 } else { |
| 796 return new NonConstantVariableStructure(kind, node, element); | 809 return new NonConstantVariableStructure(kind, node, element); |
| 797 } | 810 } |
| 798 } | 811 } |
| 799 } | 812 } |
| OLD | NEW |