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

Unified Diff: pkg/compiler/lib/src/apiimpl.dart

Issue 1291283006: dart2js: fail gracefully with invalid package config (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/apiimpl.dart
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index a2c7d8c9a957ded550c1991ec264f4199629e78d..d3ca1bc4b0aaa49ced8033ba3f3e040091f1eaef 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -394,13 +394,17 @@ class Compiler extends leg.Compiler {
}
// The input provider may put a trailing 0 byte when it reads a source
// file, which confuses the package config parser.
- if (packageConfigContents.length > 0
- && packageConfigContents.last == 0) {
+ if (packageConfigContents.length > 0 &&
+ packageConfigContents.last == 0) {
packageConfigContents = packageConfigContents.sublist(
0, packageConfigContents.length - 1);
}
packages =
new MapPackages(pkgs.parse(packageConfigContents, packageConfig));
+ }).catchError((error) {
+ reportError(NO_LOCATION_SPANNABLE, MessageKind.INVALID_PACKAGE_CONFIG,
+ {'uri': packageConfig, 'exception': error});
+ packages = Packages.noPackages;
});
} else {
if (packagesDiscoveryProvider == null) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698