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

Unified Diff: pkg/fasta/lib/src/kernel/body_builder.dart

Issue 2639903005: Apply toValue conversion on assert messages. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | pkg/fasta/test/language.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fasta/lib/src/kernel/body_builder.dart
diff --git a/pkg/fasta/lib/src/kernel/body_builder.dart b/pkg/fasta/lib/src/kernel/body_builder.dart
index 3446c5564a7948be997a9d9bb53264103639af78..10c608be2f3ce4d8632287de0fb122ed8cc3c386 100644
--- a/pkg/fasta/lib/src/kernel/body_builder.dart
+++ b/pkg/fasta/lib/src/kernel/body_builder.dart
@@ -169,6 +169,10 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
Expression popForEffect() => toEffect(pop());
+ Expression popForValueIfNotNull(Object value) {
+ return value == null ? null : popForValue();
+ }
+
@override
Expression toValue(Object node) {
if (node is UnresolvedIdentifier) {
@@ -1911,7 +1915,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
void handleAssertStatement(
Token assertKeyword, Token commaToken, Token semicolonToken) {
debugEvent("AssertStatement");
- Expression message = popIfNotNull(commaToken);
+ Expression message = popForValueIfNotNull(commaToken);
Expression condition = popForValue();
push(new AssertStatement(condition, message));
}
« no previous file with comments | « no previous file | pkg/fasta/test/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698