Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: dart/lib/compiler/implementation/scanner/scanner_task.dart

Issue 10417054: Revert "Parameterize WorkItem.run." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/lib/compiler/implementation/compiler.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/scanner/scanner_task.dart
diff --git a/dart/lib/compiler/implementation/scanner/scanner_task.dart b/dart/lib/compiler/implementation/scanner/scanner_task.dart
index 620b67855ebab8921a4505679eb8945c1106a6d1..208db232f407eb015ae13f24fe02291ef01bddc0 100644
--- a/dart/lib/compiler/implementation/scanner/scanner_task.dart
+++ b/dart/lib/compiler/implementation/scanner/scanner_task.dart
@@ -91,19 +91,26 @@ class ScannerTask extends CompilerTask {
Script script = compilationUnit.script;
Token tokens;
try {
- tokens = new StringScanner(script.text).tokenize();
- } catch (MalformedInputException ex) {
- Token token;
- var message;
- if (ex.position is num) {
- // TODO(ahe): Always use tokens in MalformedInputException.
- token = new Token(EOF_INFO, ex.position);
- } else {
- token = ex.position;
+ try {
+ tokens = new StringScanner(script.text).tokenize();
+ } catch (MalformedInputException ex) {
+ Token token;
+ var message;
+ if (ex.position is num) {
+ // TODO(ahe): Always use tokens in MalformedInputException.
+ token = new Token(EOF_INFO, ex.position);
+ } else {
+ token = ex.position;
+ }
+ compiler.cancel(ex.message, token: token);
}
- compiler.cancel(ex.message, token: token);
+ compiler.dietParser.dietParse(compilationUnit, tokens);
+ } catch (CompilerCancelledException ex) {
+ throw;
+ } catch (var ex) {
+ compiler.unhandledExceptionOnElement(compilationUnit);
+ throw;
}
- compiler.dietParser.dietParse(compilationUnit, tokens);
}
LibraryElement loadLibrary(Uri uri, Node node) {
@@ -117,10 +124,8 @@ class ScannerTask extends CompilerTask {
return element;
});
if (newLibrary) {
- compiler.withCurrentElement(library, () {
- scan(library);
- compiler.onLibraryLoaded(library, uri);
- });
+ compiler.withCurrentElement(library, () => scan(library));
+ compiler.onLibraryLoaded(library, uri);
}
return library;
}
« no previous file with comments | « dart/lib/compiler/implementation/compiler.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698