Chromium Code Reviews| 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..f7f9cd10b7858f5eb2cfa6149acfc570dc7219fb 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,26 @@ 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)); |
| + // The error should have already been reported by the parser. |
|
Johnni Winther
2016/04/13 08:21:43
Add a TODO (for me) to add a 'hasErrorBeenReported
Harry Terkelsen
2016/04/13 20:23:40
Done.
|
| } |
| }); |
| } |