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.kernel_target; | 5 library fasta.kernel_target; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 Future; | 8 Future; |
9 | 9 |
10 import 'dart:io' show | 10 import 'dart:io' show |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 ticker.logMs("Linked program"); | 321 ticker.logMs("Linked program"); |
322 return program; | 322 return program; |
323 } | 323 } |
324 | 324 |
325 Future<Program> writeLinkedProgram(Uri uri, Program program, | 325 Future<Program> writeLinkedProgram(Uri uri, Program program, |
326 {bool isFullProgram}) async { | 326 {bool isFullProgram}) async { |
327 File output = new File.fromUri(uri); | 327 File output = new File.fromUri(uri); |
328 IOSink sink = output.openWrite(); | 328 IOSink sink = output.openWrite(); |
329 try { | 329 try { |
330 new BinaryPrinter(sink).writeProgramFile(program); | 330 new BinaryPrinter(sink).writeProgramFile(program); |
| 331 program.unbindCanonicalNames(); |
331 } finally { | 332 } finally { |
332 await sink.close(); | 333 await sink.close(); |
333 } | 334 } |
334 if (isFullProgram) { | 335 if (isFullProgram) { |
335 ticker.logMs("Wrote program to ${uri.toFilePath()}"); | 336 ticker.logMs("Wrote program to ${uri.toFilePath()}"); |
336 } else { | 337 } else { |
337 ticker.logMs("Wrote outline to ${uri.toFilePath()}"); | 338 ticker.logMs("Wrote outline to ${uri.toFilePath()}"); |
338 } | 339 } |
339 return null; | 340 return null; |
340 } | 341 } |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 superclass = superclass.superclass; | 582 superclass = superclass.superclass; |
582 } | 583 } |
583 for (Constructor constructor in superclass.constructors) { | 584 for (Constructor constructor in superclass.constructors) { |
584 if (constructor.name.name.isEmpty) { | 585 if (constructor.name.name.isEmpty) { |
585 return constructor.function.requiredParameterCount == 0 ? | 586 return constructor.function.requiredParameterCount == 0 ? |
586 constructor : null; | 587 constructor : null; |
587 } | 588 } |
588 } | 589 } |
589 return null; | 590 return null; |
590 } | 591 } |
OLD | NEW |