Commit 22ad8d4f authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[parser] Fix SyntaxError in case of eval of for-of conflicting with catch variable

Bug: v8:4231
Change-Id: I833ef23d32a27a403fe733e17f6ff1aa182c39b1
Reviewed-on: https://chromium-review.googlesource.com/c/1430701Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59079}
parent c70001ae
...@@ -1195,7 +1195,8 @@ class ParserBase { ...@@ -1195,7 +1195,8 @@ class ParserBase {
if (is_for_var_of) { if (is_for_var_of) {
Scope* scope = this->scope(); Scope* scope = this->scope();
while (scope != nullptr && !scope->is_declaration_scope()) { while (!scope->is_declaration_scope() ||
(scope->is_eval_scope() && is_sloppy(scope->language_mode()))) {
if (scope->is_catch_scope()) { if (scope->is_catch_scope()) {
auto name = scope->catch_variable()->raw_name(); auto name = scope->catch_variable()->raw_name();
// If it's a simple binding and the name is declared in the for loop. // If it's a simple binding and the name is declared in the for loop.
......
...@@ -138,9 +138,6 @@ ...@@ -138,9 +138,6 @@
'built-ins/DataView/prototype/byteLength/detached-buffer': [FAIL], 'built-ins/DataView/prototype/byteLength/detached-buffer': [FAIL],
'built-ins/DataView/prototype/byteOffset/detached-buffer': [FAIL], 'built-ins/DataView/prototype/byteOffset/detached-buffer': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=4231
'language/eval-code/direct/var-env-lower-lex-catch-non-strict': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=4951 # https://bugs.chromium.org/p/v8/issues/detail?id=4951
'language/expressions/assignment/destructuring/iterator-destructuring-property-reference-target-evaluation-order': [FAIL], 'language/expressions/assignment/destructuring/iterator-destructuring-property-reference-target-evaluation-order': [FAIL],
'language/expressions/assignment/destructuring/keyed-destructuring-property-reference-target-evaluation-order': [FAIL], 'language/expressions/assignment/destructuring/keyed-destructuring-property-reference-target-evaluation-order': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment