Skip to content

Commit

Permalink
fix(parser): make nested async arrow assignable
Browse files Browse the repository at this point in the history
  • Loading branch information
KFlash committed Jun 18, 2019
1 parent 21e771d commit 83c8db0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,8 @@ export function parseAsyncArrowOrAsyncFunctionDeclaration(
| ESTree.LogicalExpression
| ESTree.ConditionalExpression);

parser.assignable = AssignmentKind.Assignable;

/**
* ExpressionStatement[Yield, Await]:
* [lookahead ∉ { {, function, async [no LineTerminator here] function, class, let [ }]Expression[+In, ?Yield, ?Await]
Expand Down
5 changes: 4 additions & 1 deletion test/parser/expressions/async-arrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,10 @@ describe('Expressions - Async arrow', () => {
'(async(a, b, ...c) => await 1)',
'() => (async(foo, { a = NaN }) => foo + a)("1", { a: "0" })',
'() => (async(foo, { a = "0" }) => foo + a)("2", { a: undefined })',
//'async(a = (await) => {}) => {};',
`async x => {}
async (x) => {}`,
`async (x) => {}
async x => {}`,
'var f = cond ? x=>{x.foo } : x=>x + x + x + x + x + x + (x =>x)'
]) {
it(`${arg};`, () => {
Expand Down

0 comments on commit 83c8db0

Please sign in to comment.