b645a259bd
This patch changes the parser to allow for-of initializer var-redeclaration of non-destructured catch parameters. Previously, the spec allowed var-redeclaration of a non-destructured catch parameter… try {} catch (e) { var e; } …except in the particular case where the var declaration is a for-of initializer: try {} catch (e) { for (var e of whatever) {} } https://github.com/tc39/ecma262/pull/1393 removes this strange exceptional case. This patch implements that change. BUG=v8:8759 Change-Id: Ia4e33ac1eab89085f8a5fdb547f479cfa38bbee5 Reviewed-on: https://chromium-review.googlesource.com/c/1444954 Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Mathias Bynens <mathias@chromium.org> Cr-Commit-Position: refs/heads/master@{#59209}
6 lines
240 B
JavaScript
6 lines
240 B
JavaScript
// Copyright 2019 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
assertDoesNotThrow("try { } catch (e) { var e; for (var e of []) {} }")
|