Update flow-parser (#18598)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
renovate[bot]andfisker authored and GitHub committed 2026-01-15 01:44:39 +08:00
1 parent 2c2b494943
commit 48f7598e57
12 files changed
+115 -52

No files matched your search

@@ -0,0 +1,16 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`snippet: #0 [flow] format 1`] = `
"Unexpected token \`{\`, expected the token \`;\` (1:24)
> 1 | const a = not_a_record {}
| ^"
`;
exports[`snippet: #0 [hermes] format 1`] = `
"';' expected (1:23)
> 1 | const a = not_a_record {}
| ^
Cause: ';' expected (1:23)
const a = not_a_record {}
^"
`;
@@ -0,0 +1,7 @@
runFormatTest(
{
importMeta: import.meta,
snippets: ["const a = not_a_record {}"],
},
["flow", "hermes"],
);
@@ -92,10 +92,10 @@ Cause: Unexpected token, expected ")" (4:24)"
`;
exports[`invalid-using-binding-pattern.js [flow] format 1`] = `
"Invalid left-hand side in assignment (2:3)
"Unexpected token \`{\`, expected the end of an expression statement (\`;\`) (2:9)
1 | {
> 2 | using { foo } = f();
| ^^^^^^^^^^^^^
| ^
3 | using [ bar ] = g();
4 | for (using { qux } of h());
5 | for (using [ quux ] of i());"