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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirrors.dart

Issue 221873002: Compute frontend/backend specific constants. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes 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
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; 7 import 'dart:collection' show UnmodifiableListView;
8 8
9 import '../elements/elements.dart'; 9 import '../elements/elements.dart';
10 import '../scanner/scannerlib.dart'; 10 import '../scanner/scannerlib.dart';
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 } 224 }
225 225
226 List<InstanceMirror> get metadata { 226 List<InstanceMirror> get metadata {
227 if (_metadata == null) { 227 if (_metadata == null) {
228 _metadata = <InstanceMirror>[]; 228 _metadata = <InstanceMirror>[];
229 for (MetadataAnnotation metadata in _element.metadata) { 229 for (MetadataAnnotation metadata in _element.metadata) {
230 _appendCommentTokens( 230 _appendCommentTokens(
231 mirrorSystem.compiler.commentMap[metadata.beginToken]); 231 mirrorSystem.compiler.commentMap[metadata.beginToken]);
232 metadata.ensureResolved(mirrorSystem.compiler); 232 metadata.ensureResolved(mirrorSystem.compiler);
233 _metadata.add( 233 _metadata.add(_convertConstantToInstanceMirror(mirrorSystem,
234 _convertConstantToInstanceMirror(mirrorSystem, metadata.value)); 234 metadata.value));
235 } 235 }
236 _appendCommentTokens(mirrorSystem.compiler.commentMap[getBeginToken()]); 236 _appendCommentTokens(mirrorSystem.compiler.commentMap[getBeginToken()]);
237 } 237 }
238 // TODO(johnniwinther): Return an unmodifiable list instead. 238 // TODO(johnniwinther): Return an unmodifiable list instead.
239 return new List<InstanceMirror>.from(_metadata); 239 return new List<InstanceMirror>.from(_metadata);
240 } 240 }
241 241
242 DeclarationMirror lookupInScope(String name) { 242 DeclarationMirror lookupInScope(String name) {
243 // TODO(11653): Support lookup of constructors. 243 // TODO(11653): Support lookup of constructors.
244 Scope scope = _element.buildScope(); 244 Scope scope = _element.buildScope();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 * 458 *
459 * All API in this class is experimental. 459 * All API in this class is experimental.
460 */ 460 */
461 class BackDoor { 461 class BackDoor {
462 /// Return the compilation units comprising [library]. 462 /// Return the compilation units comprising [library].
463 static List<Mirror> compilationUnitsOf(Dart2JsLibraryMirror library) { 463 static List<Mirror> compilationUnitsOf(Dart2JsLibraryMirror library) {
464 return library._element.compilationUnits.toList().map( 464 return library._element.compilationUnits.toList().map(
465 (cu) => new Dart2JsCompilationUnitMirror(cu, library)).toList(); 465 (cu) => new Dart2JsCompilationUnitMirror(cu, library)).toList();
466 } 466 }
467 } 467 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698