OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library fasta; | 5 library fasta; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:convert' show JSON; | 9 import 'dart:convert' show JSON; |
10 | 10 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 140 } |
141 String argument = c.options.arguments.first; | 141 String argument = c.options.arguments.first; |
142 Uri uri = Uri.base.resolve(argument); | 142 Uri uri = Uri.base.resolve(argument); |
143 String path = uriTranslator.translate(uri)?.path ?? argument; | 143 String path = uriTranslator.translate(uri)?.path ?? argument; |
144 if (path.endsWith(".dart")) { | 144 if (path.endsWith(".dart")) { |
145 kernelTarget.read(uri); | 145 kernelTarget.read(uri); |
146 } else { | 146 } else { |
147 deprecated_inputError(uri, -1, "Unexpected input: $uri"); | 147 deprecated_inputError(uri, -1, "Unexpected input: $uri"); |
148 } | 148 } |
149 await dillTarget.buildOutlines(); | 149 await dillTarget.buildOutlines(); |
| 150 dillTarget.loader.libraries.forEach((lib) => lib.isExternal = true); |
150 var outline = await kernelTarget.buildOutlines(); | 151 var outline = await kernelTarget.buildOutlines(); |
151 if (c.options.dumpIr && output != null) { | 152 if (c.options.dumpIr && output != null) { |
152 printProgramText(outline, libraryFilter: kernelTarget.isSourceLibrary); | 153 printProgramText(outline, libraryFilter: kernelTarget.isSourceLibrary); |
153 } | 154 } |
154 if (output != null) { | 155 if (output != null) { |
155 await writeProgramToFile(outline, output); | 156 await writeProgramToFile(outline, output); |
156 ticker.logMs("Wrote outline to ${output.toFilePath()}"); | 157 ticker.logMs("Wrote outline to ${output.toFilePath()}"); |
157 } | 158 } |
158 return kernelTarget; | 159 return kernelTarget; |
159 } | 160 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 final BytesBuilder builder = new BytesBuilder(); | 242 final BytesBuilder builder = new BytesBuilder(); |
242 | 243 |
243 void add(List<int> data) { | 244 void add(List<int> data) { |
244 builder.add(data); | 245 builder.add(data); |
245 } | 246 } |
246 | 247 |
247 void close() { | 248 void close() { |
248 // Nothing to do. | 249 // Nothing to do. |
249 } | 250 } |
250 } | 251 } |
OLD | NEW |