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

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

Issue 1425823004: Make dart2js accept constant null values in string interpolations. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Also test int/bool.fromEnvironment returning null. Created 5 years, 1 month 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 | tests/language/constant_string_interpolation2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index 1cc17a99d6c8ff7310c8e0f08bd0d9fcb625f78c..9558626a23f2870a03ad306e8b25f6cf00930755 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -508,7 +508,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
subexpressions.add(subexpression.expression);
ConstantValue expression = subexpression.value;
DartString expressionString;
- if (expression.isNum || expression.isBool) {
+ if (expression.isNum || expression.isBool || expression.isNull) {
PrimitiveConstantValue primitive = expression;
expressionString =
new DartString.literal(primitive.primitiveValue.toString());
« no previous file with comments | « no previous file | tests/language/constant_string_interpolation2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698