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

Unified Diff: pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart

Issue 11170005: Private constructors handled as private. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « no previous file | tests/compiler/dart2js/mirrors_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
diff --git a/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart b/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
index 1925ec252cb6ca26099b1b4699cc5b8c476eac47..b9940515ea12e33eff13306e28180e61b861c60d 100644
--- a/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
+++ b/pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart
@@ -508,23 +508,21 @@ class Dart2JsLibraryMirror extends Dart2JsObjectMirror
void _ensureTypes() {
if (_types == null) {
_types = <String, InterfaceMirror>{};
- _library.forEachExport((Element e) {
- if (e.getLibrary() == _library) {
- if (e.isClass()) {
- e.ensureResolved(system.compiler);
- var type = new Dart2JsInterfaceMirror.fromLibrary(this, e);
- assert(invariant(_library, !_types.containsKey(type.simpleName),
- message: "Type name '${type.simpleName}' "
- "is not unique in $_library."));
- _types[type.simpleName] = type;
- } else if (e.isTypedef()) {
- var type = new Dart2JsTypedefMirror.fromLibrary(this,
- e.computeType(system.compiler));
- assert(invariant(_library, !_types.containsKey(type.simpleName),
- message: "Type name '${type.simpleName}' "
- "is not unique in $_library."));
- _types[type.simpleName] = type;
- }
+ _library.forEachLocalMember((Element e) {
+ if (e.isClass()) {
+ e.ensureResolved(system.compiler);
+ var type = new Dart2JsInterfaceMirror.fromLibrary(this, e);
+ assert(invariant(_library, !_types.containsKey(type.simpleName),
+ message: "Type name '${type.simpleName}' "
+ "is not unique in $_library."));
+ _types[type.simpleName] = type;
+ } else if (e.isTypedef()) {
+ var type = new Dart2JsTypedefMirror.fromLibrary(this,
+ e.computeType(system.compiler));
+ assert(invariant(_library, !_types.containsKey(type.simpleName),
+ message: "Type name '${type.simpleName}' "
+ "is not unique in $_library."));
+ _types[type.simpleName] = type;
}
});
}
@@ -533,7 +531,7 @@ class Dart2JsLibraryMirror extends Dart2JsObjectMirror
void _ensureMembers() {
if (_members == null) {
_members = <String, MemberMirror>{};
- _library.forEachExport((Element e) {
+ _library.forEachLocalMember((Element e) {
if (!e.isClass() && !e.isTypedef()) {
for (var member in _convertElementMemberToMemberMirrors(this, e)) {
assert(!_members.containsKey(member.simpleName));
@@ -1305,7 +1303,8 @@ class Dart2JsMethodMirror extends Dart2JsElementMirror
bool get isMethod => !isConstructor;
- bool get isPrivate => _isPrivate(simpleName);
+ bool get isPrivate =>
+ isConstructor ? _isPrivate(constructorName) : _isPrivate(simpleName);
bool get isStatic => _function.modifiers.isStatic();
« no previous file with comments | « no previous file | tests/compiler/dart2js/mirrors_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698