| 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 /** | 5 /** |
| 6 * A script to assist in documenting the difference between the dart:html API | 6 * A script to assist in documenting the difference between the dart:html API |
| 7 * and the old DOM API. | 7 * and the old DOM API. |
| 8 */ | 8 */ |
| 9 library html_diff; | 9 library html_diff; |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * Computes the `@DomName` to `dart:html` mapping, and | 86 * Computes the `@DomName` to `dart:html` mapping, and |
| 87 * places it in [htmlToDom] and [htmlTypesToDom]. Before this is run, dart2js | 87 * places it in [htmlToDom] and [htmlTypesToDom]. Before this is run, dart2js |
| 88 * should be initialized (via [parseOptions] and [initializeWorld]) and | 88 * should be initialized (via [parseOptions] and [initializeWorld]) and |
| 89 * [HtmlDiff.initialize] should be called. | 89 * [HtmlDiff.initialize] should be called. |
| 90 */ | 90 */ |
| 91 Future run(Uri libraryRoot) { | 91 Future run(Uri libraryRoot) { |
| 92 var result = new Completer(); | 92 var result = new Completer(); |
| 93 var provider = new SourceFileProvider(); | 93 var provider = new CompilerSourceFileProvider(); |
| 94 var handler = new FormattingDiagnosticHandler(provider); | 94 var handler = new FormattingDiagnosticHandler(provider); |
| 95 Future<MirrorSystem> analysis = analyze( | 95 Future<MirrorSystem> analysis = analyze( |
| 96 HTML_LIBRARY_URIS, libraryRoot, null, | 96 HTML_LIBRARY_URIS, libraryRoot, null, |
| 97 provider.readStringFromUri, | 97 provider.readStringFromUri, |
| 98 handler.diagnosticHandler); | 98 handler.diagnosticHandler); |
| 99 analysis.then((MirrorSystem mirrors) { | 99 analysis.then((MirrorSystem mirrors) { |
| 100 for (var libraryUri in HTML_LIBRARY_URIS) { | 100 for (var libraryUri in HTML_LIBRARY_URIS) { |
| 101 var library = mirrors.libraries[libraryUri]; | 101 var library = mirrors.libraries[libraryUri]; |
| 102 if (library == null) { | 102 if (library == null) { |
| 103 warn('Could not find $libraryUri'); | 103 warn('Could not find $libraryUri'); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 return members; | 224 return members; |
| 225 } | 225 } |
| 226 | 226 |
| 227 if (name.split('.').length != 2) { | 227 if (name.split('.').length != 2) { |
| 228 warn('invalid member name ${name}'); | 228 warn('invalid member name ${name}'); |
| 229 return new Set(); | 229 return new Set(); |
| 230 } | 230 } |
| 231 return new Set.from([name]); | 231 return new Set.from([name]); |
| 232 } | 232 } |
| 233 } | 233 } |
| OLD | NEW |