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

Unified Diff: pkg/compiler/lib/src/constants/constant_constructors.dart

Issue 2116483002: Handle constant ?? expressions in constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/constants/constant_constructors.dart
diff --git a/pkg/compiler/lib/src/constants/constant_constructors.dart b/pkg/compiler/lib/src/constants/constant_constructors.dart
index 3dceb5981154c919a4954fed7e238248ad4a3595..4628f28629ef34f1e98467950eef14de9372289c 100644
--- a/pkg/compiler/lib/src/constants/constant_constructors.dart
+++ b/pkg/compiler/lib/src/constants/constant_constructors.dart
@@ -339,4 +339,10 @@ class ConstantConstructorComputer extends SemanticVisitor
ConstantExpression visitNamedArgument(NamedArgument node) {
return apply(node.expression);
}
+
+ @override
+ ConstantExpression visitIfNull(Send node, Node left, Node right, _) {
+ return new BinaryConstantExpression(
+ apply(left), BinaryOperator.IF_NULL, apply(right));
+ }
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698