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

Unified Diff: dart/pkg/compiler/samples/jsonify/jsonify.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
« no previous file with comments | « dart/pkg/compiler/lib/src/warnings.dart ('k') | dart/tests/compiler/dart2js/mirrors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/compiler/samples/jsonify/jsonify.dart
diff --git a/dart/pkg/compiler/samples/jsonify/jsonify.dart b/dart/pkg/compiler/samples/jsonify/jsonify.dart
index bb0c41370193c99c131eed32e9902425572e28e7..9b70921b21fccbe85226d9e9895a3fd577d6881b 100644
--- a/dart/pkg/compiler/samples/jsonify/jsonify.dart
+++ b/dart/pkg/compiler/samples/jsonify/jsonify.dart
@@ -46,7 +46,12 @@ main(List<String> arguments) {
Uri myLocation =
handler.provider.cwd.resolveUri(Platform.script);
- sdkRoot = myLocation.resolve(SDK_ROOT).resolve('../');
+ Uri packageRoot =
+ handler.provider.cwd.resolve(Platform.packageRoot);
Johnni Winther 2015/01/08 08:16:15 You need to ensure that the URI path ends with a /
ahe 2015/01/08 08:34:43 This isn't a super user friendly tool. For example
Johnni Winther 2015/01/08 09:40:42 The problem is really with Platform.packageRoot wh
+
+ Uri libraryRoot = myLocation.resolve(SDK_ROOT);
+
+ sdkRoot = libraryRoot.resolve('../');
// Get the names of public dart2js libraries.
Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary);
@@ -54,7 +59,7 @@ main(List<String> arguments) {
// Turn the names into uris by prepending dart: to them.
List<Uri> uris = names.map((String name) => Uri.parse('dart:$name')).toList();
- analyze(uris, myLocation.resolve(SDK_ROOT), null, handler.provider, handler)
+ analyze(uris, libraryRoot, packageRoot, handler.provider, handler)
.then(jsonify);
}
« no previous file with comments | « dart/pkg/compiler/lib/src/warnings.dart ('k') | dart/tests/compiler/dart2js/mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698