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

Unified Diff: pkg/compiler/lib/src/resolution/resolution_strategy.dart

Issue 2854013002: Make JavaScriptBackend.processAnnotations element-model agnostic (Closed)
Patch Set: Fix and check declaration invariant. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/resolution_strategy.dart
diff --git a/pkg/compiler/lib/src/resolution/resolution_strategy.dart b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
index 4c23914b1104b4d34544c835cec9082054cdfb43..2eb93c6266de0b0d93fc2d0a3121f13ef22d14e5 100644
--- a/pkg/compiler/lib/src/resolution/resolution_strategy.dart
+++ b/pkg/compiler/lib/src/resolution/resolution_strategy.dart
@@ -10,8 +10,8 @@ import '../common/backend_api.dart';
import '../common/names.dart';
import '../common/resolution.dart';
import '../common/tasks.dart';
-import '../constants/values.dart';
import '../compiler.dart';
+import '../constants/values.dart';
import '../elements/elements.dart';
import '../elements/entities.dart';
import '../elements/modelx.dart';
@@ -425,6 +425,22 @@ class _CompilerElementEnvironment implements ElementEnvironment {
type.computeUnaliased(_resolution);
return type.unaliased;
}
+
+ @override
+ Iterable<ConstantValue> getMemberMetadata(MemberElement element) {
+ List<ConstantValue> values = <ConstantValue>[];
+ _compiler.reporter.withCurrentElement(element, () {
+ for (MetadataAnnotation metadata in element.implementation.metadata) {
+ metadata.ensureResolved(_compiler.resolution);
+ assert(invariant(metadata, metadata.constant != null,
+ message: "Unevaluated metadata constant."));
+ ConstantValue value =
+ _compiler.constants.getConstantValue(metadata.constant);
+ values.add(value);
+ }
+ });
+ return values;
+ }
}
/// AST-based logic for processing annotations. These annotations are processed
« no previous file with comments | « pkg/compiler/lib/src/kernel/element_map.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698