Skip to content

Commit 5742b71

Browse files
kesnehzoo
authored andcommitted
Adding optionalCatchBinding to plugins. (babel#521)
1 parent 905887c commit 5742b71

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ exports.parseNoPatch = function(code, options) {
414414
"importMeta",
415415
"classPrivateProperties",
416416
"bigInt",
417+
"optionalCatchBinding",
417418
],
418419
};
419420

test/non-regression.js

+11
Original file line numberDiff line numberDiff line change
@@ -1845,4 +1845,15 @@ describe("verify", () => {
18451845
[]
18461846
);
18471847
});
1848+
1849+
it("works with optionalCatchBinding", () => {
1850+
verifyAndAssertMessages(
1851+
unpad(`
1852+
try {} catch {}
1853+
try {} catch {} finally {}
1854+
`),
1855+
{},
1856+
[]
1857+
);
1858+
});
18481859
});

0 commit comments

Comments
 (0)