| 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 part of dart2js; | 5 part of dart2js; |
| 6 | 6 |
| 7 class TypeCheckerTask extends CompilerTask { | 7 class TypeCheckerTask extends CompilerTask { |
| 8 TypeCheckerTask(Compiler compiler) : super(compiler); | 8 TypeCheckerTask(Compiler compiler) : super(compiler); |
| 9 String get name => "Type checker"; | 9 String get name => "Type checker"; |
| 10 | 10 |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 Identifier selector = node.selector.asIdentifier(); | 1111 Identifier selector = node.selector.asIdentifier(); |
| 1112 if (Elements.isClosureSend(node, element)) { | 1112 if (Elements.isClosureSend(node, element)) { |
| 1113 if (element != null) { | 1113 if (element != null) { |
| 1114 // foo() where foo is a local or a parameter. | 1114 // foo() where foo is a local or a parameter. |
| 1115 return analyzeInvocation(node, createPromotedAccess(element)); | 1115 return analyzeInvocation(node, createPromotedAccess(element)); |
| 1116 } else { | 1116 } else { |
| 1117 // exp() where exp is some complex expression like (o) or foo(). | 1117 // exp() where exp is some complex expression like (o) or foo(). |
| 1118 DartType type = analyze(node.selector); | 1118 DartType type = analyze(node.selector); |
| 1119 return analyzeInvocation(node, new TypeAccess(type)); | 1119 return analyzeInvocation(node, new TypeAccess(type)); |
| 1120 } | 1120 } |
| 1121 } else if (Elements.isErroneousElement(element) && selector == null) { | 1121 } else if (Elements.isErroneous(element) && selector == null) { |
| 1122 // exp() where exp is an erroneous construct like `new Unresolved()`. | 1122 // exp() where exp is an erroneous construct like `new Unresolved()`. |
| 1123 DartType type = analyze(node.selector); | 1123 DartType type = analyze(node.selector); |
| 1124 return analyzeInvocation(node, new TypeAccess(type)); | 1124 return analyzeInvocation(node, new TypeAccess(type)); |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 String name = selector.source; | 1127 String name = selector.source; |
| 1128 | 1128 |
| 1129 if (node.isOperator && identical(name, 'is')) { | 1129 if (node.isOperator && identical(name, 'is')) { |
| 1130 analyze(node.receiver); | 1130 analyze(node.receiver); |
| 1131 if (!node.isIsNotCheck) { | 1131 if (!node.isIsNotCheck) { |
| (...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1828 | 1828 |
| 1829 visitTypedef(Typedef node) { | 1829 visitTypedef(Typedef node) { |
| 1830 // Do not typecheck [Typedef] nodes. | 1830 // Do not typecheck [Typedef] nodes. |
| 1831 } | 1831 } |
| 1832 | 1832 |
| 1833 visitNode(Node node) { | 1833 visitNode(Node node) { |
| 1834 compiler.internalError(node, | 1834 compiler.internalError(node, |
| 1835 'Unexpected node ${node.getObjectDescription()} in the type checker.'); | 1835 'Unexpected node ${node.getObjectDescription()} in the type checker.'); |
| 1836 } | 1836 } |
| 1837 } | 1837 } |
| OLD | NEW |