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

Unified Diff: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart

Issue 1050133006: Add structural equality to ConstantExpression. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
index 2b2d6ec85536b48bfefb58400255b35bb957da06..6ec2d1cb31de692824c56335d5a14d054c3e1e3f 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -7,8 +7,7 @@
library sexpr_unstringifier;
-import 'package:compiler/src/constants/expressions.dart'
- show PrimitiveConstantExpression;
+import 'package:compiler/src/constants/expressions.dart';
import 'package:compiler/src/constants/values.dart';
import 'package:compiler/src/dart2jslib.dart' as dart2js
show MessageKind;
@@ -617,16 +616,16 @@ class SExpressionUnstringifier {
switch (tag) {
case NULL:
result = new Constant(
- new PrimitiveConstantExpression(new NullConstantValue()));
+ new NullConstantExpression(new NullConstantValue()));
break;
case BOOL:
String value = tokens.read();
if (value == "true") {
result = new Constant(
- new PrimitiveConstantExpression(new TrueConstantValue()));
+ new BoolConstantExpression(true, new TrueConstantValue()));
} else if (value == "false") {
result = new Constant(
- new PrimitiveConstantExpression(new FalseConstantValue()));
+ new BoolConstantExpression(false, new FalseConstantValue()));
} else {
throw "Invalid Boolean value '$value'.";
}
@@ -638,9 +637,10 @@ class SExpressionUnstringifier {
} while (tokens.current != ")");
String string = strings.join(" ");
assert(string.startsWith('"') && string.endsWith('"'));
+ String text = string.substring(1, string.length - 1);
StringConstantValue value = new StringConstantValue(
- new LiteralDartString(string.substring(1, string.length - 1)));
- result = new Constant(new PrimitiveConstantExpression(value));
+ new LiteralDartString(text));
+ result = new Constant(new StringConstantExpression(text, value));
break;
case INT:
String value = tokens.read();
@@ -648,8 +648,8 @@ class SExpressionUnstringifier {
if (intValue == null) {
throw "Invalid int value 'value'.";
}
- result = new Constant(
- new PrimitiveConstantExpression(new IntConstantValue(intValue)));
+ result = new Constant(new IntConstantExpression(
+ intValue, new IntConstantValue(intValue)));
break;
case DOUBLE:
String value = tokens.read();
@@ -657,8 +657,8 @@ class SExpressionUnstringifier {
if (doubleValue == null) {
throw "Invalid double value '$value'.";
}
- result = new Constant(new PrimitiveConstantExpression(
- new DoubleConstantValue(doubleValue)));
+ result = new Constant(new DoubleConstantExpression(
+ doubleValue, new DoubleConstantValue(doubleValue)));
break;
default:
throw "Unexpected constant tag '$tag'.";
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698