diff --git a/packages/babel-parser/src/parser/error-message.js b/packages/babel-parser/src/parser/error-message.js index 0383f7349973..d9cd63ab4a72 100644 --- a/packages/babel-parser/src/parser/error-message.js +++ b/packages/babel-parser/src/parser/error-message.js @@ -5,7 +5,7 @@ export const ErrorMessages = Object.freeze({ AccessorIsGenerator: "A %0ter cannot be a generator", ArgumentsInClass: - "'arguments' is not allowed in class field initializer or static block", + "'arguments' is only allowed in functions and class methods", AsyncFunctionInSingleStatementContext: "Async functions can only be declared at the top level or inside a block", AwaitBindingIdentifier: diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json index 45c3401a5665..e4fcbae89abd 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: 'arguments' is not allowed in class field initializer or static block (3:16)" + "SyntaxError: 'arguments' is only allowed in functions and class methods (3:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json index 1b9350050cdf..a6645c3bef45 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: 'arguments' is not allowed in class field initializer or static block (3:25)" + "SyntaxError: 'arguments' is only allowed in functions and class methods (3:25)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json index d260ced5130f..48d889e597ff 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: 'arguments' is not allowed in class field initializer or static block (3:10)" + "SyntaxError: 'arguments' is only allowed in functions and class methods (3:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-arguments/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-arguments/output.json index da6779ea63fe..3dd4e8af7079 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-arguments/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-arguments/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: 'arguments' is not allowed in class field initializer or static block (3:15)" + "SyntaxError: 'arguments' is only allowed in functions and class methods (3:15)" ], "program": { "type": "Program",