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

Unified Diff: utils/apidoc/html_diff.dart

Issue 10809035: Several new features and improvements for dartdoc. (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
« no previous file with comments | « utils/apidoc/apidoc.dart ('k') | utils/compiler/build_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/html_diff.dart
diff --git a/utils/apidoc/html_diff.dart b/utils/apidoc/html_diff.dart
index 1fb573c98b0b6277ad5f10ed1fb8a77bb90fd4e0..9657c6af44389cf05b6e23e43ef082e7730728ac 100644
--- a/utils/apidoc/html_diff.dart
+++ b/utils/apidoc/html_diff.dart
@@ -15,6 +15,9 @@
#import('../../lib/dartdoc/mirrors/mirrors.dart');
#import('../../lib/dartdoc/mirrors/mirrors_util.dart');
+final HTML_LIBRARY_NAME = 'dart:html';
+final DOM_LIBRARY_NAME = 'dart:dom_deprecated';
+
/**
* A class for computing a many-to-many mapping between the types and
* members in `dart:dom_deprecated` and `dart:html`. This mapping is
@@ -83,13 +86,13 @@ class HtmlDiff {
static void initialize(Path libDir) {
_compilation = new Compilation.library(
const <Path>[
- const Path('dart:dom_deprecated'),
- const Path('dart:html')
+ const Path(DOM_LIBRARY_NAME),
+ const Path(HTML_LIBRARY_NAME)
], libDir);
_mirrors = _compilation.mirrors();
// Find 'dart:dom_deprecated' by its library tag 'dom'.
- dom = findMirror(_mirrors.libraries(), 'dom');
+ dom = findMirror(_mirrors.libraries(), DOM_LIBRARY_NAME);
}
HtmlDiff([bool printWarnings = false]) :
@@ -114,9 +117,9 @@ class HtmlDiff {
* [HtmlDiff.initialize] should be called.
*/
void run() {
- LibraryMirror htmlLib = findMirror(_mirrors.libraries(), 'html');
+ LibraryMirror htmlLib = findMirror(_mirrors.libraries(), HTML_LIBRARY_NAME);
if (htmlLib === null) {
- warn('Could not find dart:html');
+ warn('Could not find $HTML_LIBRARY_NAME');
return;
}
for (InterfaceMirror htmlType in htmlLib.types().getValues()) {
@@ -143,9 +146,10 @@ class HtmlDiff {
void _addMemberDiff(MemberMirror htmlMember, List<TypeMirror> domTypes) {
var domMembers = htmlToDomMembers(htmlMember, domTypes);
if (htmlMember == null && !domMembers.isEmpty()) {
- warn('dart:html member '
+ warn('$HTML_LIBRARY_NAME member '
'${htmlMember.surroundingDeclaration().simpleName()}.'
- '${htmlMember.simpleName()} has no corresponding dart:html member.');
+ '${htmlMember.simpleName()} has no corresponding '
+ '$HTML_LIBRARY_NAME member.');
}
if (htmlMember == null) return;
@@ -174,7 +178,7 @@ class HtmlDiff {
for (var domName in domNames) {
final domType = findMirror(dom.types(), domName);
if (domType == null) {
- warn('no dart:dom_deprecated type named $domName');
+ warn('no $DOM_LIBRARY_NAME type named $domName');
} else {
domTypes.add(domType);
}
« no previous file with comments | « utils/apidoc/apidoc.dart ('k') | utils/compiler/build_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698