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..a43a32826f3bd9ca4e769c2ac5fd618a7cceef17 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; |
| // 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 ? new String.fromCharCodes(bytes) : ""; |
|
ahe
2017/03/03 12:30:32
This should be UTF8.encode(bytes), but I really th
|
| + target.addSourceInformation(library.fileUri, result.lineStarts, source); |
| } |
| while (token is ErrorToken) { |
| if (!suppressLexicalErrors) { |