Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: fisker Cheung <lionkay@gmail.com>
35 lines
725 B
JavaScript
35 lines
725 B
JavaScript
import { outdent } from "outdent";
|
|
|
|
run_spec(
|
|
{
|
|
importMeta: import.meta,
|
|
snippets: [
|
|
outdent`
|
|
async function foo() {
|
|
function bar(x = await 2) {}
|
|
}
|
|
`,
|
|
"async (x = await 2) => {};",
|
|
"f = async (a) => await a! ** 6;",
|
|
"f = (a) => +a! ** 6;",
|
|
"async (a) => (await a!) ** 6;",
|
|
"(-+5 ** 6);",
|
|
"f = async () => await 5 ** 6;",
|
|
"f = async () => await -5 ** 6;",
|
|
"async({ foo33 = 1 });",
|
|
],
|
|
},
|
|
["babel", "acorn", "espree", "meriyah", "flow"]
|
|
);
|
|
|
|
run_spec(
|
|
{
|
|
importMeta: import.meta,
|
|
snippets: [
|
|
// `meriyah` didn't throw
|
|
"async (x = await (2)) => {};",
|
|
],
|
|
},
|
|
["babel", "acorn", "espree", "flow"]
|
|
);
|