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

Unified Diff: utils/apidoc/apidoc.dart

Issue 10918063: Remove dom_deprecated from everywhere but lib/dom and lib/html (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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
Index: utils/apidoc/apidoc.dart
===================================================================
--- utils/apidoc/apidoc.dart (revision 11854)
+++ utils/apidoc/apidoc.dart (working copy)
@@ -448,6 +448,7 @@
* scraped from MDN.
*/
includeMdnTypeComment(TypeMirror type) {
+ var typeString = '';
if (type.library.simpleName == HTML_LIBRARY_NAME) {
// If it's an HTML type, try to map it to a base DOM type so we can find
// the MDN docs.
@@ -459,13 +460,10 @@
// Use the corresponding DOM type when searching MDN.
// TODO(rnystrom): Shame there isn't a simpler way to get the one item
// out of a singleton Set.
- type = domTypes.iterator().next();
- } else if (type.library.simpleName != DOM_LIBRARY_NAME) {
- // Not a DOM type.
- return null;
+ typeString = domTypes.iterator().next();
}
- final mdnType = mdn[type.simpleName];
+ final mdnType = mdn[typeString];
eub 2012/09/05 21:28:11 I may be paranoid but I have a worry that mdn['']
Emily Fortuna 2012/09/05 21:57:26 Good point. I've added an else branch above so tha
if (mdnType == null) return null;
if (mdnType['skipped'] != null) return null;
@@ -480,8 +478,9 @@
*/
includeMdnMemberComment(MemberMirror member) {
var library = findLibrary(member);
+ var memberString = '';
if (library.simpleName == HTML_LIBRARY_NAME) {
- // If it's an HTML type, try to map it to a base DOM type so we can find
+ // If it's an HTML type, try to map it to a DOM name type so we can find
eub 2012/09/05 21:28:11 "DOM type name"?
Emily Fortuna 2012/09/05 21:57:26 Done.
// the MDN docs.
final domMembers = _diff.htmlToDom[member.qualifiedName];
@@ -491,23 +490,24 @@
// Use the corresponding DOM member when searching MDN.
// TODO(rnystrom): Shame there isn't a simpler way to get the one item
// out of a singleton Set.
- member = domMembers.iterator().next();
- } else if (library.simpleName != DOM_LIBRARY_NAME) {
- // Not a DOM type.
- return null;
+ memberString = domMembers.iterator().next();
}
// Ignore top-level functions.
if (member.isTopLevel) return null;
- final mdnType = mdn[member.surroundingDeclaration.simpleName];
- if (mdnType == null) return null;
- var nameToFind = member.simpleName;
var mdnMember = null;
- for (final candidateMember in mdnType['members']) {
- if (candidateMember['name'] == nameToFind) {
- mdnMember = candidateMember;
- break;
+ var mdnType = null;
+ var pieces = memberString.split('.');
+ if (pieces.length == 2) {
+ mdnType = mdn[pieces[0]];
+ if (mdnType == null) return null;
eub 2012/09/05 21:28:11 Can this happen from split()?
Emily Fortuna 2012/09/05 21:57:26 Yes, if we try to look up in the mdn dictionary a
+ var nameToFind = pieces[1];
+ for (final candidateMember in mdnType['members']) {
+ if (candidateMember['name'] == nameToFind) {
+ mdnMember = candidateMember;
+ break;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698