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

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

Issue 2940283002: [kernel] Fix assert message. (Closed)
Patch Set: Created 3 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/kernel/binary.md » ('j') | pkg/kernel/lib/ast.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 3d17400b0046cd784ac662092a11eb7d31bc67db..e39b1e2ebaf14ce2d396c662d1b761c159300141 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -2658,6 +2658,10 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
Expression message = popForValueIfNotNull(commaToken);
Expression condition = popForValue();
AssertStatement statement = new AssertStatement(condition, message);
+ statement.conditionStartOffset = leftParenthesis.next.offset;
+ Token lastTokenInCondition = rightParenthesis.previous;
ahe 2017/06/16 07:39:42 We want to get rid of "previous". Could you do som
jensj 2017/06/16 07:43:29 I could. But: 1) I suppose an assert can be arbitr
ahe 2017/06/16 07:53:35 statement.conditionStartOffset = leftParenthesis.o
jensj 2017/06/16 09:28:25 Actually not -1 on the end as that would could off
+ statement.conditionEndOffset =
+ lastTokenInCondition.offset + lastTokenInCondition.length;
switch (kind) {
case Assert.Statement:
push(statement);
« no previous file with comments | « no previous file | pkg/kernel/binary.md » ('j') | pkg/kernel/lib/ast.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698