retrofit try-catch-finally as block-scoped (#4178)
- support optional catch binding
This commit is contained in:
@@ -1130,9 +1130,12 @@ function parse($TEXT, options) {
|
||||
if (is("keyword", "catch")) {
|
||||
var start = S.token;
|
||||
next();
|
||||
expect("(");
|
||||
var name = as_symbol(AST_SymbolCatch);
|
||||
expect(")");
|
||||
var name = null;
|
||||
if (is("punc", "(")) {
|
||||
next();
|
||||
name = as_symbol(AST_SymbolCatch);
|
||||
expect(")");
|
||||
}
|
||||
bcatch = new AST_Catch({
|
||||
start : start,
|
||||
argname : name,
|
||||
|
||||
Reference in New Issue
Block a user