| Index: pkg/compiler/lib/src/parser/diet_parser_task.dart
|
| diff --git a/pkg/compiler/lib/src/parser/diet_parser_task.dart b/pkg/compiler/lib/src/parser/diet_parser_task.dart
|
| index 6d9302e040bc53cb916c576a80f5775045f6749b..4192143ee4015a16eda4bea6b61d64434f7b6df2 100644
|
| --- a/pkg/compiler/lib/src/parser/diet_parser_task.dart
|
| +++ b/pkg/compiler/lib/src/parser/diet_parser_task.dart
|
| @@ -5,6 +5,7 @@
|
| library dart2js.parser.diet.task;
|
|
|
| import '../common.dart';
|
| +import '../common/backend_api.dart' show Backend;
|
| import '../common/tasks.dart' show CompilerTask;
|
| import '../compiler.dart' show Compiler;
|
| import '../elements/elements.dart' show CompilationUnitElement;
|
| @@ -19,23 +20,28 @@ import 'partial_parser.dart' show PartialParser;
|
| class DietParserTask extends CompilerTask {
|
| final ParserOptions _parserOptions;
|
| final IdGenerator _idGenerator;
|
| + final Backend _backend;
|
| + final DiagnosticReporter _reporter;
|
|
|
| - DietParserTask(Compiler compiler, this._parserOptions, this._idGenerator)
|
| + DietParserTask(Compiler compiler, this._parserOptions, this._idGenerator,
|
| + this._backend, this._reporter)
|
| : super(compiler);
|
|
|
| final String name = 'Diet Parser';
|
|
|
| dietParse(CompilationUnitElement compilationUnit, Token tokens) {
|
| measure(() {
|
| - ScannerOptions scannerOptions =
|
| - new ScannerOptions.from(compiler, compilationUnit.library);
|
| + ScannerOptions scannerOptions = new ScannerOptions(
|
| + canUseNative: _backend.canLibraryUseNative(compilationUnit.library));
|
| ElementListener listener = new ElementListener(
|
| - scannerOptions, compiler.reporter, compilationUnit, _idGenerator);
|
| + scannerOptions, _reporter, compilationUnit, _idGenerator);
|
| PartialParser parser = new PartialParser(listener, _parserOptions);
|
| try {
|
| parser.parseUnit(tokens);
|
| } on ParserError catch (_) {
|
| - assert(invariant(compilationUnit, compiler.compilationFailed));
|
| + // TODO(johnniwinther): assert that the error was reported once there is
|
| + // a [hasErrorBeenReported] field in [DiagnosticReporter]
|
| + // The error should have already been reported by the parser.
|
| }
|
| });
|
| }
|
|
|