Reviewers: rossberg,
Description:
Debugger: use correct position for for-next expression statement.
[email protected]
BUG=chromium:523543
LOG=N
Please review this at https://codereview.chromium.org/1310213002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+6, -7 lines):
M src/parser.cc
M test/mjsunit/es6/debug-stepnext-for.js
M test/mjsunit/es6/regress/regress-468661.js
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index
d4da7ce53283a8c8cdc9d1678cc96543132f8a2e..9334a33195a1e21f474055863bc28dd47fa2cb93
100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3752,9 +3752,8 @@ Statement* Parser::ParseForStatement(ZoneList<const
AstRawString*>* labels,
Statement* next = NULL;
if (peek() != Token::RPAREN) {
- int next_pos = position();
Expression* exp = ParseExpression(true, CHECK_OK);
- next = factory()->NewExpressionStatement(exp, next_pos);
+ next = factory()->NewExpressionStatement(exp, exp->position());
}
Expect(Token::RPAREN, CHECK_OK);
Index: test/mjsunit/es6/debug-stepnext-for.js
diff --git a/test/mjsunit/es6/debug-stepnext-for.js
b/test/mjsunit/es6/debug-stepnext-for.js
index
fe50fa76b9f894f97e2a5d0fd57c0437f539ac2b..001f7053fde52b40081c087ea264fe9643e7b034
100644
--- a/test/mjsunit/es6/debug-stepnext-for.js
+++ b/test/mjsunit/es6/debug-stepnext-for.js
@@ -106,11 +106,11 @@ var expected = [
// For-of-let: next(), body, next(), ...
"j16","J4","j16","J4","j16","J4","j16",
// For-var: var decl, condition, body, next, condition, body, ...
- "k7","k20","K4","k23","k20","K4","k23","k20","K4","k23","k20",
+ "k7","k20","K4","k26","k20","K4","k26","k20","K4","k26","k20",
// For: init, condition, body, next, condition, body, ...
- "l7","l16","L4","l19","l16","L4","l19","l16","L4","l19","l16",
+ "l7","l16","L4","l22","l16","L4","l22","l16","L4","l22","l16",
// For-let: init, condition, body, next, condition, body, ...
- "m7","m20","M4","m23","m20","M4","m23","m20","M4","m23","m20",
+ "m7","m20","M4","m26","m20","M4","m26","m20","M4","m26","m20",
// Exit.
"y0","z0",
]
Index: test/mjsunit/es6/regress/regress-468661.js
diff --git a/test/mjsunit/es6/regress/regress-468661.js
b/test/mjsunit/es6/regress/regress-468661.js
index
e569474d23225495e78a8bf38dbd639ec39c1ee2..543a87c1df5344ee9cd9ffa4bfd93e54c6c2c02b
100644
--- a/test/mjsunit/es6/regress/regress-468661.js
+++ b/test/mjsunit/es6/regress/regress-468661.js
@@ -63,8 +63,8 @@ var sum = 0;
debugger; // Break 0.
for (let i=0; // Break 1.
- i < 1; // Break 2. // Break 5. // Break 6.
- i++) {
+ i < 1; // Break 2. // Break 6.
+ i++) { // Break 5.
let key = i; // Break 3.
sum += key; // Break 4.
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.