| 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 library dart2js.resolution.constructors; | 5 library dart2js.resolution.constructors; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/resolution.dart' show Resolution; | 8 import '../common/resolution.dart' show Resolution; |
| 9 import '../constants/constructors.dart' | 9 import '../constants/constructors.dart' |
| 10 show | 10 show |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 } | 612 } |
| 613 } | 613 } |
| 614 resolver.registry.setType(expression, result.type); | 614 resolver.registry.setType(expression, result.type); |
| 615 return result; | 615 return result; |
| 616 } | 616 } |
| 617 | 617 |
| 618 ConstructorResult visitTypeAnnotation(TypeAnnotation node) { | 618 ConstructorResult visitTypeAnnotation(TypeAnnotation node) { |
| 619 // This is not really resolving a type-annotation, but the name of the | 619 // This is not really resolving a type-annotation, but the name of the |
| 620 // constructor. Therefore we allow deferred types. | 620 // constructor. Therefore we allow deferred types. |
| 621 DartType type = resolver.resolveTypeAnnotation(node, | 621 DartType type = resolver.resolveTypeAnnotation(node, |
| 622 malformedIsError: inConstContext, deferredIsMalformed: false); | 622 malformedIsError: inConstContext, |
| 623 deferredIsMalformed: false, |
| 624 registerCheckedModeCheck: false); |
| 623 Send send = node.typeName.asSend(); | 625 Send send = node.typeName.asSend(); |
| 624 PrefixElement prefix; | 626 PrefixElement prefix; |
| 625 if (send != null) { | 627 if (send != null) { |
| 626 // The type name is of the form [: prefix . identifier :]. | 628 // The type name is of the form [: prefix . identifier :]. |
| 627 String name = send.receiver.asIdentifier().source; | 629 String name = send.receiver.asIdentifier().source; |
| 628 Element element = lookupInScope(reporter, send, resolver.scope, name); | 630 Element element = lookupInScope(reporter, send, resolver.scope, name); |
| 629 if (element != null && element.isPrefix) { | 631 if (element != null && element.isPrefix) { |
| 630 prefix = element; | 632 prefix = element; |
| 631 } | 633 } |
| 632 } | 634 } |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 // constructors. | 881 // constructors. |
| 880 return null; | 882 return null; |
| 881 } | 883 } |
| 882 // TODO(johnniwinther): Use [Name] for lookup. | 884 // TODO(johnniwinther): Use [Name] for lookup. |
| 883 ConstructorElement constructor = cls.lookupConstructor(constructorName); | 885 ConstructorElement constructor = cls.lookupConstructor(constructorName); |
| 884 if (constructor != null) { | 886 if (constructor != null) { |
| 885 constructor = constructor.declaration; | 887 constructor = constructor.declaration; |
| 886 } | 888 } |
| 887 return constructor; | 889 return constructor; |
| 888 } | 890 } |
| OLD | NEW |