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.dill_loader; | 5 library fasta.dill_loader; |
6 | 6 |
7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
8 | 8 |
9 import 'dart:io' show File; | 9 import 'dart:io' show File; |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 Future<Null> buildOutline(DillLibraryBuilder builder) async { | 30 Future<Null> buildOutline(DillLibraryBuilder builder) async { |
31 if (program == null) { | 31 if (program == null) { |
32 byteCount = await new File.fromUri(input).length(); | 32 byteCount = await new File.fromUri(input).length(); |
33 setProgram(await loadProgramFromBinary(input.toFilePath())); | 33 setProgram(await loadProgramFromBinary(input.toFilePath())); |
34 } | 34 } |
35 builder.library.classes.forEach(builder.addClass); | 35 builder.library.classes.forEach(builder.addClass); |
36 builder.library.procedures.forEach(builder.addMember); | 36 builder.library.procedures.forEach(builder.addMember); |
37 builder.library.fields.forEach(builder.addMember); | 37 builder.library.fields.forEach(builder.addMember); |
38 } | 38 } |
39 | 39 |
40 Future<Null> buildBody(DillLibraryBuilder builder, _) { | 40 Future<Null> buildBody(DillLibraryBuilder builder) { |
41 return buildOutline(builder); | 41 return buildOutline(builder); |
42 } | 42 } |
43 | 43 |
44 void setProgram(Program program) { | 44 void setProgram(Program program) { |
45 assert(input != null); | 45 assert(input != null); |
46 this.program = program; | 46 this.program = program; |
47 program.unbindCanonicalNames(); | 47 program.unbindCanonicalNames(); |
48 for (Library library in program.libraries) { | 48 for (Library library in program.libraries) { |
49 read(library.importUri).library = library; | 49 read(library.importUri).library = library; |
50 } | 50 } |
51 } | 51 } |
52 } | 52 } |
OLD | NEW |