Chromium Code Reviews| Index: pkg/front_end/lib/src/fasta/source/source_loader.dart |
| diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart |
| index 5e508462945b3ac4b52d8aadfc046d5f5989957a..8e95cd2ef182d69af4f5e27af24f3f6f68ee21fb 100644 |
| --- a/pkg/front_end/lib/src/fasta/source/source_loader.dart |
| +++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart |
| @@ -40,8 +40,11 @@ import 'diet_parser.dart' show DietParser; |
| import 'source_library_builder.dart' show SourceLibraryBuilder; |
| +import '../compiler_context.dart' show CompilerContext; |
| + |
| class SourceLoader<L> extends Loader<L> { |
| final Map<Uri, List<int>> sourceBytes = <Uri, List<int>>{}; |
| + bool get includeSource => CompilerContext.current.options.includeSource; |
|
ahe
2017/03/03 13:14:50
This should be set when constructing this object:
jensj
2017/03/06 07:38:36
Done.
|
| // Used when building directly to kernel. |
| ClassHierarchy hierarchy; |
| @@ -64,7 +67,8 @@ class SourceLoader<L> extends Loader<L> { |
| ScannerResult result = scan(bytes); |
| Token token = result.tokens; |
| if (!suppressLexicalErrors) { |
| - target.addLineStarts(library.fileUri, result.lineStarts); |
| + var source = includeSource ? bytes : const <int>[]; |
|
ahe
2017/03/03 13:14:50
var -> List<int>
jensj
2017/03/06 07:38:36
Done.
|
| + target.addSourceInformation(library.fileUri, result.lineStarts, source); |
| } |
| while (token is ErrorToken) { |
| if (!suppressLexicalErrors) { |