| 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 /** | 7 /** |
| 8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
| 9 * compiled. | 9 * compiled. |
| 10 */ | 10 */ |
| (...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 } | 1186 } |
| 1187 log('Excess resolution work: ${resolved.length}.'); | 1187 log('Excess resolution work: ${resolved.length}.'); |
| 1188 for (Element e in resolved) { | 1188 for (Element e in resolved) { |
| 1189 SourceSpan span = spanFromElement(e); | 1189 SourceSpan span = spanFromElement(e); |
| 1190 reportDiagnostic(span, 'Warning: $e resolved but not compiled.', | 1190 reportDiagnostic(span, 'Warning: $e resolved but not compiled.', |
| 1191 api.Diagnostic.WARNING); | 1191 api.Diagnostic.WARNING); |
| 1192 } | 1192 } |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 TreeElements analyzeElement(Element element) { | 1195 TreeElements analyzeElement(Element element) { |
| 1196 assert(invariant(element, |
| 1197 element.impliesType() || |
| 1198 element.isField() || |
| 1199 element.isFunction() || |
| 1200 element.isGenerativeConstructor() || |
| 1201 element.isGetter() || |
| 1202 element.isSetter(), |
| 1203 message: 'Unexpected element kind: ${element.kind}')); |
| 1196 assert(invariant(element, element.isDeclaration)); | 1204 assert(invariant(element, element.isDeclaration)); |
| 1197 ResolutionEnqueuer world = enqueuer.resolution; | 1205 ResolutionEnqueuer world = enqueuer.resolution; |
| 1198 TreeElements elements = world.getCachedElements(element); | 1206 TreeElements elements = world.getCachedElements(element); |
| 1199 if (elements != null) return elements; | 1207 if (elements != null) return elements; |
| 1200 assert(parser != null); | 1208 assert(parser != null); |
| 1201 Node tree = parser.parse(element); | 1209 Node tree = parser.parse(element); |
| 1202 assert(invariant(element, !element.isSynthesized || tree == null)); | 1210 assert(invariant(element, !element.isSynthesized || tree == null)); |
| 1203 if (tree != null) validator.validate(tree); | 1211 if (tree != null) validator.validate(tree); |
| 1204 elements = resolver.resolve(element); | 1212 elements = resolver.resolve(element); |
| 1205 if (tree != null && elements != null && !analyzeSignaturesOnly) { | 1213 if (tree != null && elements != null && !analyzeSignaturesOnly) { |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1592 | 1600 |
| 1593 void close() {} | 1601 void close() {} |
| 1594 | 1602 |
| 1595 toString() => name; | 1603 toString() => name; |
| 1596 | 1604 |
| 1597 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1605 /// Convenience method for getting an [api.CompilerOutputProvider]. |
| 1598 static NullSink outputProvider(String name, String extension) { | 1606 static NullSink outputProvider(String name, String extension) { |
| 1599 return new NullSink('$name.$extension'); | 1607 return new NullSink('$name.$extension'); |
| 1600 } | 1608 } |
| 1601 } | 1609 } |
| OLD | NEW |