Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build(deps): Bump @babel/parser from 7.15.2 to 7.15.3 (#11345)
* Build(deps): Bump @babel/parser from 7.15.2 to 7.15.3 Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.15.2 to 7.15.3. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.15.3/packages/babel-parser) --- updated-dependencies: - dependency-name: "@babel/parser" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Add tests for `@babel/parser` 7.15.3 (#11366) * Add tests for babel/babel#13659 * Add tests for babel/babel#13655 * Add tests for babel/babel#13645 * Update tests Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
- Loading branch information
1 parent
051e205
commit 29b116b
Showing
11 changed files
with
140 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`import-as-as.js format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["flow"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
// @flow | ||
import { foo as as } from "foo"; | ||
import { as as as } from "foo"; | ||
import { as as foo } from "foo"; | ||
=====================================output===================================== | ||
// @flow | ||
import { foo as as } from "foo"; | ||
import { as as as } from "foo"; | ||
import { as as foo } from "foo"; | ||
================================================================================ | ||
`; | ||
|
||
exports[`type-import-as-as.js format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["flow"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
import {type foo as as} from "foo"; | ||
=====================================output===================================== | ||
import { type foo as as } from "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,4 @@ | ||
// @flow | ||
import { foo as as } from "foo"; | ||
import { as as as } from "foo"; | ||
import { as as foo } from "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"]); |
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 @@ | ||
import {type foo as as} from "foo"; |
60 changes: 60 additions & 0 deletions
60
tests/format/flow/ternary/__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,60 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`arrows.js [babel-flow] format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["flow", "babel-flow"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
// Test cases from babel | ||
// ref: https://github.com/babel/babel/blob/614b48678095746b83bbe517c4d6b30ba8cd5c04/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-13644/input.js | ||
// \`flow\` cannot parse below codes | ||
// ref: https://github.com/facebook/flow/issues/8731 | ||
(a ? (b = c) : d => e); // a ? (b = c) : (d => e) | ||
(a ? (b += c) : d => e); // a ? (b += c) : (d => e) | ||
(a ? (b = c) : d => e : f); // a ? ((b = c): d => e) : f | ||
(a ? (b += c) : d => e : f); // ((a ? (b += c) : (d => e)) : f) | ||
(a ? b => (c = d) : e => f); // a ? (b => (c = d)) : (e => f) | ||
(a ? b => (c += d) : e => f); // a ? (b => (c += d)) : (e => f) | ||
(a ? b => (c = d) : e => f : g); // a ? (b => ((c = d): e => f)) : g | ||
(a ? b => (c += d) : e => f : g); // ((a ? (b => (c += d)) : (e => f)) : g) | ||
=====================================output===================================== | ||
// Test cases from babel | ||
// ref: https://github.com/babel/babel/blob/614b48678095746b83bbe517c4d6b30ba8cd5c04/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-13644/input.js | ||
// \`flow\` cannot parse below codes | ||
// ref: https://github.com/facebook/flow/issues/8731 | ||
a ? (b = c) : (d) => e; // a ? (b = c) : (d => e) | ||
a ? (b += c) : (d) => e; // a ? (b += c) : (d => e) | ||
a ? (b = c): d => e : f; // a ? ((b = c): d => e) : f | ||
((a ? (b += c) : (d) => e): f); // ((a ? (b += c) : (d => e)) : f) | ||
a ? (b) => (c = d) : (e) => f; // a ? (b => (c = d)) : (e => f) | ||
a ? (b) => (c += d) : (e) => f; // a ? (b => (c += d)) : (e => f) | ||
a | ||
? (b) => | ||
(c = d): e => | ||
f | ||
: g; // a ? (b => ((c = d): e => f)) : g | ||
((a ? (b) => (c += d) : (e) => f): g); // ((a ? (b => (c += d)) : (e => f)) : g) | ||
================================================================================ | ||
`; | ||
|
||
exports[`arrows.js [flow] format 1`] = ` | ||
"Unexpected token \`)\`, expected the token \`:\` (6:22) | ||
4 | // ref: https://github.com/facebook/flow/issues/8731 | ||
5 | | ||
> 6 | (a ? (b = c) : d => e); // a ? (b = c) : (d => e) | ||
| ^ | ||
7 | (a ? (b += c) : d => e); // a ? (b += c) : (d => e) | ||
8 | | ||
9 | (a ? (b = c) : d => e : f); // a ? ((b = c): d => e) : f" | ||
`; |
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,16 @@ | ||
// Test cases from babel | ||
// ref: https://github.com/babel/babel/blob/614b48678095746b83bbe517c4d6b30ba8cd5c04/packages/babel-parser/test/fixtures/flow/arrows-in-ternaries/issue-13644/input.js | ||
// `flow` cannot parse below codes | ||
// ref: https://github.com/facebook/flow/issues/8731 | ||
|
||
(a ? (b = c) : d => e); // a ? (b = c) : (d => e) | ||
(a ? (b += c) : d => e); // a ? (b += c) : (d => e) | ||
|
||
(a ? (b = c) : d => e : f); // a ? ((b = c): d => e) : f | ||
(a ? (b += c) : d => e : f); // ((a ? (b += c) : (d => e)) : f) | ||
|
||
(a ? b => (c = d) : e => f); // a ? (b => (c = d)) : (e => f) | ||
(a ? b => (c += d) : e => f); // a ? (b => (c += d)) : (e => f) | ||
|
||
(a ? b => (c = d) : e => f : g); // a ? (b => ((c = d): e => f)) : g | ||
(a ? b => (c += d) : e => f : g); // ((a ? (b => (c += d)) : (e => f)) : g) |
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,3 @@ | ||
run_spec(__dirname, ["flow", "babel-flow"], { | ||
errors: { flow: ["arrows.js"] }, | ||
}); |
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
1 change: 1 addition & 0 deletions
1
tests/format/misc/errors/babel-flow/wrong-arrow-no-parens-jsx.js
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 @@ | ||
<T>(a => b); |
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