Skip to content

Commit

Permalink
Build(deps): Bump @babel/parser from 7.15.2 to 7.15.3 (#11345)
Browse files Browse the repository at this point in the history
* 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
dependabot[bot] and sosukesuzuki committed Aug 18, 2021
1 parent 051e205 commit 29b116b
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@angular/compiler": "12.2.1",
"@babel/code-frame": "7.14.5",
"@babel/parser": "7.15.2",
"@babel/parser": "7.15.3",
"@glimmer/syntax": "0.80.0",
"@iarna/toml": "2.2.5",
"@typescript-eslint/typescript-estree": "4.29.1",
Expand Down
35 changes: 35 additions & 0 deletions tests/format/flow/import/__snapshots__/jsfmt.spec.js.snap
@@ -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";
================================================================================
`;
4 changes: 4 additions & 0 deletions tests/format/flow/import/import-as-as.js
@@ -0,0 +1,4 @@
// @flow
import { foo as as } from "foo";
import { as as as } from "foo";
import { as as foo } from "foo";
1 change: 1 addition & 0 deletions tests/format/flow/import/jsfmt.spec.js
@@ -0,0 +1 @@
run_spec(__dirname, ["flow"]);
1 change: 1 addition & 0 deletions tests/format/flow/import/type-import-as-as.js
@@ -0,0 +1 @@
import {type foo as as} from "foo";
60 changes: 60 additions & 0 deletions tests/format/flow/ternary/__snapshots__/jsfmt.spec.js.snap
@@ -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"
`;
16 changes: 16 additions & 0 deletions tests/format/flow/ternary/arrows.js
@@ -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)
3 changes: 3 additions & 0 deletions tests/format/flow/ternary/jsfmt.spec.js
@@ -0,0 +1,3 @@
run_spec(__dirname, ["flow", "babel-flow"], {
errors: { flow: ["arrows.js"] },
});
Expand Up @@ -17,3 +17,17 @@ exports[`async-arrow-invalid.js [babel-flow] format 1`] = `
| ^
4 |"
`;
exports[`wrong-arrow-no-parens-jsx.js [babel] format 1`] = `
"Unterminated JSX contents. (1:4)
> 1 | <T>(a => b);
| ^
2 |"
`;
exports[`wrong-arrow-no-parens-jsx.js [babel-flow] format 1`] = `
"Unterminated JSX contents. (1:4)
> 1 | <T>(a => b);
| ^
2 |"
`;
@@ -0,0 +1 @@
<T>(a => b);
13 changes: 4 additions & 9 deletions yarn.lock
Expand Up @@ -298,15 +298,10 @@
chalk "^2.0.0"
js-tokens "^4.0.0"

"@babel/parser@7.15.2":
version "7.15.2"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.2.tgz#08d4ffcf90d211bf77e7cc7154c6f02d468d2b1d"
integrity sha512-bMJXql1Ss8lFnvr11TZDH4ArtwlAS5NG9qBmdiFW2UHHm6MVoR+GDc5XE2b9K938cyjc9O6/+vjjcffLDtfuDg==

"@babel/parser@^7.1.0", "@babel/parser@^7.14.5", "@babel/parser@^7.15.0", "@babel/parser@^7.7.2":
version "7.15.0"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.0.tgz#b6d6e29058ca369127b0eeca2a1c4b5794f1b6b9"
integrity sha512-0v7oNOjr6YT9Z2RAOTv4T9aP+ubfx4Q/OhVtAet7PFDt0t9Oy6Jn+/rfC6b8HJ5zEqrQCiMxJfgtHpmIminmJQ==
"@babel/parser@7.15.3", "@babel/parser@^7.1.0", "@babel/parser@^7.14.5", "@babel/parser@^7.15.0", "@babel/parser@^7.7.2":
version "7.15.3"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.15.3.tgz#3416d9bea748052cfcb63dbcc27368105b1ed862"
integrity sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA==

"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.14.5":
version "7.14.5"
Expand Down

0 comments on commit 29b116b

Please sign in to comment.