chore(deps): update dependency @babel/parser to v7.27.4 (#17545)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
renovate[bot]andfisker authored and GitHub committed 2025-06-02 23:22:49 +08:00
1 parent bbc79e670e
commit 4d226d0165
6 files changed
+72 -66

No files matched your search

+1 -1
View File
@@ -34,7 +34,7 @@
"dependencies": {
"@angular/compiler": "20.0.0",
"@babel/code-frame": "7.27.1",
"@babel/parser": "7.27.3",
"@babel/parser": "7.27.4",
"@babel/types": "7.27.3",
"@glimmer/syntax": "0.94.9",
"@prettier/cli": "0.8.0",
@@ -1,5 +1,8 @@
import createError from "../../../common/parser-create-error.js";
const parseExpressionErrorMessagePrefix =
"Unexpected parseExpression() input: ";
function createBabelParseError(error) {
let { message, loc, reasonCode } = error;
@@ -23,6 +26,10 @@ function createBabelParseError(error) {
message = message.slice(0, -suffix.length);
}
if (message.startsWith(parseExpressionErrorMessagePrefix)) {
message = message.slice(parseExpressionErrorMessagePrefix.length);
}
return createError(message, {
loc: { start: { line, column: column + 1 } },
cause,
+1 -2
View File
@@ -43,8 +43,7 @@ function parseJson(text, options = {}) {
if (
allowEmpty &&
error.code === "BABEL_PARSER_SYNTAX_ERROR" &&
error.reasonCode === "UnexpectedToken" &&
error.pos === text.length
error.reasonCode === "ParseExpressionEmptyInput"
) {
try {
ast = parseEmptyJson(text);
@@ -1,30 +1,30 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`snippet: #0 [json] format 1`] = `
"Unexpected token (4:29)
"The input is empty or contains only comments. (4:29)
2 | /** Block comment 1 */
3 | // Line comment 2
> 4 | /** Block comment 3 */
| ^
Cause: Unexpected token (4:28)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (4:28)"
`;
exports[`snippet: #0 [json-stringify] format 1`] = `
"Unexpected token (4:29)
"The input is empty or contains only comments. (4:29)
2 | /** Block comment 1 */
3 | // Line comment 2
> 4 | /** Block comment 3 */
| ^
Cause: Unexpected token (4:28)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (4:28)"
`;
exports[`snippet: #0 [json5] format 1`] = `
"Unexpected token (4:29)
"The input is empty or contains only comments. (4:29)
2 | /** Block comment 1 */
3 | // Line comment 2
> 4 | /** Block comment 3 */
| ^
Cause: Unexpected token (4:28)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (4:28)"
`;
exports[`snippet: #0 format 1`] = `
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`snippet: #0 [json] format 1`] = `
"Shorthand property is not allowed in JSON. (1:2)
@@ -120,10 +120,10 @@ Cause: 'await' is only allowed within async functions and at the top levels of m
`;
exports[`snippet: #2 [json] format 3`] = `
"Unexpected token (1:9)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:9)
> 1 | "string";
| ^
Cause: Unexpected token (1:8)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:8)"
`;
exports[`snippet: #2 [json-stringify] format 1`] = `
@@ -133,10 +133,10 @@ exports[`snippet: #2 [json-stringify] format 1`] = `
`;
exports[`snippet: #2 [json-stringify] format 2`] = `
"Unexpected token (1:9)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:9)
> 1 | "string";
| ^
Cause: Unexpected token (1:8)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:8)"
`;
exports[`snippet: #2 [json5] format 1`] = `
@@ -146,17 +146,17 @@ exports[`snippet: #2 [json5] format 1`] = `
`;
exports[`snippet: #2 [json5] format 2`] = `
"Unexpected token (1:9)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:9)
> 1 | "string";
| ^
Cause: Unexpected token (1:8)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:8)"
`;
exports[`snippet: #2 [jsonc] format 1`] = `
"Unexpected token (1:9)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:9)
> 1 | "string";
| ^
Cause: Unexpected token (1:8)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:8)"
`;
exports[`snippet: #3 [json] format 1`] = `
@@ -172,11 +172,11 @@ exports[`snippet: #3 [json] format 2`] = `
`;
exports[`snippet: #3 [json] format 3`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:1)
1 | "string"
> 2 | ;
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:0)"
`;
exports[`snippet: #3 [json-stringify] format 1`] = `
@@ -186,11 +186,11 @@ exports[`snippet: #3 [json-stringify] format 1`] = `
`;
exports[`snippet: #3 [json-stringify] format 2`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:1)
1 | "string"
> 2 | ;
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:0)"
`;
exports[`snippet: #3 [json5] format 1`] = `
@@ -200,19 +200,19 @@ exports[`snippet: #3 [json5] format 1`] = `
`;
exports[`snippet: #3 [json5] format 2`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:1)
1 | "string"
> 2 | ;
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:0)"
`;
exports[`snippet: #3 [jsonc] format 1`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:1)
1 | "string"
> 2 | ;
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:0)"
`;
exports[`snippet: #4 [json] format 1`] = `
@@ -338,10 +338,10 @@ Cause: Unexpected token, expected "," (1:2)"
`;
exports[`snippet: #6 [json] format 3`] = `
"Unexpected token (1:22)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:22)
> 1 | /* comment */"string";
| ^
Cause: Unexpected token (1:21)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:21)"
`;
exports[`snippet: #6 [json-stringify] format 1`] = `
@@ -351,10 +351,10 @@ exports[`snippet: #6 [json-stringify] format 1`] = `
`;
exports[`snippet: #6 [json-stringify] format 2`] = `
"Unexpected token (1:22)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:22)
> 1 | /* comment */"string";
| ^
Cause: Unexpected token (1:21)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:21)"
`;
exports[`snippet: #6 [json5] format 1`] = `
@@ -364,17 +364,17 @@ exports[`snippet: #6 [json5] format 1`] = `
`;
exports[`snippet: #6 [json5] format 2`] = `
"Unexpected token (1:22)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:22)
> 1 | /* comment */"string";
| ^
Cause: Unexpected token (1:21)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:21)"
`;
exports[`snippet: #6 [jsonc] format 1`] = `
"Unexpected token (1:22)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:22)
> 1 | /* comment */"string";
| ^
Cause: Unexpected token (1:21)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (1:21)"
`;
exports[`snippet: #7 [json] format 1`] = `
@@ -390,11 +390,11 @@ exports[`snippet: #7 [json] format 2`] = `
`;
exports[`snippet: #7 [json] format 3`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:1)
1 | /* comment */"string"
> 2 | ;
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:0)"
`;
exports[`snippet: #7 [json-stringify] format 1`] = `
@@ -404,11 +404,11 @@ exports[`snippet: #7 [json-stringify] format 1`] = `
`;
exports[`snippet: #7 [json-stringify] format 2`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:1)
1 | /* comment */"string"
> 2 | ;
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:0)"
`;
exports[`snippet: #7 [json5] format 1`] = `
@@ -418,19 +418,19 @@ exports[`snippet: #7 [json5] format 1`] = `
`;
exports[`snippet: #7 [json5] format 2`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:1)
1 | /* comment */"string"
> 2 | ;
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:0)"
`;
exports[`snippet: #7 [jsonc] format 1`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:1)
1 | /* comment */"string"
> 2 | ;
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`;\`. (2:0)"
`;
exports[`snippet: #8 [json] format 1`] = `
@@ -838,11 +838,11 @@ Cause: Unexpected token (1:0)"
`;
exports[`snippet: #22 [json] format 1`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`{\`. (2:1)
1 | "use strict"
> 2 | {}
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`{\`. (2:0)"
`;
exports[`snippet: #22 [json] format 2`] = `
@@ -853,26 +853,26 @@ Cause: Unexpected token (1:1)"
`;
exports[`snippet: #22 [json-stringify] format 1`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`{\`. (2:1)
1 | "use strict"
> 2 | {}
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`{\`. (2:0)"
`;
exports[`snippet: #22 [json5] format 1`] = `
"Unexpected token (2:1)
"The input should contain exactly one expression, but the first expression is followed by the unexpected character \`{\`. (2:1)
1 | "use strict"
> 2 | {}
| ^
Cause: Unexpected token (2:0)"
Cause: Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`{\`. (2:0)"
`;
exports[`snippet: #23 [json] format 1`] = `
"Unexpected token (1:14)
"The input is empty or contains only comments. (1:14)
> 1 | /* comment */
| ^
Cause: Unexpected token (1:13)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (1:13)"
`;
exports[`snippet: #23 [json] format 2`] = `
@@ -882,24 +882,24 @@ exports[`snippet: #23 [json] format 2`] = `
`;
exports[`snippet: #23 [json-stringify] format 1`] = `
"Unexpected token (1:14)
"The input is empty or contains only comments. (1:14)
> 1 | /* comment */
| ^
Cause: Unexpected token (1:13)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (1:13)"
`;
exports[`snippet: #23 [json5] format 1`] = `
"Unexpected token (1:14)
"The input is empty or contains only comments. (1:14)
> 1 | /* comment */
| ^
Cause: Unexpected token (1:13)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (1:13)"
`;
exports[`snippet: #24 [json] format 1`] = `
"Unexpected token (1:11)
"The input is empty or contains only comments. (1:11)
> 1 | // comment
| ^
Cause: Unexpected token (1:10)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (1:10)"
`;
exports[`snippet: #24 [json] format 2`] = `
@@ -909,17 +909,17 @@ exports[`snippet: #24 [json] format 2`] = `
`;
exports[`snippet: #24 [json-stringify] format 1`] = `
"Unexpected token (1:11)
"The input is empty or contains only comments. (1:11)
> 1 | // comment
| ^
Cause: Unexpected token (1:10)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (1:10)"
`;
exports[`snippet: #24 [json5] format 1`] = `
"Unexpected token (1:11)
"The input is empty or contains only comments. (1:11)
> 1 | // comment
| ^
Cause: Unexpected token (1:10)"
Cause: Unexpected parseExpression() input: The input is empty or contains only comments. (1:10)"
`;
exports[`snippet: #25 [json] format 1`] = `
+5 -5
View File
@@ -173,14 +173,14 @@ __metadata:
languageName: node
linkType: hard
"@babel/parser@npm:7.27.3, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.27.2, @babel/parser@npm:^7.27.3":
version: 7.27.3
resolution: "@babel/parser@npm:7.27.3"
"@babel/parser@npm:7.27.4, @babel/parser@npm:^7.1.0, @babel/parser@npm:^7.14.7, @babel/parser@npm:^7.20.7, @babel/parser@npm:^7.23.9, @babel/parser@npm:^7.27.2, @babel/parser@npm:^7.27.3":
version: 7.27.4
resolution: "@babel/parser@npm:7.27.4"
dependencies:
"@babel/types": "npm:^7.27.3"
bin:
parser: ./bin/babel-parser.js
checksum: 10/ea5a0cd55e18f905d4c732b009ca0f66b0e5580f0d2af82643c26ef0909a16704778f59b7a2959096e9cf881b6291da747bfd29e400422e04d9074eb1f80983e
checksum: 10/5ff6db87fd17de99792bf9a54480feeb069fc90ffa64ce96524c7437222549c86dde10fc1c945d4e9a94f3f2fc6ee4b3e1cfaf372f844bd054791e30089e92cf
languageName: node
linkType: hard
@@ -7211,7 +7211,7 @@ __metadata:
"@angular/compiler": "npm:20.0.0"
"@babel/code-frame": "npm:7.27.1"
"@babel/generator": "npm:7.27.3"
"@babel/parser": "npm:7.27.3"
"@babel/parser": "npm:7.27.4"
"@babel/types": "npm:7.27.3"
"@eslint-react/eslint-plugin": "npm:1.50.0"
"@eslint/js": "npm:9.27.0"