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

Unified Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 1559233002: WIP: Compute constant expressions in resolution. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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
Index: pkg/compiler/lib/src/js_backend/namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 5bb88de8ea935cdcd98a1f62080bc94c0619ee01..0ff3650c2422d62390445679154d24786ed45bff 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -1650,6 +1650,11 @@ class ConstantNamingVisitor implements ConstantValueVisitor {
}
@override
+ void visitNonConstant(NonConstantValue constant, [_]) {
+ add('null');
+ }
+
+ @override
void visitInt(IntConstantValue constant, [_]) {
// No `addRoot` since IntConstants are always inlined.
if (constant.primitiveValue < 0) {
@@ -1795,6 +1800,9 @@ class ConstantCanonicalHasher implements ConstantValueVisitor<int, Null> {
int visitNull(NullConstantValue constant, [_]) => 1;
@override
+ int visitNonConstant(NonConstantValue constant, [_]) => 1;
+
+ @override
int visitBool(BoolConstantValue constant, [_]) {
return constant.isTrue ? 2 : 3;
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/constant_system_javascript.dart ('k') | pkg/compiler/lib/src/resolution/constructors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698