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

Side by Side Diff: pkg/dartdoc/lib/src/mirrors/dart2js_mirror.dart

Issue 11359005: Cleanup run on DartDoc tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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
OLDNEW
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 library mirrors_dart2js; 5 library mirrors_dart2js;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 import '../../../../../lib/compiler/compiler.dart' as diagnostics; 10 import '../../../../../lib/compiler/compiler.dart' as diagnostics;
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 abstract class Dart2JsTypeMirror extends Dart2JsDeclarationMirror 413 abstract class Dart2JsTypeMirror extends Dart2JsDeclarationMirror
414 implements TypeMirror { 414 implements TypeMirror {
415 415
416 } 416 }
417 417
418 abstract class Dart2JsElementMirror extends Dart2JsDeclarationMirror { 418 abstract class Dart2JsElementMirror extends Dart2JsDeclarationMirror {
419 final Dart2JsMirrorSystem mirrors; 419 final Dart2JsMirrorSystem mirrors;
420 final Element _element; 420 final Element _element;
421 421
422 Dart2JsElementMirror(this.mirrors, this._element) { 422 Dart2JsElementMirror(this.mirrors, this._element) {
423 assert (mirrors !== null); 423 assert (mirrors != null);
424 assert (_element !== null); 424 assert (_element != null);
425 } 425 }
426 426
427 String get simpleName => _element.name.slowToString(); 427 String get simpleName => _element.name.slowToString();
428 428
429 String get displayName => simpleName; 429 String get displayName => simpleName;
430 430
431 SourceLocation get location => new Dart2JsLocation( 431 SourceLocation get location => new Dart2JsLocation(
432 _element.getCompilationUnit().script, 432 _element.getCompilationUnit().script,
433 mirrors.compiler.spanFromElement(_element)); 433 mirrors.compiler.spanFromElement(_element));
434 434
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 _convertTypeToTypeMirror(this, compiler.types.voidType, null); 487 _convertTypeToTypeMirror(this, compiler.types.voidType, null);
488 } 488 }
489 489
490 abstract class Dart2JsContainerMirror extends Dart2JsElementMirror 490 abstract class Dart2JsContainerMirror extends Dart2JsElementMirror
491 implements ContainerMirror { 491 implements ContainerMirror {
492 Map<String, MemberMirror> _members; 492 Map<String, MemberMirror> _members;
493 493
494 Dart2JsContainerMirror(Dart2JsMirrorSystem system, Element element) 494 Dart2JsContainerMirror(Dart2JsMirrorSystem system, Element element)
495 : super(system, element); 495 : super(system, element);
496 496
497 abstract void _ensureMembers(); 497 void _ensureMembers();
498 498
499 Map<String, MemberMirror> get members { 499 Map<String, MemberMirror> get members {
500 _ensureMembers(); 500 _ensureMembers();
501 return new ImmutableMapWrapper<String, MemberMirror>(_members); 501 return new ImmutableMapWrapper<String, MemberMirror>(_members);
502 } 502 }
503 503
504 Map<String, MethodMirror> get functions { 504 Map<String, MethodMirror> get functions {
505 _ensureMembers(); 505 _ensureMembers();
506 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>( 506 return new AsFilteredImmutableMap<String, MemberMirror, MethodMirror>(
507 _members, 507 _members,
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 : this.library = library, 754 : this.library = library,
755 super(library.mirrors, _class); 755 super(library.mirrors, _class);
756 756
757 DeclarationMirror get owner => library; 757 DeclarationMirror get owner => library;
758 758
759 String get qualifiedName => '${library.qualifiedName}.${simpleName}'; 759 String get qualifiedName => '${library.qualifiedName}.${simpleName}';
760 760
761 SourceLocation get location { 761 SourceLocation get location {
762 if (_class is PartialClassElement) { 762 if (_class is PartialClassElement) {
763 var node = _class.parseNode(mirrors.compiler); 763 var node = _class.parseNode(mirrors.compiler);
764 if (node !== null) { 764 if (node != null) {
765 var script = _class.getCompilationUnit().script; 765 var script = _class.getCompilationUnit().script;
766 var span = mirrors.compiler.spanFromNode(node, script.uri); 766 var span = mirrors.compiler.spanFromNode(node, script.uri);
767 return new Dart2JsLocation(script, span); 767 return new Dart2JsLocation(script, span);
768 } 768 }
769 } 769 }
770 return super.location; 770 return super.location;
771 } 771 }
772 772
773 void _ensureMembers() { 773 void _ensureMembers() {
774 if (_members == null) { 774 if (_members == null) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 _typeVariables = <TypeVariableMirror>[]; 918 _typeVariables = <TypeVariableMirror>[];
919 for (TypeVariableType typeVariable in _typedef.typeArguments) { 919 for (TypeVariableType typeVariable in _typedef.typeArguments) {
920 _typeVariables.add( 920 _typeVariables.add(
921 new Dart2JsTypeVariableMirror(mirrors, typeVariable)); 921 new Dart2JsTypeVariableMirror(mirrors, typeVariable));
922 } 922 }
923 } 923 }
924 return _typeVariables; 924 return _typeVariables;
925 } 925 }
926 926
927 TypeMirror get value { 927 TypeMirror get value {
928 if (_definition === null) { 928 if (_definition == null) {
929 // TODO(johnniwinther): Should be [ensureResolved]. 929 // TODO(johnniwinther): Should be [ensureResolved].
930 mirrors.compiler.resolveTypedef(_typedef.element); 930 mirrors.compiler.resolveTypedef(_typedef.element);
931 _definition = _convertTypeToTypeMirror( 931 _definition = _convertTypeToTypeMirror(
932 mirrors, 932 mirrors,
933 _typedef.element.alias, 933 _typedef.element.alias,
934 mirrors.compiler.types.dynamicType, 934 mirrors.compiler.types.dynamicType,
935 _typedef.element.functionSignature); 935 _typedef.element.functionSignature);
936 } 936 }
937 return _definition; 937 return _definition;
938 } 938 }
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 1219
1220 List<TypeVariableMirror> get typeVariables => 1220 List<TypeVariableMirror> get typeVariables =>
1221 originalDeclaration.typeVariables; 1221 originalDeclaration.typeVariables;
1222 1222
1223 TypeMirror get returnType { 1223 TypeMirror get returnType {
1224 return _convertTypeToTypeMirror(mirrors, _functionType.returnType, 1224 return _convertTypeToTypeMirror(mirrors, _functionType.returnType,
1225 mirrors.compiler.types.dynamicType); 1225 mirrors.compiler.types.dynamicType);
1226 } 1226 }
1227 1227
1228 List<ParameterMirror> get parameters { 1228 List<ParameterMirror> get parameters {
1229 if (_parameters === null) { 1229 if (_parameters == null) {
1230 _parameters = _parametersFromFunctionSignature(mirrors, callMethod, 1230 _parameters = _parametersFromFunctionSignature(mirrors, callMethod,
1231 _functionSignature); 1231 _functionSignature);
1232 } 1232 }
1233 return _parameters; 1233 return _parameters;
1234 } 1234 }
1235 } 1235 }
1236 1236
1237 class Dart2JsVoidMirror extends Dart2JsTypeElementMirror { 1237 class Dart2JsVoidMirror extends Dart2JsTypeElementMirror {
1238 1238
1239 Dart2JsVoidMirror(Dart2JsMirrorSystem system, VoidType voidType) 1239 Dart2JsVoidMirror(Dart2JsMirrorSystem system, VoidType voidType)
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 1466
1467 bool get isConst => _variable.modifiers.isConst(); 1467 bool get isConst => _variable.modifiers.isConst();
1468 1468
1469 TypeMirror get type => _convertTypeToTypeMirror(mirrors, 1469 TypeMirror get type => _convertTypeToTypeMirror(mirrors,
1470 _variable.computeType(mirrors.compiler), 1470 _variable.computeType(mirrors.compiler),
1471 mirrors.compiler.types.dynamicType); 1471 mirrors.compiler.types.dynamicType);
1472 1472
1473 SourceLocation get location { 1473 SourceLocation get location {
1474 var script = _variable.getCompilationUnit().script; 1474 var script = _variable.getCompilationUnit().script;
1475 var node = _variable.variables.parseNode(_diagnosticListener); 1475 var node = _variable.variables.parseNode(_diagnosticListener);
1476 if (node !== null) { 1476 if (node != null) {
1477 var span = mirrors.compiler.spanFromNode(node, script.uri); 1477 var span = mirrors.compiler.spanFromNode(node, script.uri);
1478 return new Dart2JsLocation(script, span); 1478 return new Dart2JsLocation(script, span);
1479 } else { 1479 } else {
1480 var span = mirrors.compiler.spanFromElement(_variable); 1480 var span = mirrors.compiler.spanFromElement(_variable);
1481 return new Dart2JsLocation(script, span); 1481 return new Dart2JsLocation(script, span);
1482 } 1482 }
1483 } 1483 }
1484 } 1484 }
1485 1485
OLDNEW
« no previous file with comments | « no previous file | pkg/dartdoc/test/dartdoc_search_test.dart » ('j') | pkg/dartdoc/test/markdown_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698