Handle throw expressions in generator (#8727)

Fixes #8716
This commit is contained in:
Brian Ng
2018-09-18 18:10:49 -04:00
committed by Henry Zhu
parent fad74959f8
commit 9e7c7f5683
4 changed files with 6 additions and 1 deletions

View File

@@ -5,7 +5,9 @@ export function UnaryExpression(node: Object) {
if (
node.operator === "void" ||
node.operator === "delete" ||
node.operator === "typeof"
node.operator === "typeof" ||
// throwExpressions
node.operator === "throw"
) {
this.word(node.operator);
this.space();

View File

@@ -0,0 +1 @@
() => throw new X();

View File

@@ -0,0 +1 @@
{ "plugins": ["throwExpressions"] }

View File

@@ -0,0 +1 @@
() => throw new X();