Skip to content

using and await using parse issue #1373

@fisker

Description

@fisker

6 valid cases not correctly parsed.

async function f() {
  await using in foo;
}
async function f() {
  await using instanceof foo;
}
async function f() {
  await using[x];
  await using.x + await using(x) ? await using?.x : await using`x`;
}
for (using in []);
for (using.foo in []);
for (using().foo in []);
for (using``.foo in []);
using in using instanceof using;
{ using 𠮷 = foo(); }

1 invalid cases not rejected.

using x = bar();

Found during updating acorn in Prettier prettier/prettier#17580

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions