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

Side by Side Diff: pkg/docgen/lib/src/models/class.dart

Issue 258753004: Use UnmodifiableMapView in compiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: a few more nits Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart2jslib.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library docgen.models.clazz; 5 library docgen.models.clazz;
6 6
7 import '../exports/dart2js_mirrors.dart' as dart2js_mirrors; 7 import '../exports/dart2js_mirrors.dart' as dart2js_mirrors;
8 import '../exports/mirrors_util.dart' as dart2js_util; 8 import '../exports/mirrors_util.dart' as dart2js_util;
9 import '../exports/source_mirrors.dart'; 9 import '../exports/source_mirrors.dart';
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // The reason we do this madness is the superclass and interface owners may 79 // The reason we do this madness is the superclass and interface owners may
80 // not be this class's owner!! Example: BaseClient in http pkg. 80 // not be this class's owner!! Example: BaseClient in http pkg.
81 var superinterfaces = classMirror.superinterfaces.map( 81 var superinterfaces = classMirror.superinterfaces.map(
82 (interface) => new Class._possiblyDifferentOwner(interface, owner)); 82 (interface) => new Class._possiblyDifferentOwner(interface, owner));
83 this._superclass = classMirror.superclass == null? null : 83 this._superclass = classMirror.superclass == null? null :
84 new Class._possiblyDifferentOwner(classMirror.superclass, owner); 84 new Class._possiblyDifferentOwner(classMirror.superclass, owner);
85 85
86 interfaces = superinterfaces.toList(); 86 interfaces = superinterfaces.toList();
87 variables = createVariables( 87 variables = createVariables(
88 dart2js_util.variablesOf(classMirror.declarations), this); 88 dart2js_util.variablesOf(classMirror.declarations), this);
89 methods = createMethods(classMirror.declarations.values.where( 89 methods = createMethods(dart2js_util.anyMethodOf(classMirror.declarations),
90 (mirror) => mirror is MethodMirror), this); 90 this);
91 91
92 // Tell superclass that you are a subclass, unless you are not 92 // Tell superclass that you are a subclass, unless you are not
93 // visible or an intermediary mixin class. 93 // visible or an intermediary mixin class.
94 if (!classMirror.isNameSynthetic && isVisible && _superclass != null) { 94 if (!classMirror.isNameSynthetic && isVisible && _superclass != null) {
95 _superclass.addSubclass(this); 95 _superclass.addSubclass(this);
96 } 96 }
97 97
98 if (this._superclass != null) addInherited(_superclass); 98 if (this._superclass != null) addInherited(_superclass);
99 interfaces.forEach((interface) => addInherited(interface)); 99 interfaces.forEach((interface) => addInherited(interface));
100 } 100 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 'methods': expandMethodMap(methods), 236 'methods': expandMethodMap(methods),
237 'inheritedMethods': expandMethodMap(inheritedMethods), 237 'inheritedMethods': expandMethodMap(inheritedMethods),
238 'annotations': annotations.map((a) => a.toMap()).toList(), 238 'annotations': annotations.map((a) => a.toMap()).toList(),
239 'generics': recurseMap(generics) 239 'generics': recurseMap(generics)
240 }; 240 };
241 241
242 int compareTo(Class other) => name.compareTo(other.name); 242 int compareTo(Class other) => name.compareTo(other.name);
243 243
244 bool isValidMirror(DeclarationMirror mirror) => mirror is ClassMirror; 244 bool isValidMirror(DeclarationMirror mirror) => mirror is ClassMirror;
245 } 245 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart2jslib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698