| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 c.fileSystem, c.options.sdk, c.options.packages); | 126 c.fileSystem, c.options.sdk, c.options.packages); |
| 127 ticker.logMs("Read packages file"); | 127 ticker.logMs("Read packages file"); |
| 128 DillTarget dillTarget = createDillTarget(uriTranslator); | 128 DillTarget dillTarget = createDillTarget(uriTranslator); |
| 129 KernelTarget kernelTarget = | 129 KernelTarget kernelTarget = |
| 130 createKernelTarget(dillTarget, uriTranslator, c.options.strongMode); | 130 createKernelTarget(dillTarget, uriTranslator, c.options.strongMode); |
| 131 if (c.options.strongMode) { | 131 if (c.options.strongMode) { |
| 132 print("Note: strong mode support is preliminary and may not work."); | 132 print("Note: strong mode support is preliminary and may not work."); |
| 133 } | 133 } |
| 134 Uri platform = c.options.platform; | 134 Uri platform = c.options.platform; |
| 135 if (platform != null) { | 135 if (platform != null) { |
| 136 dillTarget.read(platform); | 136 _appendDillForUri(dillTarget, platform); |
| 137 } | 137 } |
| 138 String argument = c.options.arguments.first; | 138 String argument = c.options.arguments.first; |
| 139 Uri uri = Uri.base.resolve(argument); | 139 Uri uri = Uri.base.resolve(argument); |
| 140 String path = uriTranslator.translate(uri)?.path ?? argument; | 140 String path = uriTranslator.translate(uri)?.path ?? argument; |
| 141 if (path.endsWith(".dart")) { | 141 if (path.endsWith(".dart")) { |
| 142 kernelTarget.read(uri); | 142 kernelTarget.read(uri); |
| 143 } else { | 143 } else { |
| 144 inputError(uri, -1, "Unexpected input: $uri"); | 144 inputError(uri, -1, "Unexpected input: $uri"); |
| 145 } | 145 } |
| 146 await dillTarget.writeOutline(null); | 146 await dillTarget.writeOutline(null); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 final BytesBuilder builder = new BytesBuilder(); | 277 final BytesBuilder builder = new BytesBuilder(); |
| 278 | 278 |
| 279 void add(List<int> data) { | 279 void add(List<int> data) { |
| 280 builder.add(data); | 280 builder.add(data); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void close() { | 283 void close() { |
| 284 // Nothing to do. | 284 // Nothing to do. |
| 285 } | 285 } |
| 286 } | 286 } |
| OLD | NEW |