Chromium Code Reviews| 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())); |
|
Bill Hesse
2012/07/17 13:42:13
Are you sure that nativeToUriPath and toNativePath
Johnni Winther
2012/07/19 08:37:07
On Windows we might still need to convert \ to / f
Bill Hesse
2012/07/19 13:36:19
But if the path has been constructed with Path.fro
|
| 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); |
| } |