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

Side by Side Diff: pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart

Issue 1916053003: Add toStructuredText to ConstantExpression and align method names with ConstantValue (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt Created 4 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart2js.mirrors; 5 part of dart2js.mirrors;
6 6
7 abstract class ObjectMirrorMixin implements ObjectMirror { 7 abstract class ObjectMirrorMixin implements ObjectMirror {
8 InstanceMirror getField(Symbol fieldName) { 8 InstanceMirror getField(Symbol fieldName) {
9 throw new UnsupportedError('ObjectMirror.getField unsupported.'); 9 throw new UnsupportedError('ObjectMirror.getField unsupported.');
10 } 10 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 class Dart2JsConstantMirror extends Object 66 class Dart2JsConstantMirror extends Object
67 with ObjectMirrorMixin, InstanceMirrorMixin { 67 with ObjectMirrorMixin, InstanceMirrorMixin {
68 final Dart2JsMirrorSystem mirrorSystem; 68 final Dart2JsMirrorSystem mirrorSystem;
69 final ConstantExpression _constant; 69 final ConstantExpression _constant;
70 final ConstantValue _value; 70 final ConstantValue _value;
71 71
72 Dart2JsConstantMirror(this.mirrorSystem, this._constant, this._value); 72 Dart2JsConstantMirror(this.mirrorSystem, this._constant, this._value);
73 73
74 String toString() { 74 String toString() {
75 if (_constant != null) { 75 if (_constant != null) {
76 return _constant.getText(); 76 return _constant.toDartText();
77 } else { 77 } else {
78 return _value.unparse(); 78 return _value.toDartText();
79 } 79 }
80 } 80 }
81 81
82 ClassMirror get type { 82 ClassMirror get type {
83 return mirrorSystem._getTypeDeclarationMirror( 83 return mirrorSystem._getTypeDeclarationMirror(
84 _value.getType(mirrorSystem.compiler.coreTypes).element); 84 _value.getType(mirrorSystem.compiler.coreTypes).element);
85 } 85 }
86 86
87 int get hashCode => 13 * _constant.hashCode; 87 int get hashCode => 13 * _constant.hashCode;
88 88
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 return new Dart2JsBoolConstantMirror.fromBool(mirrorSystem, isDocComment); 277 return new Dart2JsBoolConstantMirror.fromBool(mirrorSystem, isDocComment);
278 } else if (fieldName == #text) { 278 } else if (fieldName == #text) {
279 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, text); 279 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, text);
280 } else if (fieldName == #trimmedText) { 280 } else if (fieldName == #trimmedText) {
281 return new Dart2JsStringConstantMirror.fromString( 281 return new Dart2JsStringConstantMirror.fromString(
282 mirrorSystem, trimmedText); 282 mirrorSystem, trimmedText);
283 } 283 }
284 return super.getField(fieldName); 284 return super.getField(fieldName);
285 } 285 }
286 } 286 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart ('k') | pkg/compiler/lib/src/resolution/class_hierarchy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698