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

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

Issue 1383503002: Add Resolution and Parsing interfaces for computeType, ensureResolved and parseNode. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add TODOs. Created 5 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 unified diff | Download patch
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 dart2js.mirrors; 5 library dart2js.mirrors;
6 6
7 import 'dart:collection' show UnmodifiableListView, UnmodifiableMapView; 7 import 'dart:collection' show UnmodifiableListView, UnmodifiableMapView;
8 8
9 import '../compiler.dart' show 9 import '../compiler.dart' show
10 Compiler; 10 Compiler;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 commentToken = commentToken.next; 223 commentToken = commentToken.next;
224 } 224 }
225 } 225 }
226 226
227 List<InstanceMirror> get metadata { 227 List<InstanceMirror> get metadata {
228 if (_metadata == null) { 228 if (_metadata == null) {
229 _metadata = <InstanceMirror>[]; 229 _metadata = <InstanceMirror>[];
230 for (MetadataAnnotation metadata in _element.metadata) { 230 for (MetadataAnnotation metadata in _element.metadata) {
231 _appendCommentTokens( 231 _appendCommentTokens(
232 mirrorSystem.compiler.commentMap[metadata.beginToken]); 232 mirrorSystem.compiler.commentMap[metadata.beginToken]);
233 metadata.ensureResolved(mirrorSystem.compiler); 233 metadata.ensureResolved(mirrorSystem.compiler.resolution);
234 _metadata.add(_convertConstantToInstanceMirror( 234 _metadata.add(_convertConstantToInstanceMirror(
235 mirrorSystem, metadata.constant, 235 mirrorSystem, metadata.constant,
236 mirrorSystem.compiler.constants.getConstantValue( 236 mirrorSystem.compiler.constants.getConstantValue(
237 metadata.constant))); 237 metadata.constant)));
238 } 238 }
239 _appendCommentTokens(mirrorSystem.compiler.commentMap[getBeginToken()]); 239 _appendCommentTokens(mirrorSystem.compiler.commentMap[getBeginToken()]);
240 } 240 }
241 // TODO(johnniwinther): Return an unmodifiable list instead. 241 // TODO(johnniwinther): Return an unmodifiable list instead.
242 return new List<InstanceMirror>.from(_metadata); 242 return new List<InstanceMirror>.from(_metadata);
243 } 243 }
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 if (!parameter.hasDefaultValue) return null; 486 if (!parameter.hasDefaultValue) return null;
487 ParameterElement parameterElement = parameter._element; 487 ParameterElement parameterElement = parameter._element;
488 Compiler compiler = parameter.mirrorSystem.compiler; 488 Compiler compiler = parameter.mirrorSystem.compiler;
489 return compiler.constants.getConstantForVariable(parameterElement); 489 return compiler.constants.getConstantForVariable(parameterElement);
490 } 490 }
491 491
492 static Mirror getMirrorFromElement(Dart2JsMirror mirror, Element element) { 492 static Mirror getMirrorFromElement(Dart2JsMirror mirror, Element element) {
493 return _convertElementToDeclarationMirror(mirror.mirrorSystem, element); 493 return _convertElementToDeclarationMirror(mirror.mirrorSystem, element);
494 } 494 }
495 } 495 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/type_test_registry.dart ('k') | pkg/compiler/lib/src/mirrors_used.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698