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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 message: 'Element $element is not analyzable.')); | 1799 message: 'Element $element is not analyzable.')); |
1800 assert(invariant(element, element.isDeclaration)); | 1800 assert(invariant(element, element.isDeclaration)); |
1801 ResolutionEnqueuer world = enqueuer.resolution; | 1801 ResolutionEnqueuer world = enqueuer.resolution; |
1802 if (world.hasBeenResolved(element)) { | 1802 if (world.hasBeenResolved(element)) { |
1803 return const WorldImpact(); | 1803 return const WorldImpact(); |
1804 } | 1804 } |
1805 assert(parser != null); | 1805 assert(parser != null); |
1806 Node tree = parser.parse(element); | 1806 Node tree = parser.parse(element); |
1807 assert(invariant(element, !element.isSynthesized || tree == null)); | 1807 assert(invariant(element, !element.isSynthesized || tree == null)); |
1808 WorldImpact worldImpact = resolver.resolve(element); | 1808 WorldImpact worldImpact = resolver.resolve(element); |
1809 if (tree != null && !analyzeSignaturesOnly && | 1809 if (tree != null && !analyzeSignaturesOnly && !suppressWarnings) { |
1810 !suppressWarnings) { | |
1811 // Only analyze nodes with a corresponding [TreeElements]. | 1810 // Only analyze nodes with a corresponding [TreeElements]. |
1812 checker.check(element); | 1811 checker.check(element); |
1813 } | 1812 } |
1814 world.registerResolvedElement(element); | 1813 world.registerResolvedElement(element); |
1815 return worldImpact; | 1814 return worldImpact; |
1816 } | 1815 } |
1817 | 1816 |
1818 WorldImpact analyze(ResolutionWorkItem work, ResolutionEnqueuer world) { | 1817 WorldImpact analyze(ResolutionWorkItem work, ResolutionEnqueuer world) { |
1819 assert(invariant(work.element, identical(world, enqueuer.resolution))); | 1818 assert(invariant(work.element, identical(world, enqueuer.resolution))); |
1820 assert(invariant(work.element, !work.isAnalyzed(), | 1819 assert(invariant(work.element, !work.isAnalyzed(), |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 InterfaceType streamType([DartType elementType]) { | 2508 InterfaceType streamType([DartType elementType]) { |
2510 InterfaceType type = streamClass.computeType(compiler); | 2509 InterfaceType type = streamClass.computeType(compiler); |
2511 if (elementType == null) { | 2510 if (elementType == null) { |
2512 return streamClass.rawType; | 2511 return streamClass.rawType; |
2513 } | 2512 } |
2514 return type.createInstantiation([elementType]); | 2513 return type.createInstantiation([elementType]); |
2515 } | 2514 } |
2516 } | 2515 } |
2517 | 2516 |
2518 typedef void InternalErrorFunction(Spannable location, String message); | 2517 typedef void InternalErrorFunction(Spannable location, String message); |
OLD | NEW |