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

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
« no previous file with comments | « lib/compiler/implementation/native_handler.dart ('k') | utils/apidoc/html_diff.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/apidoc.dart
===================================================================
--- utils/apidoc/apidoc.dart (revision 11903)
+++ 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,13 @@
// 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) {
+ typeString = domTypes.iterator().next();
+ } else {
// Not a DOM type.
return null;
}
- final mdnType = mdn[type.simpleName];
+ final mdnType = mdn[typeString];
if (mdnType == null) return null;
if (mdnType['skipped'] != null) return null;
@@ -480,8 +481,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 type name so we can find
// the MDN docs.
final domMembers = _diff.htmlToDom[member.qualifiedName];
@@ -491,8 +493,8 @@
// 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) {
+ memberString = domMembers.iterator().next();
+ } else {
// Not a DOM type.
return null;
}
@@ -500,14 +502,18 @@
// 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;
+ var nameToFind = pieces[1];
+ for (final candidateMember in mdnType['members']) {
+ if (candidateMember['name'] == nameToFind) {
+ mdnMember = candidateMember;
+ break;
+ }
}
}
« no previous file with comments | « lib/compiler/implementation/native_handler.dart ('k') | utils/apidoc/html_diff.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698