New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update babel/parser to v7.12.17
#10345
Merged
Merged
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
a336e85
Update tests
sosukesuzuki 7d8be30
Add tests for 12686
sosukesuzuki e589c03
Add tests for 12684
sosukesuzuki 576132b
Add tests for 12520
sosukesuzuki 4d7fbb5
Add tests for 12599
sosukesuzuki c97bac4
Add tests for 12562
sosukesuzuki db396a8
Add tests for 12661
sosukesuzuki 6a6ee3d
Add tests for 12748
sosukesuzuki a37e12a
Add tests for 12735
sosukesuzuki 83e97d8
Add tests for 12775
sosukesuzuki 877dff3
Add tests for 12776
sosukesuzuki 9ffc596
Add tests for 12785
sosukesuzuki 326fccf
Update
sosukesuzuki 419c6a8
Add more await tests
sosukesuzuki 35ba43d
Extract files
sosukesuzuki 15c4908
Add await tests for flow
sosukesuzuki 8ebb11b
Add with-paren tests for Flow
sosukesuzuki 2e59c34
Add typescript only await tests
sosukesuzuki 5d5eaea
Add babel-only await tests
sosukesuzuki 41699a0
Add implementations for invalid modifiers
sosukesuzuki 5fdede6
Fix typo
sosukesuzuki dcab270
Remove workaround for declare and readonly
sosukesuzuki File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also test this? (Note that
flow
parse this differently.)Prettier pr-10345
Playground link
Input:
Output: