| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 await kernelTarget.writeDepsFile(output, depsFile, | 262 await kernelTarget.writeDepsFile(output, depsFile, |
| 263 extraDependencies: extraDependencies); | 263 extraDependencies: extraDependencies); |
| 264 }); | 264 }); |
| 265 } | 265 } |
| 266 | 266 |
| 267 /// Load the [Program] from the given [uri] and append its libraries | 267 /// Load the [Program] from the given [uri] and append its libraries |
| 268 /// to the [dillTarget]. | 268 /// to the [dillTarget]. |
| 269 void _appendDillForUri(DillTarget dillTarget, Uri uri) { | 269 void _appendDillForUri(DillTarget dillTarget, Uri uri) { |
| 270 var bytes = new File.fromUri(uri).readAsBytesSync(); | 270 var bytes = new File.fromUri(uri).readAsBytesSync(); |
| 271 var platformProgram = loadProgramFromBytes(bytes); | 271 var platformProgram = loadProgramFromBytes(bytes); |
| 272 platformProgram.unbindCanonicalNames(); |
| 272 dillTarget.loader.appendLibraries(platformProgram); | 273 dillTarget.loader.appendLibraries(platformProgram); |
| 273 } | 274 } |
| 274 | 275 |
| 275 // TODO(ahe): https://github.com/dart-lang/sdk/issues/28316 | 276 // TODO(ahe): https://github.com/dart-lang/sdk/issues/28316 |
| 276 class ByteSink implements Sink<List<int>> { | 277 class ByteSink implements Sink<List<int>> { |
| 277 final BytesBuilder builder = new BytesBuilder(); | 278 final BytesBuilder builder = new BytesBuilder(); |
| 278 | 279 |
| 279 void add(List<int> data) { | 280 void add(List<int> data) { |
| 280 builder.add(data); | 281 builder.add(data); |
| 281 } | 282 } |
| 282 | 283 |
| 283 void close() { | 284 void close() { |
| 284 // Nothing to do. | 285 // Nothing to do. |
| 285 } | 286 } |
| 286 } | 287 } |
| OLD | NEW |