Files
test-repo/tests/format/js/explicit-resource-management/__snapshots__/jsfmt.spec.js.snap
T

1313 lines
38 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`for-await-using-of-comments.js [acorn] format 1`] = `
"Unexpected token (1:19)
> 1 | /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
| ^
2 |
Cause: Unexpected token (1:18)"
`;
exports[`for-await-using-of-comments.js [espree] format 1`] = `
"Unexpected token await (1:19)
> 1 | /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
| ^
2 |
Cause: Unexpected token await"
`;
exports[`for-await-using-of-comments.js [flow] format 1`] = `
"Unexpected token \`await\`, expected the token \`(\` (1:19)
> 1 | /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
| ^^^^^
2 |"
`;
exports[`for-await-using-of-comments.js [meriyah] format 1`] = `
"for await (... of ...) is only valid in async functions and async generators (1:52)
> 1 | /*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
| ^
2 |
Cause: [1:52]: for await (... of ...) is only valid in async functions and async generators"
`;
exports[`for-await-using-of-comments.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
/*1*/ for /* 2 */ await /*3*/ ( /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/) /*9*/;
=====================================output=====================================
/*1*/ for await (/* 2 */ /*3*/ /*4*/ using /*5*/ fo /*6*/ of /*7*/ of /*8*/ /*9*/);
================================================================================
`;
exports[`invalid-duplicate-using-bindings.js [acorn] format 1`] = `
"Unexpected token (2:9)
1 | {
> 2 | using f, f = foo();
| ^
3 | }
4 | {
5 | using g = foo();
Cause: Unexpected token (2:8)"
`;
exports[`invalid-duplicate-using-bindings.js [espree] format 1`] = `
"Unexpected token f (2:9)
1 | {
> 2 | using f, f = foo();
| ^
3 | }
4 | {
5 | using g = foo();
Cause: Unexpected token f"
`;
exports[`invalid-duplicate-using-bindings.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (2:9)
1 | {
> 2 | using f, f = foo();
| ^
3 | }
4 | {
5 | using g = foo();"
`;
exports[`invalid-duplicate-using-bindings.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:9)
1 | {
> 2 | using f, f = foo();
| ^
3 | }
4 | {
5 | using g = foo();
Cause: [2:9]: Unexpected token: 'identifier'"
`;
exports[`invalid-duplicate-using-bindings.js [typescript] format 1`] = `
"'using' declarations must be initialized. (2:9)
1 | {
> 2 | using f, f = foo();
| ^
3 | }
4 | {
5 | using g = foo();
Cause: 'using' declarations must be initialized."
`;
exports[`invalid-duplicate-using-bindings.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
{
using f, f = foo();
}
{
using g = foo();
using g = foo();
}
=====================================output=====================================
{
using f,
f = foo();
}
{
using g = foo();
using g = foo();
}
================================================================================
`;
exports[`invalid-script-top-level-using-binding.js [acorn] format 1`] = `
"Unexpected token (1:7)
> 1 | using x = bar();
| ^
2 |
Cause: Unexpected token (1:6)"
`;
exports[`invalid-script-top-level-using-binding.js [espree] format 1`] = `
"Unexpected token x (1:7)
> 1 | using x = bar();
| ^
2 |
Cause: Unexpected token x"
`;
exports[`invalid-script-top-level-using-binding.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (1:7)
> 1 | using x = bar();
| ^
2 |"
`;
exports[`invalid-script-top-level-using-binding.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:7)
> 1 | using x = bar();
| ^
2 |
Cause: [1:7]: Unexpected token: 'identifier'"
`;
exports[`invalid-script-top-level-using-binding.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
using x = bar();
=====================================output=====================================
using x = bar();
================================================================================
`;
exports[`using-declarations.js [acorn] format 1`] = `
"Unexpected token (2:17)
1 | {
> 2 | using /* 1 */ a = foo(), /* 2 */ b = foo()
| ^
3 | }
4 |
5 | for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
Cause: Unexpected token (2:16)"
`;
exports[`using-declarations.js [espree] format 1`] = `
"Unexpected token a (2:17)
1 | {
> 2 | using /* 1 */ a = foo(), /* 2 */ b = foo()
| ^
3 | }
4 |
5 | for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
Cause: Unexpected token a"
`;
exports[`using-declarations.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (2:17)
1 | {
> 2 | using /* 1 */ a = foo(), /* 2 */ b = foo()
| ^
3 | }
4 |
5 | for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);"
`;
exports[`using-declarations.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:17)
1 | {
> 2 | using /* 1 */ a = foo(), /* 2 */ b = foo()
| ^
3 | }
4 |
5 | for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
Cause: [2:17]: Unexpected token: 'identifier'"
`;
exports[`using-declarations.js [typescript] format 1`] = `
"'using' declarations may not be initialized in for statement. (5:19)
3 | }
4 |
> 5 | for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
| ^^^^^^^^^
6 |
7 | for(using /* 1 */ foo of bar());
8 |
Cause: 'using' declarations may not be initialized in for statement."
`;
exports[`using-declarations.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
{
using /* 1 */ a = foo(), /* 2 */ b = foo()
}
for(using /* 1 */ a = foo(), /* 2 */ b = foo();;);
for(using /* 1 */ foo of bar());
=====================================output=====================================
{
using /* 1 */ a = foo(),
/* 2 */ b = foo();
}
for (using /* 1 */ a = foo(), /* 2 */ b = foo(); ; );
for (using /* 1 */ foo of bar());
================================================================================
`;
exports[`valid-await-expr-using.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
await using[x];
await using.x + await using(x) ? await using?.x : await using\`x\`;
}
=====================================output=====================================
async function f() {
await using[x];
(await using.x) + (await using(x)) ? await using?.x : await using\`x\`;
}
================================================================================
`;
exports[`valid-await-expr-using-in.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
await using in foo;
}
=====================================output=====================================
async function f() {
(await using) in foo;
}
================================================================================
`;
exports[`valid-await-expr-using-instanceof.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
await using instanceof foo;
}
=====================================output=====================================
async function f() {
(await using) instanceof foo;
}
================================================================================
`;
exports[`valid-await-using-asi-assignment.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
await using
using = h();
}
=====================================output=====================================
async function f() {
await using;
using = h();
}
================================================================================
`;
exports[`valid-await-using-binding-basic.js [acorn] format 1`] = `
"Unexpected token (2:15)
1 | async function f() {
> 2 | await using basic = getReader();
| ^
3 | }
4 |
Cause: Unexpected token (2:14)"
`;
exports[`valid-await-using-binding-basic.js [espree] format 1`] = `
"Unexpected token basic (2:15)
1 | async function f() {
> 2 | await using basic = getReader();
| ^
3 | }
4 |
Cause: Unexpected token basic"
`;
exports[`valid-await-using-binding-basic.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (2:15)
1 | async function f() {
> 2 | await using basic = getReader();
| ^^^^^
3 | }
4 |"
`;
exports[`valid-await-using-binding-basic.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:19)
1 | async function f() {
> 2 | await using basic = getReader();
| ^
3 | }
4 |
Cause: [2:19]: Unexpected token: 'identifier'"
`;
exports[`valid-await-using-binding-basic.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
await using basic = getReader();
}
=====================================output=====================================
async function f() {
await using basic = getReader();
}
================================================================================
`;
exports[`valid-await-using-binding-escaped.js [acorn] format 1`] = `
"Unexpected token (2:15)
1 | async function f() {
> 2 | await using \\u0061b = c;
| ^
3 | }
4 |
Cause: Unexpected token (2:14)"
`;
exports[`valid-await-using-binding-escaped.js [espree] format 1`] = `
"Unexpected token \\u0061b (2:15)
1 | async function f() {
> 2 | await using \\u0061b = c;
| ^
3 | }
4 |
Cause: Unexpected token \\u0061b"
`;
exports[`valid-await-using-binding-escaped.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (2:15)
1 | async function f() {
> 2 | await using \\u0061b = c;
| ^^^^^^^
3 | }
4 |"
`;
exports[`valid-await-using-binding-escaped.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:15)
1 | async function f() {
> 2 | await using \\u0061b = c;
| ^
3 | }
4 |
Cause: [2:15]: Unexpected token: 'identifier'"
`;
exports[`valid-await-using-binding-escaped.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
await using \\u0061b = c;
}
=====================================output=====================================
async function f() {
await using ab = c;
}
================================================================================
`;
exports[`valid-await-using-binding-non-bmp.js [acorn] format 1`] = `
"Unexpected token (2:15)
1 | async function f() {
> 2 | await using 𠮷 = foo();
| ^
3 | }
4 |
Cause: Unexpected token (2:14)"
`;
exports[`valid-await-using-binding-non-bmp.js [espree] format 1`] = `
"Unexpected token 𠮷 (2:15)
1 | async function f() {
> 2 | await using 𠮷 = foo();
| ^
3 | }
4 |
Cause: Unexpected token 𠮷"
`;
exports[`valid-await-using-binding-non-bmp.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (2:15)
1 | async function f() {
> 2 | await using 𠮷 = foo();
| ^
3 | }
4 |"
`;
exports[`valid-await-using-binding-non-bmp.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:17)
1 | async function f() {
> 2 | await using 𠮷 = foo();
| ^
3 | }
4 |
Cause: [2:17]: Unexpected token: 'identifier'"
`;
exports[`valid-await-using-binding-non-bmp.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
await using 𠮷 = foo();
}
=====================================output=====================================
async function f() {
await using 𠮷 = foo();
}
================================================================================
`;
exports[`valid-await-using-binding-using.js [acorn] format 1`] = `
"Unexpected token (2:15)
1 | async function f() {
> 2 | await using using = of;
| ^
3 | for (await using using of of);
4 | }
5 |
Cause: Unexpected token (2:14)"
`;
exports[`valid-await-using-binding-using.js [espree] format 1`] = `
"Unexpected token using (2:15)
1 | async function f() {
> 2 | await using using = of;
| ^
3 | for (await using using of of);
4 | }
5 |
Cause: Unexpected token using"
`;
exports[`valid-await-using-binding-using.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (2:15)
1 | async function f() {
> 2 | await using using = of;
| ^^^^^
3 | for (await using using of of);
4 | }
5 |"
`;
exports[`valid-await-using-binding-using.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:19)
1 | async function f() {
> 2 | await using using = of;
| ^
3 | for (await using using of of);
4 | }
5 |
Cause: [2:19]: Unexpected token: 'identifier'"
`;
exports[`valid-await-using-binding-using.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
await using using = of;
for (await using using of of);
}
=====================================output=====================================
async function f() {
await using using = of;
for (await using using of of);
}
================================================================================
`;
exports[`valid-await-using-comments.js [acorn] format 1`] = `
"Unexpected token (3:28)
1 | async function f() {
2 | {
> 3 | /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
| ^
4 | }
5 | {
6 | /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
Cause: Unexpected token (3:27)"
`;
exports[`valid-await-using-comments.js [espree] format 1`] = `
"Unexpected token b (3:28)
1 | async function f() {
2 | {
> 3 | /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
| ^
4 | }
5 | {
6 | /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
Cause: Unexpected token b"
`;
exports[`valid-await-using-comments.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (3:28)
1 | async function f() {
2 | {
> 3 | /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
| ^
4 | }
5 | {
6 | /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;"
`;
exports[`valid-await-using-comments.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (3:28)
1 | async function f() {
2 | {
> 3 | /*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
| ^
4 | }
5 | {
6 | /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
Cause: [3:28]: Unexpected token: 'identifier'"
`;
exports[`valid-await-using-comments.js [typescript] format 1`] = `
"'await using' declarations may not be initialized in for statement. (6:42)
4 | }
5 | {
> 6 | /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
| ^^^^^^^^^^^^^
7 | }
8 | {
9 | /*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
Cause: 'await using' declarations may not be initialized in for statement."
`;
exports[`valid-await-using-comments.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
{
/*0*/await/*1*/using/*2*/b/*3*/=/*4*/f()/*5*/;
}
{
/*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/=/*6*/x/*7*/;/*8*/;/*9*/)/*10*/;
}
{
/*0*/for/*1*/(/*2*/await/*3*/using/*4*/b/*5*/of/*6*/x/*7*/)/*8*/;
}
{
/*0*/for/*1*/await/*2*/(/*3*/await/*4*/using/*5*/b/*6*/of/*7*/x/*8*/)/*9*/;
}
}
=====================================output=====================================
async function f() {
{
/*0*/ await using /*1*/ /*2*/ b /*3*/ = /*4*/ f(); /*5*/
}
{
/*0*/ for (
/*1*/ /*2*/ await using /*3*/ /*4*/ b /*5*/ =
/*6*/ x /*7*/ /*8*/ /*9*/ /*10*/;
;
);
}
{
/*0*/ for (/*1*/ /*2*/ await using /*3*/ /*4*/ b /*5*/ of /*6*/ x /*7*/ /*8*/);
}
{
/*0*/ for await (/*1*/ /*2*/ /*3*/ await using /*4*/ /*5*/ b /*6*/ of /*7*/ x /*8*/ /*9*/);
}
}
================================================================================
`;
exports[`valid-for-await-using-binding-escaped-of-of.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
// TODO: Fix this test
// for await (using \\u006ff of of);
=====================================output=====================================
// TODO: Fix this test
// for await (using \\u006ff of of);
================================================================================
`;
exports[`valid-for-using-binding-escaped-of-of.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
// TODO: Fix this test
// for (using o\\u0066 of of);
=====================================output=====================================
// TODO: Fix this test
// for (using o\\u0066 of of);
================================================================================
`;
exports[`valid-for-using-binding-of-of.js [acorn] format 1`] = `
"Assigning to rvalue (2:8)
1 | async function f() {
> 2 | for (await using of of of);
| ^
3 | for await (await using of of of);
4 | }
5 |
Cause: Assigning to rvalue (2:7)"
`;
exports[`valid-for-using-binding-of-of.js [espree] format 1`] = `
"Assigning to rvalue (2:8)
1 | async function f() {
> 2 | for (await using of of of);
| ^
3 | for await (await using of of of);
4 | }
5 |
Cause: Assigning to rvalue"
`;
exports[`valid-for-using-binding-of-of.js [flow] format 1`] = `
"Invalid left-hand side in for-of (2:8)
1 | async function f() {
> 2 | for (await using of of of);
| ^^^^^^^^^^^
3 | for await (await using of of of);
4 | }
5 |"
`;
exports[`valid-for-using-binding-of-of.js [meriyah] format 1`] = `
"Invalid left-hand side in for-of (2:21)
1 | async function f() {
> 2 | for (await using of of of);
| ^
3 | for await (await using of of of);
4 | }
5 |
Cause: [2:21]: Invalid left-hand side in for-of"
`;
exports[`valid-for-using-binding-of-of.js [typescript] format 1`] = `
"')' expected. (2:26)
1 | async function f() {
> 2 | for (await using of of of);
| ^
3 | for await (await using of of of);
4 | }
5 |
Cause: ')' expected."
`;
exports[`valid-for-using-binding-of-of.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
for (await using of of of);
for await (await using of of of);
}
=====================================output=====================================
async function f() {
for (await using of of of);
for await (await using of of of);
}
================================================================================
`;
exports[`valid-for-using-declaration.js [acorn] format 1`] = `
"Unexpected token (2:20)
1 | async function f() {
> 2 | for (await using basic = reader();;);
| ^
3 | }
4 |
Cause: Unexpected token (2:19)"
`;
exports[`valid-for-using-declaration.js [espree] format 1`] = `
"Unexpected token basic (2:20)
1 | async function f() {
> 2 | for (await using basic = reader();;);
| ^
3 | }
4 |
Cause: Unexpected token basic"
`;
exports[`valid-for-using-declaration.js [flow] format 1`] = `
"Unexpected identifier, expected the token \`;\` (2:20)
1 | async function f() {
> 2 | for (await using basic = reader();;);
| ^^^^^
3 | }
4 |"
`;
exports[`valid-for-using-declaration.js [meriyah] format 1`] = `
"Expected ';' (2:24)
1 | async function f() {
> 2 | for (await using basic = reader();;);
| ^
3 | }
4 |
Cause: [2:24]: Expected ';'"
`;
exports[`valid-for-using-declaration.js [typescript] format 1`] = `
"'await using' declarations may not be initialized in for statement. (2:20)
1 | async function f() {
> 2 | for (await using basic = reader();;);
| ^^^^^^^^^^^^^^^^
3 | }
4 |
Cause: 'await using' declarations may not be initialized in for statement."
`;
exports[`valid-for-using-declaration.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
async function f() {
for (await using basic = reader();;);
}
=====================================output=====================================
async function f() {
for (await using basic = reader(); ; );
}
================================================================================
`;
exports[`valid-module-block-top-level-await-using-binding.js [acorn] format 1`] = `
"Unexpected token (1:18)
> 1 | const m = module {
| ^
2 | await using foo = bar();
3 | }
4 |
Cause: Unexpected token (1:17)"
`;
exports[`valid-module-block-top-level-await-using-binding.js [espree] format 1`] = `
"Unexpected token { (1:18)
> 1 | const m = module {
| ^
2 | await using foo = bar();
3 | }
4 |
Cause: Unexpected token {"
`;
exports[`valid-module-block-top-level-await-using-binding.js [flow] format 1`] = `
"Unexpected token \`{\`, expected the token \`;\` (1:18)
> 1 | const m = module {
| ^
2 | await using foo = bar();
3 | }
4 |"
`;
exports[`valid-module-block-top-level-await-using-binding.js [meriyah] format 1`] = `
"Unexpected token: '{' (1:18)
> 1 | const m = module {
| ^
2 | await using foo = bar();
3 | }
4 |
Cause: [1:18]: Unexpected token: '{'"
`;
exports[`valid-module-block-top-level-await-using-binding.js [typescript] format 1`] = `
"',' expected. (1:18)
> 1 | const m = module {
| ^
2 | await using foo = bar();
3 | }
4 |
Cause: ',' expected."
`;
exports[`valid-module-block-top-level-await-using-binding.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
const m = module {
await using foo = bar();
}
=====================================output=====================================
const m = module {
await using foo = bar();
};
================================================================================
`;
exports[`valid-module-block-top-level-using-binding.js [acorn] format 1`] = `
"Unexpected token (1:8)
> 1 | module {
| ^
2 | using foo = bar();
3 | }
4 |
Cause: Unexpected token (1:7)"
`;
exports[`valid-module-block-top-level-using-binding.js [espree] format 1`] = `
"Unexpected token { (1:8)
> 1 | module {
| ^
2 | using foo = bar();
3 | }
4 |
Cause: Unexpected token {"
`;
exports[`valid-module-block-top-level-using-binding.js [flow] format 1`] = `
"Unexpected token \`{\`, expected the end of an expression statement (\`;\`) (1:8)
> 1 | module {
| ^
2 | using foo = bar();
3 | }
4 |"
`;
exports[`valid-module-block-top-level-using-binding.js [meriyah] format 1`] = `
"Unexpected token: '{' (1:8)
> 1 | module {
| ^
2 | using foo = bar();
3 | }
4 |
Cause: [1:8]: Unexpected token: '{'"
`;
exports[`valid-module-block-top-level-using-binding.js [typescript] format 1`] = `
"Namespace must be given a name. (1:8)
> 1 | module {
| ^
2 | using foo = bar();
3 | }
4 |
Cause: Namespace must be given a name."
`;
exports[`valid-module-block-top-level-using-binding.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
module {
using foo = bar();
}
=====================================output=====================================
module {
using foo = bar();
};
================================================================================
`;
exports[`valid-using-as-identifier-computed-member.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
using [x] = 0;
for (using [x] of []);
=====================================output=====================================
using[x] = 0;
for (using[x] of []);
================================================================================
`;
exports[`valid-using-as-identifier-expression-statement.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
using
reader = getReader()
=====================================output=====================================
using;
reader = getReader();
================================================================================
`;
exports[`valid-using-as-identifier-for-await-of.js [flow] format 1`] = `
"Unexpected token \`await\`, expected the token \`(\` (1:5)
> 1 | for await (using of of);
| ^^^^^
2 |"
`;
exports[`valid-using-as-identifier-for-await-of.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
for await (using of of);
=====================================output=====================================
for await (using of of);
================================================================================
`;
exports[`valid-using-as-identifier-for-in.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
for (using in []);
for (using.foo in []);
for (using().foo in []);
for (using\`\`.foo in []);
=====================================output=====================================
for (using in []);
for (using.foo in []);
for (using().foo in []);
for (using\`\`.foo in []);
================================================================================
`;
exports[`valid-using-as-identifier-for-init.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
for (
using;
reader = getReader(););
=====================================output=====================================
for (using; (reader = getReader()); );
================================================================================
`;
exports[`valid-using-as-identifier-for-of.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
for (using of of);
for (using.foo of of);
for (using().foo of of);
for (using\`\`.foo of of);
=====================================output=====================================
for (using of of);
for (using.foo of of);
for (using().foo of of);
for (using\`\`.foo of of);
================================================================================
`;
exports[`valid-using-as-identifier-in.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
using in using instanceof using;
=====================================output=====================================
using in using instanceof using;
================================================================================
`;
exports[`valid-using-binding-basic.js [acorn] format 1`] = `
"Unexpected token (2:9)
1 | {
> 2 | using basic = getReader();
| ^
3 | }
4 |
Cause: Unexpected token (2:8)"
`;
exports[`valid-using-binding-basic.js [espree] format 1`] = `
"Unexpected token basic (2:9)
1 | {
> 2 | using basic = getReader();
| ^
3 | }
4 |
Cause: Unexpected token basic"
`;
exports[`valid-using-binding-basic.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (2:9)
1 | {
> 2 | using basic = getReader();
| ^^^^^
3 | }
4 |"
`;
exports[`valid-using-binding-basic.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:13)
1 | {
> 2 | using basic = getReader();
| ^
3 | }
4 |
Cause: [2:13]: Unexpected token: 'identifier'"
`;
exports[`valid-using-binding-basic.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
{
using basic = getReader();
}
=====================================output=====================================
{
using basic = getReader();
}
================================================================================
`;
exports[`valid-using-binding-escaped.js [acorn] format 1`] = `
"Unexpected token (1:9)
> 1 | { using \\u0061b = c; }
| ^
2 |
Cause: Unexpected token (1:8)"
`;
exports[`valid-using-binding-escaped.js [espree] format 1`] = `
"Unexpected token \\u0061b (1:9)
> 1 | { using \\u0061b = c; }
| ^
2 |
Cause: Unexpected token \\u0061b"
`;
exports[`valid-using-binding-escaped.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (1:9)
> 1 | { using \\u0061b = c; }
| ^^^^^^^
2 |"
`;
exports[`valid-using-binding-escaped.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:9)
> 1 | { using \\u0061b = c; }
| ^
2 |
Cause: [1:9]: Unexpected token: 'identifier'"
`;
exports[`valid-using-binding-escaped.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
{ using \\u0061b = c; }
=====================================output=====================================
{
using ab = c;
}
================================================================================
`;
exports[`valid-using-binding-non-bmp.js [acorn] format 1`] = `
"Unexpected token (1:9)
> 1 | { using 𠮷 = foo(); }
| ^
2 |
Cause: Unexpected token (1:8)"
`;
exports[`valid-using-binding-non-bmp.js [espree] format 1`] = `
"Unexpected token 𠮷 (1:9)
> 1 | { using 𠮷 = foo(); }
| ^
2 |
Cause: Unexpected token 𠮷"
`;
exports[`valid-using-binding-non-bmp.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (1:9)
> 1 | { using 𠮷 = foo(); }
| ^
2 |"
`;
exports[`valid-using-binding-non-bmp.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (1:11)
> 1 | { using 𠮷 = foo(); }
| ^
2 |
Cause: [1:11]: Unexpected token: 'identifier'"
`;
exports[`valid-using-binding-non-bmp.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
{ using 𠮷 = foo(); }
=====================================output=====================================
{
using 𠮷 = foo();
}
================================================================================
`;
exports[`valid-using-binding-using.js [acorn] format 1`] = `
"Unexpected token (2:9)
1 | {
> 2 | using using = of;
| ^
3 | for (using using of of);
4 | }
5 |
Cause: Unexpected token (2:8)"
`;
exports[`valid-using-binding-using.js [espree] format 1`] = `
"Unexpected token using (2:9)
1 | {
> 2 | using using = of;
| ^
3 | for (using using of of);
4 | }
5 |
Cause: Unexpected token using"
`;
exports[`valid-using-binding-using.js [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (2:9)
1 | {
> 2 | using using = of;
| ^^^^^
3 | for (using using of of);
4 | }
5 |"
`;
exports[`valid-using-binding-using.js [meriyah] format 1`] = `
"Unexpected token: 'identifier' (2:13)
1 | {
> 2 | using using = of;
| ^
3 | for (using using of of);
4 | }
5 |
Cause: [2:13]: Unexpected token: 'identifier'"
`;
exports[`valid-using-binding-using.js format 1`] = `
====================================options=====================================
parsers: ["babel", "flow", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
{
using using = of;
for (using using of of);
}
=====================================output=====================================
{
using using = of;
for (using using of of);
}
================================================================================
`;