Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js_util; | 5 library dart2js_util; |
| 6 | 6 |
| 7 // TODO(tmandel): This is a temporary copy of the dart2js_mirrors.dart | 7 // TODO(tmandel): This is a temporary copy of the dart2js_mirrors.dart |
|
Andrei Mouravski
2013/06/18 10:17:45
Make an issue.
janicejl
2013/06/18 18:42:46
Where should I be making the issue. This file is c
| |
| 8 // file in the dartdoc folder. One of the two should be deleted | 8 // file in the dartdoc folder. One of the two should be deleted |
| 9 // when docgen can replace dartdoc. | 9 // when docgen can replace dartdoc. |
| 10 | 10 |
| 11 import 'dart:async' show Future; | 11 import 'dart:async' show Future; |
| 12 import 'dart:io' show Path; | 12 import 'dart:io' show Path; |
| 13 | 13 |
| 14 import '../../../../sdk/lib/_internal/compiler/compiler.dart' as api; | 14 import 'package:compiler_unsupported/compiler.dart' as api; |
| 15 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mi rror.dart' | 15 import 'package:compiler_unsupported/implementation/mirrors/dart2js_mirror.dart' |
| 16 as dart2js show analyze, Dart2JsMirrorSystem; | 16 as dart2js show analyze, Dart2JsMirrorSystem; |
| 17 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.da rt' | 17 import 'package:compiler_unsupported/implementation/mirrors/mirrors.dart' |
| 18 show MirrorSystem; | 18 show MirrorSystem; |
| 19 import '../../../../sdk/lib/_internal/compiler/implementation/source_file_provid er.dart' | 19 import 'package:compiler_unsupported/implementation/source_file_provider.dart' |
| 20 show FormattingDiagnosticHandler, SourceFileProvider; | 20 show FormattingDiagnosticHandler, SourceFileProvider; |
| 21 import '../../../../sdk/lib/_internal/compiler/implementation/filenames.dart' | 21 import 'package:compiler_unsupported/implementation/filenames.dart' |
| 22 show appendSlash, currentDirectory; | 22 show appendSlash, currentDirectory; |
| 23 | 23 |
| 24 // TODO(johnniwinther): Support client configurable providers. | 24 // TODO(johnniwinther): Support client configurable providers. |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * Returns a future that completes to a non-null String when [script] | 27 * Returns a future that completes to a non-null String when [script] |
| 28 * has been successfully compiled. | 28 * has been successfully compiled. |
| 29 */ | 29 */ |
| 30 // TODO(amouravski): Remove this method and call dart2js via a process instead. | 30 // TODO(amouravski): Remove this method and call dart2js via a process instead. |
| 31 Future<String> compile(Path script, | 31 Future<String> compile(Path script, |
|
Andrei Mouravski
2013/06/18 10:17:45
All this code can probably be made simpler and bet
janicejl
2013/06/18 18:42:46
I have removed it since it is not used.
| |
| 32 Path libraryRoot, | 32 Path libraryRoot, |
| 33 {Path packageRoot, | 33 {Path packageRoot, |
| 34 List<String> options: const <String>[], | 34 List<String> options: const <String>[], |
| 35 api.DiagnosticHandler diagnosticHandler}) { | 35 api.DiagnosticHandler diagnosticHandler}) { |
| 36 SourceFileProvider provider = new SourceFileProvider(); | 36 SourceFileProvider provider = new SourceFileProvider(); |
| 37 if (diagnosticHandler == null) { | 37 if (diagnosticHandler == null) { |
| 38 diagnosticHandler = | 38 diagnosticHandler = |
| 39 new FormattingDiagnosticHandler(provider).diagnosticHandler; | 39 new FormattingDiagnosticHandler(provider).diagnosticHandler; |
| 40 } | 40 } |
| 41 Uri scriptUri = currentDirectory.resolve(script.toString()); | 41 Uri scriptUri = currentDirectory.resolve(script.toString()); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 68 packageUri = currentDirectory.resolve(appendSlash('$packageRoot')); | 68 packageUri = currentDirectory.resolve(appendSlash('$packageRoot')); |
| 69 } | 69 } |
| 70 List<Uri> librariesUri = <Uri>[]; | 70 List<Uri> librariesUri = <Uri>[]; |
| 71 for (Path library in libraries) { | 71 for (Path library in libraries) { |
| 72 librariesUri.add(currentDirectory.resolve(library.toString())); | 72 librariesUri.add(currentDirectory.resolve(library.toString())); |
| 73 } | 73 } |
| 74 return dart2js.analyze(librariesUri, libraryUri, packageUri, | 74 return dart2js.analyze(librariesUri, libraryUri, packageUri, |
| 75 provider.readStringFromUri, diagnosticHandler, | 75 provider.readStringFromUri, diagnosticHandler, |
| 76 options); | 76 options); |
| 77 } | 77 } |
| OLD | NEW |