Files
test-repo/tests/format/misc/errors/js/async-await/jsfmt.spec.js
T
renovate[bot]andfisker Cheung 1dafaa0392 Update flow-parser to v0.198 (#14182)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker Cheung <lionkay@gmail.com>
2023-01-28 09:56:49 +08:00

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"]
);