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

Unified Diff: pkg/compiler/lib/src/mirrors_used.dart

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 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/mirrors/dart2js_mirrors.dart ('k') | pkg/compiler/lib/src/native/behavior.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/mirrors_used.dart
diff --git a/pkg/compiler/lib/src/mirrors_used.dart b/pkg/compiler/lib/src/mirrors_used.dart
index 05f0720e63f906fe17b8cdf24ecdbb9a510121e6..ec535c77e53bd9885155c0105f3c8e82d4741fd7 100644
--- a/pkg/compiler/lib/src/mirrors_used.dart
+++ b/pkg/compiler/lib/src/mirrors_used.dart
@@ -137,7 +137,8 @@ class MirrorUsageAnalyzerTask extends CompilerTask {
if (named == null) continue;
ConstantCompiler constantCompiler = compiler.resolver.constantCompiler;
ConstantValue value =
- constantCompiler.compileNode(named.expression, mapping).value;
+ constantCompiler.getConstantValue(
+ constantCompiler.compileNode(named.expression, mapping));
MirrorUsageBuilder builder =
new MirrorUsageBuilder(
@@ -266,10 +267,11 @@ class MirrorUsageAnalyzer {
List<MirrorUsage> result = <MirrorUsage>[];
for (MetadataAnnotation metadata in tag.metadata) {
metadata.ensureResolved(compiler);
- Element element =
- metadata.constant.value.getType(compiler.coreTypes).element;
+ ConstantValue value =
+ compiler.constants.getConstantValue(metadata.constant);
+ Element element = value.getType(compiler.coreTypes).element;
if (element == compiler.mirrorsUsedClass) {
- result.add(buildUsage(metadata.constant.value));
+ result.add(buildUsage(value));
}
}
return result;
@@ -568,7 +570,7 @@ class MirrorUsageBuilder {
Spannable positionOf(ConstantValue constant) {
Node node;
elements.forEachConstantNode((Node n, ConstantExpression c) {
- if (node == null && c.value == constant) {
+ if (node == null && compiler.constants.getConstantValue(c) == constant) {
node = n;
}
});
« no previous file with comments | « pkg/compiler/lib/src/mirrors/dart2js_mirrors.dart ('k') | pkg/compiler/lib/src/native/behavior.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698