Description[es6] Implement destructuring binding in try/catch
The approach is to desugar
try { ... }
catch ({x, y}) { ... }
into
try { ... }
catch (.catch) {
let x = .catch.x;
let y = .catch.y;
...
}
using the PatternRewriter's normal facilities. This has the side benefit
of throwing the appropriate variable conflict errors for declarations
made inside the catch block.
No change is made to non-destructured cases, which will hopefully save
us some work if https://github.com/tc39/ecma262/issues/150 is adopted
in the spec.
There's one big problem with this patch, which is a lack of PreParser
support for the redeclaration errors. But it seems we're already lacking
good PreParser support for such errors, so I'm not sure that should
block this moving forward.
BUG=v8:811
LOG=y
Committed: https://crrev.com/a316db995e6e4253664920652ed4e5a38b2caeba
Cr-Commit-Position: refs/heads/master@{#31797}
Patch Set 1 #
Total comments: 7
Patch Set 2 : Handled code review comments #Patch Set 3 : Fix CheckConflictingVariableDeclarations to deal with destructuring #
Messages
Total messages: 10 (2 generated)
|