From 51ff2e7ed9df7e0fcca3cbeb4c4307e0ef638079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 5 Oct 2020 15:10:43 -0400 Subject: [PATCH] polish: update error message --- packages/babel-parser/src/parser/error-message.js | 2 +- .../class-properties/arguments-in-arrow-function/output.json | 2 +- .../output.json | 2 +- .../experimental/class-properties/arguments/output.json | 2 +- .../class-static-block/invalid-arguments/output.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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",