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

Side by Side Diff: dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 16101007: Implement LibraryMirror.metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix issues found during testing. Created 7 years, 6 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) 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 library elements.modelx; 5 library elements.modelx;
6 6
7 import 'dart:collection' show LinkedHashMap; 7 import 'dart:collection' show LinkedHashMap;
8 8
9 import 'elements.dart'; 9 import 'elements.dart';
10 import '../../compiler.dart' as api; 10 import '../../compiler.dart' as api;
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 origin.patch = this; 587 origin.patch = this;
588 } 588 }
589 } 589 }
590 590
591 bool get isPatched => patch != null; 591 bool get isPatched => patch != null;
592 bool get isPatch => origin != null; 592 bool get isPatch => origin != null;
593 593
594 LibraryElement get declaration => super.declaration; 594 LibraryElement get declaration => super.declaration;
595 LibraryElement get implementation => super.implementation; 595 LibraryElement get implementation => super.implementation;
596 596
597 Link<MetadataAnnotation> get metadata {
598 return (libraryTag == null) ? super.metadata : libraryTag.metadata;
599 }
600
601 set metadata(value) {
602 // The metadata is stored on the library name.
kasperl 2013/05/30 13:16:39 name -> tag?
ahe 2013/05/30 13:28:45 Done.
603 throw new SpannableAssertionFailure(this, 'Cannot set metadata on Library');
604 }
605
597 CompilationUnitElement getCompilationUnit() => entryCompilationUnit; 606 CompilationUnitElement getCompilationUnit() => entryCompilationUnit;
598 607
599 void addCompilationUnit(CompilationUnitElement element) { 608 void addCompilationUnit(CompilationUnitElement element) {
600 compilationUnits = compilationUnits.prepend(element); 609 compilationUnits = compilationUnits.prepend(element);
601 } 610 }
602 611
603 void addTag(LibraryTag tag, DiagnosticListener listener) { 612 void addTag(LibraryTag tag, DiagnosticListener listener) {
604 tags = tags.prepend(tag); 613 tags = tags.prepend(tag);
605 } 614 }
606 615
(...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 2107
2099 MetadataAnnotation ensureResolved(Compiler compiler) { 2108 MetadataAnnotation ensureResolved(Compiler compiler) {
2100 if (resolutionState == STATE_NOT_STARTED) { 2109 if (resolutionState == STATE_NOT_STARTED) {
2101 compiler.resolver.resolveMetadataAnnotation(this); 2110 compiler.resolver.resolveMetadataAnnotation(this);
2102 } 2111 }
2103 return this; 2112 return this;
2104 } 2113 }
2105 2114
2106 String toString() => 'MetadataAnnotation($value, $resolutionState)'; 2115 String toString() => 'MetadataAnnotation($value, $resolutionState)';
2107 } 2116 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698