forked from prettier/prettier
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update babel/parser to
v7.12.17
(prettier#10345)
- Loading branch information
1 parent
09685a5
commit ae13a14
Showing
69 changed files
with
1,117 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`await-keywords.js format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["flow"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
export class C1 { | ||
p = await (0); | ||
} | ||
await (0); | ||
async function foo() { | ||
function bar(x = await (2)) {} | ||
} | ||
async (x = await (2)) => {}; | ||
export class C2 { | ||
p = await 0; | ||
} | ||
function foo(promise) { await (promise); } | ||
function a() { | ||
return await (1) | ||
} | ||
() => { await (x) }; | ||
function foo() { | ||
await | ||
(foo); | ||
} | ||
export class C { | ||
p = await (0); | ||
} | ||
await (0); | ||
=====================================output===================================== | ||
export class C1 { | ||
p = await(0); | ||
} | ||
await(0); | ||
async function foo() { | ||
function bar(x = await(2)) {} | ||
} | ||
async (x = await(2)) => {}; | ||
export class C2 { | ||
p = await; | ||
0; | ||
} | ||
function foo(promise) { | ||
await(promise); | ||
} | ||
function a() { | ||
return await(1); | ||
} | ||
() => { | ||
await(x); | ||
}; | ||
function foo() { | ||
await(foo); | ||
} | ||
export class C { | ||
p = await(0); | ||
} | ||
await(0); | ||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export class C1 { | ||
p = await (0); | ||
} | ||
|
||
await (0); | ||
|
||
async function foo() { | ||
function bar(x = await (2)) {} | ||
} | ||
|
||
async (x = await (2)) => {}; | ||
|
||
export class C2 { | ||
p = await 0; | ||
} | ||
|
||
function foo(promise) { await (promise); } | ||
|
||
function a() { | ||
return await (1) | ||
} | ||
|
||
() => { await (x) }; | ||
|
||
function foo() { | ||
await | ||
(foo); | ||
} | ||
|
||
export class C { | ||
p = await (0); | ||
} | ||
|
||
await (0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
run_spec(__dirname, ["flow"]); |
17 changes: 17 additions & 0 deletions
17
tests/flow/declare-function/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`export.js format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["flow", "babel"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
declare function foo(): void; | ||
export { foo }; | ||
=====================================output===================================== | ||
declare function foo(): void; | ||
export { foo }; | ||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare function foo(): void; | ||
export { foo }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
run_spec(__dirname, ["flow", "babel"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
async function foo() { | ||
function bar(x = await 2) {} | ||
} | ||
|
||
async (x = await 2) => {}; | ||
|
||
async function foo() { | ||
function bar(x = await (2)) {} | ||
} | ||
|
||
async (x = await (2)) => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
run_spec(__dirname, ["babel", "flow", "typescript"]); | ||
run_spec(__dirname, ["babel", "flow", "typescript"], { | ||
errors: { | ||
flow: ["await-keyword.js"], | ||
espree: ["await-keyword.js"], | ||
meriyah: ["await-keyword.js"], | ||
}, | ||
}); |
70 changes: 70 additions & 0 deletions
70
tests/js/await-with-parens/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`await-with-parens.js [espree] format 1`] = ` | ||
"Cannot use keyword 'await' outside an async function (1:25) | ||
> 1 | function foo(promise) { await (promise); } | ||
| ^ | ||
2 | | ||
3 | function a() { | ||
4 | return await (1)" | ||
`; | ||
exports[`await-with-parens.js [meriyah] format 1`] = ` | ||
"[1:29]: 'Await' may not be used as an identifier in this context (1:29) | ||
> 1 | function foo(promise) { await (promise); } | ||
| ^ | ||
2 | | ||
3 | function a() { | ||
4 | return await (1)" | ||
`; | ||
exports[`await-with-parens.js format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["babel"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
function foo(promise) { await (promise); } | ||
function a() { | ||
return await (1) | ||
} | ||
() => { await (x) }; | ||
function foo() { | ||
await | ||
(foo); | ||
} | ||
export class C { | ||
p = await (0); | ||
} | ||
await (0); | ||
=====================================output===================================== | ||
function foo(promise) { | ||
await(promise); | ||
} | ||
function a() { | ||
return await(1); | ||
} | ||
() => { | ||
await(x); | ||
}; | ||
function foo() { | ||
await(foo); | ||
} | ||
export class C { | ||
p = await 0; | ||
} | ||
await 0; | ||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
function foo(promise) { await (promise); } | ||
|
||
function a() { | ||
return await (1) | ||
} | ||
|
||
() => { await (x) }; | ||
|
||
function foo() { | ||
await | ||
(foo); | ||
} | ||
|
||
export class C { | ||
p = await (0); | ||
} | ||
|
||
await (0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
run_spec(__dirname, ["babel"], { | ||
errors: { | ||
espree: true, | ||
meriyah: true, | ||
}, | ||
}); |
Oops, something went wrong.