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

Unified Diff: lib/dartdoc/mirrors/dart2js_mirror.dart

Issue 10780030: Dartdoc and apidoc updated to use Path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 years, 5 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: lib/dartdoc/mirrors/dart2js_mirror.dart
diff --git a/lib/dartdoc/mirrors/dart2js_mirror.dart b/lib/dartdoc/mirrors/dart2js_mirror.dart
index 44fff66e54af41d548f7d984a3e71bacf30fdd57..80071ce83d6ad44e6110b40a12c28bd30572b0b3 100644
--- a/lib/dartdoc/mirrors/dart2js_mirror.dart
+++ b/lib/dartdoc/mirrors/dart2js_mirror.dart
@@ -316,38 +316,38 @@ class Dart2JsCompilation implements Compilation {
}
}
- Dart2JsCompilation(String script, String libraryRoot,
- [String packageRoot, List<String> opts = const <String>[]])
+ Dart2JsCompilation(Path script, Path libraryRoot,
+ [Path packageRoot, List<String> opts = const <String>[]])
: cwd = getCurrentDirectory(), sourceFiles = <SourceFile>{} {
- var libraryUri = cwd.resolve(nativeToUriPath(libraryRoot));
+ var libraryUri = cwd.resolve(nativeToUriPath(libraryRoot.toNativePath()));
var packageUri;
if (packageRoot !== null) {
- packageUri = cwd.resolve(nativeToUriPath(packageRoot));
+ packageUri = cwd.resolve(nativeToUriPath(packageRoot.toNativePath()));
} else {
packageUri = libraryUri;
}
_compiler = new api.Compiler(provider, handler,
libraryUri, packageUri, <String>[]);
- var scriptUri = cwd.resolve(nativeToUriPath(script));
+ var scriptUri = cwd.resolve(nativeToUriPath(script.toNativePath()));
// TODO(johnniwinther): Detect file not found
_compiler.run(scriptUri);
}
- Dart2JsCompilation.library(List<String> libraries, String libraryRoot,
- [String packageRoot, List<String> opts = const []])
+ Dart2JsCompilation.library(List<Path> libraries, Path libraryRoot,
+ [Path packageRoot, List<String> opts = const <String>[]])
: cwd = getCurrentDirectory(), sourceFiles = <SourceFile>{} {
- var libraryUri = cwd.resolve(nativeToUriPath(libraryRoot));
+ var libraryUri = cwd.resolve(nativeToUriPath(libraryRoot.toNativePath()));
var packageUri;
if (packageRoot !== null) {
- packageUri = cwd.resolve(nativeToUriPath(packageRoot));
+ packageUri = cwd.resolve(nativeToUriPath(packageRoot.toNativePath()));
} else {
packageUri = libraryUri;
}
_compiler = new LibraryCompiler(provider, handler,
libraryUri, packageUri, <String>[]);
var librariesUri = <Uri>[];
- for (var library in libraries) {
- librariesUri.add(cwd.resolve(nativeToUriPath(library)));
+ for (Path library in libraries) {
+ librariesUri.add(cwd.resolve(nativeToUriPath(library.toNativePath())));
// TODO(johnniwinther): Detect file not found
}
_compiler.runList(librariesUri);
@@ -359,6 +359,9 @@ class Dart2JsCompilation implements Compilation {
}
MirrorSystem mirrors() => new Dart2JsMirrorSystem(_compiler);
+
+ Future<String> compileToJavaScript() =>
+ new Future<String>.immediate(_compiler.assembledCode);
}

Powered by Google App Engine
This is Rietveld 408576698