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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1041 log('Excess resolution work: ${resolved.length}.'); | 1041 log('Excess resolution work: ${resolved.length}.'); |
1042 for (Element e in resolved) { | 1042 for (Element e in resolved) { |
1043 SourceSpan span = spanFromElement(e); | 1043 SourceSpan span = spanFromElement(e); |
1044 reportDiagnostic(span, 'Warning: $e resolved but not compiled.', | 1044 reportDiagnostic(span, 'Warning: $e resolved but not compiled.', |
1045 api.Diagnostic.WARNING); | 1045 api.Diagnostic.WARNING); |
1046 } | 1046 } |
1047 } | 1047 } |
1048 | 1048 |
1049 TreeElements analyzeElement(Element element) { | 1049 TreeElements analyzeElement(Element element) { |
1050 assert(invariant(element, element.isDeclaration)); | 1050 assert(invariant(element, element.isDeclaration)); |
1051 assert(!element.isForwardingConstructor); | |
1052 ResolutionEnqueuer world = enqueuer.resolution; | 1051 ResolutionEnqueuer world = enqueuer.resolution; |
1053 TreeElements elements = world.getCachedElements(element); | 1052 TreeElements elements = world.getCachedElements(element); |
1054 if (elements != null) return elements; | 1053 if (elements != null) return elements; |
1055 assert(parser != null); | 1054 assert(parser != null); |
1056 Node tree = parser.parse(element); | 1055 Node tree = parser.parse(element); |
1057 validator.validate(tree); | 1056 if (tree != null) validator.validate(tree); |
ahe
2013/07/18 14:32:56
assert(invariant(element, !element.isSynthetic ||
ngeoffray
2013/07/18 15:25:14
Done.
| |
1058 elements = resolver.resolve(element); | 1057 elements = resolver.resolve(element); |
1059 if (elements != null && !analyzeSignaturesOnly) { | 1058 if (tree != null && elements != null && !analyzeSignaturesOnly) { |
1060 // Only analyze nodes with a corresponding [TreeElements]. | 1059 // Only analyze nodes with a corresponding [TreeElements]. |
1061 checker.check(elements); | 1060 checker.check(elements); |
1062 } | 1061 } |
1063 world.resolvedElements[element] = elements; | 1062 world.resolvedElements[element] = elements; |
1064 return elements; | 1063 return elements; |
1065 } | 1064 } |
1066 | 1065 |
1067 TreeElements analyze(ResolutionWorkItem work, ResolutionEnqueuer world) { | 1066 TreeElements analyze(ResolutionWorkItem work, ResolutionEnqueuer world) { |
1068 assert(invariant(work.element, identical(world, enqueuer.resolution))); | 1067 assert(invariant(work.element, identical(world, enqueuer.resolution))); |
1069 assert(invariant(work.element, !work.isAnalyzed(), | 1068 assert(invariant(work.element, !work.isAnalyzed(), |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1455 | 1454 |
1456 void close() {} | 1455 void close() {} |
1457 | 1456 |
1458 toString() => name; | 1457 toString() => name; |
1459 | 1458 |
1460 /// Convenience method for getting an [api.CompilerOutputProvider]. | 1459 /// Convenience method for getting an [api.CompilerOutputProvider]. |
1461 static NullSink outputProvider(String name, String extension) { | 1460 static NullSink outputProvider(String name, String extension) { |
1462 return new NullSink('$name.$extension'); | 1461 return new NullSink('$name.$extension'); |
1463 } | 1462 } |
1464 } | 1463 } |
OLD | NEW |