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

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

Issue 1936463002: Fix invariant breakage on erroneous constant variables. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/constants/expressions.dart
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart
index aa284cd20ceb174fe169a5ec994c99f4c2c0eed2..a9735065e098ea84d3adba28515d12d208df9be7 100644
--- a/pkg/compiler/lib/src/constants/expressions.dart
+++ b/pkg/compiler/lib/src/constants/expressions.dart
@@ -1261,7 +1261,11 @@ class BoolFromEnvironmentConstantExpression
sb.write('bool.fromEnvironment(name=');
name._createStructuredText(sb);
sb.write(',defaultValue=');
- defaultValue._createStructuredText(sb);
+ if (defaultValue != null) {
+ defaultValue._createStructuredText(sb);
+ } else {
+ sb.write('null');
+ }
sb.write(')');
}
@@ -1320,7 +1324,11 @@ class IntFromEnvironmentConstantExpression
sb.write('int.fromEnvironment(name=');
name._createStructuredText(sb);
sb.write(',defaultValue=');
- defaultValue._createStructuredText(sb);
+ if (defaultValue != null) {
+ defaultValue._createStructuredText(sb);
+ } else {
+ sb.write('null');
+ }
sb.write(')');
}
@@ -1381,7 +1389,11 @@ class StringFromEnvironmentConstantExpression
sb.write('String.fromEnvironment(name=');
name._createStructuredText(sb);
sb.write(',defaultValue=');
- defaultValue._createStructuredText(sb);
+ if (defaultValue != null) {
+ defaultValue._createStructuredText(sb);
+ } else {
+ sb.write('null');
+ }
sb.write(')');
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698