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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 | 718 |
719 final bool suppressWarnings; | 719 final bool suppressWarnings; |
720 | 720 |
721 /// `true` if async/await features are supported. | 721 /// `true` if async/await features are supported. |
722 final bool enableAsyncAwait; | 722 final bool enableAsyncAwait; |
723 | 723 |
724 /// If `true`, some values are cached for reuse in incremental compilation. | 724 /// If `true`, some values are cached for reuse in incremental compilation. |
725 /// Incremental compilation is basically calling [run] more than once. | 725 /// Incremental compilation is basically calling [run] more than once. |
726 final bool hasIncrementalSupport; | 726 final bool hasIncrementalSupport; |
727 | 727 |
| 728 /// If `true` native extension syntax is supported by the frontend. |
| 729 final bool allowNativeExtensions; |
| 730 |
728 api.CompilerOutputProvider outputProvider; | 731 api.CompilerOutputProvider outputProvider; |
729 | 732 |
730 bool disableInlining = false; | 733 bool disableInlining = false; |
731 | 734 |
732 /// True if compilation was aborted with a [CompilerCancelledException]. Only | 735 /// True if compilation was aborted with a [CompilerCancelledException]. Only |
733 /// set after Future retuned by [run] has completed. | 736 /// set after Future retuned by [run] has completed. |
734 bool compilerWasCancelled = false; | 737 bool compilerWasCancelled = false; |
735 | 738 |
736 List<Uri> librariesToAnalyzeWhenRun; | 739 List<Uri> librariesToAnalyzeWhenRun; |
737 | 740 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 this.sourceMapUri: null, | 961 this.sourceMapUri: null, |
959 this.outputUri: null, | 962 this.outputUri: null, |
960 this.buildId: UNDETERMINED_BUILD_ID, | 963 this.buildId: UNDETERMINED_BUILD_ID, |
961 this.terseDiagnostics: false, | 964 this.terseDiagnostics: false, |
962 this.dumpInfo: false, | 965 this.dumpInfo: false, |
963 this.showPackageWarnings: false, | 966 this.showPackageWarnings: false, |
964 this.useContentSecurityPolicy: false, | 967 this.useContentSecurityPolicy: false, |
965 this.suppressWarnings: false, | 968 this.suppressWarnings: false, |
966 bool hasIncrementalSupport: false, | 969 bool hasIncrementalSupport: false, |
967 this.enableAsyncAwait: false, | 970 this.enableAsyncAwait: false, |
| 971 this.allowNativeExtensions: false, |
968 api.CompilerOutputProvider outputProvider, | 972 api.CompilerOutputProvider outputProvider, |
969 List<String> strips: const []}) | 973 List<String> strips: const []}) |
970 : this.disableTypeInferenceFlag = | 974 : this.disableTypeInferenceFlag = |
971 disableTypeInferenceFlag || !emitJavaScript, | 975 disableTypeInferenceFlag || !emitJavaScript, |
972 this.analyzeOnly = | 976 this.analyzeOnly = |
973 analyzeOnly || analyzeSignaturesOnly || analyzeAllFlag, | 977 analyzeOnly || analyzeSignaturesOnly || analyzeAllFlag, |
974 this.analyzeSignaturesOnly = analyzeSignaturesOnly, | 978 this.analyzeSignaturesOnly = analyzeSignaturesOnly, |
975 this.analyzeAllFlag = analyzeAllFlag, | 979 this.analyzeAllFlag = analyzeAllFlag, |
976 this.hasIncrementalSupport = hasIncrementalSupport, | 980 this.hasIncrementalSupport = hasIncrementalSupport, |
977 cacheStrategy = new CacheStrategy(hasIncrementalSupport), | 981 cacheStrategy = new CacheStrategy(hasIncrementalSupport), |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 } | 1898 } |
1895 } | 1899 } |
1896 prevToken = currentToken; | 1900 prevToken = currentToken; |
1897 currentToken = currentToken.next; | 1901 currentToken = currentToken.next; |
1898 } | 1902 } |
1899 return firstToken; | 1903 return firstToken; |
1900 } | 1904 } |
1901 | 1905 |
1902 void reportUnusedCode() { | 1906 void reportUnusedCode() { |
1903 void checkLive(member) { | 1907 void checkLive(member) { |
| 1908 if (member.isErroneous) return; |
1904 if (member.isFunction) { | 1909 if (member.isFunction) { |
1905 if (!enqueuer.resolution.hasBeenResolved(member)) { | 1910 if (!enqueuer.resolution.hasBeenResolved(member)) { |
1906 reportHint(member, MessageKind.UNUSED_METHOD, | 1911 reportHint(member, MessageKind.UNUSED_METHOD, |
1907 {'name': member.name}); | 1912 {'name': member.name}); |
1908 } | 1913 } |
1909 } else if (member.isClass) { | 1914 } else if (member.isClass) { |
1910 if (!member.isResolved) { | 1915 if (!member.isResolved) { |
1911 reportHint(member, MessageKind.UNUSED_CLASS, | 1916 reportHint(member, MessageKind.UNUSED_CLASS, |
1912 {'name': member.name}); | 1917 {'name': member.name}); |
1913 } else { | 1918 } else { |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2175 int warnings = 0; | 2180 int warnings = 0; |
2176 int hints = 0; | 2181 int hints = 0; |
2177 } | 2182 } |
2178 | 2183 |
2179 class GenericTask extends CompilerTask { | 2184 class GenericTask extends CompilerTask { |
2180 final String name; | 2185 final String name; |
2181 | 2186 |
2182 GenericTask(this.name, Compiler compiler) | 2187 GenericTask(this.name, Compiler compiler) |
2183 : super(compiler); | 2188 : super(compiler); |
2184 } | 2189 } |
OLD | NEW |