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

Unified Diff: client/html/scripts/html_diff.dart

Issue 8947005: Refactor dartdoc into a class. Use method overriding to extend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 9 years 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 | « no previous file | client/html/scripts/html_doc.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/scripts/html_diff.dart
diff --git a/client/html/scripts/html_diff.dart b/client/html/scripts/html_diff.dart
index 288e0a12936c67bd7ef565fec1b556684aed6a2a..e0eed5b1b9d4aff22c58d4a6ae4706148f1ddfa0 100644
--- a/client/html/scripts/html_diff.dart
+++ b/client/html/scripts/html_diff.dart
@@ -83,6 +83,8 @@ class HtmlDiff {
/** A map from `dart:html` types to corresponding `dart:dom` types. */
final Map<Type, Set<Type>> htmlTypesToDom;
+ final CommentMap comments;
+
/**
* Perform static initialization of [world]. This should be run before
* calling [HtmlDiff.run].
@@ -96,7 +98,8 @@ class HtmlDiff {
domToHtml = new Map<Member, Set<Member>>(),
htmlToDom = new Map<Member, Set<Member>>(),
domTypesToHtml = new Map<Type, Set<Type>>(),
- htmlTypesToDom = new Map<Type, Set<Type>>();
+ htmlTypesToDom = new Map<Type, Set<Type>>(),
+ comments = new CommentMap();
/**
* Computes the `dart:dom` to `dart:html` mapping, and places it in
@@ -216,7 +219,7 @@ class HtmlDiff {
*/
List<Type> htmlToDomTypes(Type htmlType) {
if (htmlType.name == null) return [];
- final tags = _getTags(findComment(htmlType.span));
+ final tags = _getTags(comments.find(htmlType.span));
if (tags.containsKey('domName')) {
var domNames = map(tags['domName'].split(','), (s) => s.trim());
@@ -253,7 +256,7 @@ class HtmlDiff {
*/
Set<Member> htmlToDomMembers(Member htmlMember, List<Type> domTypes) {
if (htmlMember.isPrivate || htmlMember is! MethodMember) return new Set();
- final tags = _getTags(findComment(htmlMember.span));
+ final tags = _getTags(comments.find(htmlMember.span));
if (tags.containsKey('domName')) {
final domNames = map(tags['domName'].split(','), (s) => s.trim());
if (domNames.length == 1 && domNames[0] == 'none') return new Set();
« no previous file with comments | « no previous file | client/html/scripts/html_doc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698