Issue #1465 - Implement optional catch binding.

This commit is contained in:
wolfbeast 2020-02-27 20:09:26 +01:00 committed by Roy Tam
commit f4dd604bf5
7 changed files with 118 additions and 76 deletions

View file

@ -77,7 +77,16 @@ assertStmt("try { } catch (e if foo) { } catch (e if bar) { } catch (e) { } fina
catchClause(ident("e"), ident("bar"), blockStmt([])) ],
catchClause(ident("e"), null, blockStmt([])),
blockStmt([])));
assertStmt("try { } catch { }",
tryStmt(blockStmt([]),
[],
catchClause(null, null, blockStmt([])),
null));
assertStmt("try { } catch { } finally { }",
tryStmt(blockStmt([]),
[],
catchClause(null, null, blockStmt([])),
blockStmt([])));
// Bug 632028: yield outside of a function should throw
(function() {