| 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 * This generates the reference documentation for the core libraries that come | 6 * This generates the reference documentation for the core libraries that come |
| 7 * with dart. It is built on top of dartdoc, which is a general-purpose library | 7 * with dart. It is built on top of dartdoc, which is a general-purpose library |
| 8 * for generating docs from any Dart code. This library extends that to include | 8 * for generating docs from any Dart code. This library extends that to include |
| 9 * additional information and styling specific to our standard library. | 9 * additional information and styling specific to our standard library. |
| 10 * | 10 * |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 | 544 |
| 545 // Remember which MDN page we're using so we can attribute it. | 545 // Remember which MDN page we're using so we can attribute it. |
| 546 return new MdnComment(mdnMember['help'], mdnType['srcUrl']); | 546 return new MdnComment(mdnMember['help'], mdnType['srcUrl']); |
| 547 } | 547 } |
| 548 | 548 |
| 549 /** | 549 /** |
| 550 * Returns a link to [member], relative to a type page that may be in a | 550 * Returns a link to [member], relative to a type page that may be in a |
| 551 * different library than [member]. | 551 * different library than [member]. |
| 552 */ | 552 */ |
| 553 String _linkMember(MemberMirror member) { | 553 String _linkMember(MemberMirror member) { |
| 554 final typeName = member.surroundingDeclaration.simpleName; | 554 final typeName = member.owner.simpleName; |
| 555 var memberName = '$typeName.${member.simpleName}'; | 555 var memberName = '$typeName.${member.simpleName}'; |
| 556 if (member is MethodMirror && (member.isConstructor || member.isFactory)) { | 556 if (member is MethodMirror && (member.isConstructor || member.isFactory)) { |
| 557 final separator = member.constructorName == '' ? '' : '.'; | 557 final separator = member.constructorName == '' ? '' : '.'; |
| 558 memberName = 'new $typeName$separator${member.constructorName}'; | 558 memberName = 'new $typeName$separator${member.constructorName}'; |
| 559 } | 559 } |
| 560 | 560 |
| 561 return a(memberUrl(member), memberName); | 561 return a(memberUrl(member), memberName); |
| 562 } | 562 } |
| 563 } | 563 } |
| 564 | 564 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 578 return ''' | 578 return ''' |
| 579 <div class="mdn"> | 579 <div class="mdn"> |
| 580 $mdnComment | 580 $mdnComment |
| 581 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> | 581 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> |
| 582 </div> | 582 </div> |
| 583 '''; | 583 '''; |
| 584 } | 584 } |
| 585 | 585 |
| 586 String toString() => mdnComment; | 586 String toString() => mdnComment; |
| 587 } | 587 } |
| OLD | NEW |