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

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

Issue 10919033: Rework Unparser/unparse StringBuffer management. (Closed) Base URL: https://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 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('../../../lib/compiler/compiler.dart', prefix: 'diagnostics'); 7 #import('../../../lib/compiler/compiler.dart', prefix: 'diagnostics');
8 #import('../../../lib/compiler/implementation/elements/elements.dart'); 8 #import('../../../lib/compiler/implementation/elements/elements.dart');
9 #import('../../../lib/compiler/implementation/apiimpl.dart', prefix: 'api'); 9 #import('../../../lib/compiler/implementation/apiimpl.dart', prefix: 'api');
10 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart'); 10 #import('../../../lib/compiler/implementation/scanner/scannerlib.dart');
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 String get qualifiedName() => '${_method.qualifiedName}#${simpleName}'; 603 String get qualifiedName() => '${_method.qualifiedName}#${simpleName}';
604 604
605 TypeMirror get type() => _convertTypeToTypeMirror(system, 605 TypeMirror get type() => _convertTypeToTypeMirror(system,
606 _variableElement.computeType(system.compiler), 606 _variableElement.computeType(system.compiler),
607 system.compiler.types.dynamicType, 607 system.compiler.types.dynamicType,
608 _variableElement.variables.functionSignature); 608 _variableElement.variables.functionSignature);
609 609
610 String get defaultValue() { 610 String get defaultValue() {
611 if (hasDefaultValue) { 611 if (hasDefaultValue) {
612 SendSet expression = _variableElement.cachedNode.asSendSet(); 612 SendSet expression = _variableElement.cachedNode.asSendSet();
613 return expression.arguments.head.unparse(); 613 return unparse(expression.arguments.head);
614 } 614 }
615 return null; 615 return null;
616 } 616 }
617 bool get hasDefaultValue() { 617 bool get hasDefaultValue() {
618 return _variableElement.cachedNode !== null && 618 return _variableElement.cachedNode !== null &&
619 _variableElement.cachedNode is SendSet; 619 _variableElement.cachedNode is SendSet;
620 } 620 }
621 621
622 bool get isInitializingFormal() => false; 622 bool get isInitializingFormal() => false;
623 623
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
1381 if (node !== null) { 1381 if (node !== null) {
1382 var span = system.compiler.spanFromNode(node, script.uri); 1382 var span = system.compiler.spanFromNode(node, script.uri);
1383 return new Dart2JsLocation(script, span); 1383 return new Dart2JsLocation(script, span);
1384 } else { 1384 } else {
1385 var span = system.compiler.spanFromElement(_variable); 1385 var span = system.compiler.spanFromElement(_variable);
1386 return new Dart2JsLocation(script, span); 1386 return new Dart2JsLocation(script, span);
1387 } 1387 }
1388 } 1388 }
1389 } 1389 }
1390 1390
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698