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

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

Issue 838773002: Throw ArgumentError if packageRoot is null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 5 years, 11 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
Index: dart/pkg/compiler/lib/src/apiimpl.dart
diff --git a/dart/pkg/compiler/lib/src/apiimpl.dart b/dart/pkg/compiler/lib/src/apiimpl.dart
index 8567fb3f6538c995386242e259016304308e035f..c77e04b00fb07ee1de383f88f0d686d7e02a2529 100644
--- a/dart/pkg/compiler/lib/src/apiimpl.dart
+++ b/dart/pkg/compiler/lib/src/apiimpl.dart
@@ -91,11 +91,17 @@ class Compiler extends leg.Compiler {
userHandlerTask = new leg.GenericTask('Diagnostic handler', this),
userProviderTask = new leg.GenericTask('Input provider', this),
]);
+ if (libraryRoot == null) {
+ throw new ArgumentError("[libraryRoot] is null.");
+ }
if (!libraryRoot.path.endsWith("/")) {
- throw new ArgumentError("libraryRoot must end with a /");
+ throw new ArgumentError("[libraryRoot] must end with a /.");
+ }
+ if (packageRoot == null) {
+ throw new ArgumentError("[packageRoot] is null.");
}
- if (packageRoot != null && !packageRoot.path.endsWith("/")) {
- throw new ArgumentError("packageRoot must end with a /");
+ if (!packageRoot.path.endsWith("/")) {
+ throw new ArgumentError("[packageRoot] must end with a /.");
}
if (!analyzeOnly) {
if (enableAsyncAwait) {
@@ -309,10 +315,6 @@ class Compiler extends leg.Compiler {
}
Uri translatePackageUri(leg.Spannable node, Uri uri) {
- if (packageRoot == null) {
- reportFatalError(
- node, leg.MessageKind.PACKAGE_ROOT_NOT_SET, {'uri': uri});
- }
return packageRoot.resolve(uri.path);
}
« no previous file with comments | « no previous file | dart/pkg/compiler/lib/src/warnings.dart » ('j') | dart/pkg/compiler/samples/jsonify/jsonify.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698