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

Unified Diff: pkg/kernel/lib/binary/ast_from_binary.dart

Issue 2999633002: [kernel] Offsets on loops (Closed)
Patch Set: Fix long line Created 3 years, 4 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
Index: pkg/kernel/lib/binary/ast_from_binary.dart
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
index b7a7113693733cd48c7bf45556ce245d8d1e823a..aaee9d2ac20e4826a2d8572b3cc0b30f66539c77 100644
--- a/pkg/kernel/lib/binary/ast_from_binary.dart
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -1017,28 +1017,36 @@ class BinaryBuilder {
return new BreakStatement(labelStack[labelStackBase + index])
..fileOffset = offset;
case Tag.WhileStatement:
- return new WhileStatement(readExpression(), readStatement());
+ var offset = readOffset();
+ return new WhileStatement(readExpression(), readStatement())
+ ..fileOffset = offset;
case Tag.DoStatement:
- return new DoStatement(readStatement(), readExpression());
+ var offset = readOffset();
+ return new DoStatement(readStatement(), readExpression())
+ ..fileOffset = offset;
case Tag.ForStatement:
int variableStackHeight = variableStack.length;
+ var offset = readOffset();
var variables = readAndPushVariableDeclarationList();
var condition = readExpressionOption();
var updates = readExpressionList();
var body = readStatement();
variableStack.length = variableStackHeight;
- return new ForStatement(variables, condition, updates, body);
+ return new ForStatement(variables, condition, updates, body)
+ ..fileOffset = offset;
case Tag.ForInStatement:
case Tag.AsyncForInStatement:
bool isAsync = tag == Tag.AsyncForInStatement;
int variableStackHeight = variableStack.length;
var offset = readOffset();
+ var bodyOffset = readOffset();
var variable = readAndPushVariableDeclaration();
var iterable = readExpression();
var body = readStatement();
variableStack.length = variableStackHeight;
return new ForInStatement(variable, iterable, body, isAsync: isAsync)
- ..fileOffset = offset;
+ ..fileOffset = offset
+ ..bodyOffset = bodyOffset;
case Tag.SwitchStatement:
var expression = readExpression();
int count = readUInt();

Powered by Google App Engine
This is Rietveld 408576698