diff --git a/packages/babel-parser/src/parser/location.js b/packages/babel-parser/src/parser/location.js index 0e8aaf9960..035bbc7d04 100644 --- a/packages/babel-parser/src/parser/location.js +++ b/packages/babel-parser/src/parser/location.js @@ -35,8 +35,7 @@ export const Errors = Object.freeze({ ConstructorClassField: "Classes may not have a field named 'constructor'", ConstructorClassPrivateField: "Classes may not have a private field named '#constructor'", - // todo: rephrase to get/set accessor - ConstructorIsAccessor: "Constructor can't have get/set modifier", + ConstructorIsAccessor: "Class constructor may not be an accessor", ConstructorIsAsync: "Constructor can't be an async function", ConstructorIsGenerator: "Constructor can't be a generator", DeclarationMissingInitializer: "%0 require an initialization value", @@ -142,13 +141,12 @@ export const Errors = Object.freeze({ StrictEvalArgumentsBinding: "Binding '%0' in strict mode", StrictFunction: "In strict mode code, functions can only be declared at top level or inside a block", - StrictOctalLiteral: "Octal literal in strict mode", + StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode", StrictWith: "'with' in strict mode", SuperNotAllowed: "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?", SuperPrivateField: "Private fields can't be accessed on super", - //todo: rephrase this error message as it is too subjective - TrailingDecorator: "You have trailing decorators with no method", + TrailingDecorator: "Decorators must be attached to a class element", TupleExpressionBarIncorrectEndSyntaxType: "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", TupleExpressionBarIncorrectStartSyntaxType: @@ -177,18 +175,16 @@ export const Errors = Object.freeze({ UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", UnsupportedBind: "Binding should be performed on object property.", - //todo: rephrase this error message as it is too subjective UnsupportedDecoratorExport: - "You can only use decorators on an export when exporting a class", + "A decorated export must export a class declaration", UnsupportedDefaultExport: "Only expressions, functions or classes are allowed as the `default` export.", UnsupportedImport: "import can only be used in import() or import.meta", UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1", - //todo: remove Stage 2 as we are likely to forget updating when it progressed UnsupportedParameterDecorator: - "Stage 2 decorators cannot be used to decorate parameters", + "Decorators cannot be used to decorate parameters", UnsupportedPropertyDecorator: - "Stage 2 decorators disallow object literal property decorators", + "Decorators cannot be used to decorate object literal properties", UnsupportedSuper: "super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop])", UnterminatedComment: "Unterminated comment", diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index e445df729f..d673938712 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -104,9 +104,8 @@ const FlowErrors = Object.freeze({ UnexpectedReservedType: "Unexpected reserved type %0", UnexpectedReservedUnderscore: "`_` is only allowed as a type argument to call or new", - //todo: replace ´ by ` UnexpectedSpaceBetweenModuloChecks: - "Spaces between ´%´ and ´checks´ are not allowed here.", + "Spaces between `%` and `checks` are not allowed here.", UnexpectedSpreadType: "Spread operator cannot appear in class or interface definitions", UnexpectedSubtractionOperand: diff --git a/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive-function/output.json b/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive-function/output.json index a0c9784b85..2aa1a971de 100644 --- a/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive-function/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive-function/output.json @@ -13,15 +13,15 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (2:4)", - "SyntaxError: Octal literal in strict mode (7:4)", - "SyntaxError: Octal literal in strict mode (8:4)", - "SyntaxError: Octal literal in strict mode (14:4)", - "SyntaxError: Octal literal in strict mode (19:4)", - "SyntaxError: Octal literal in strict mode (20:4)", - "SyntaxError: Octal literal in strict mode (25:2)", - "SyntaxError: Octal literal in strict mode (30:2)", - "SyntaxError: Octal literal in strict mode (31:2)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (2:4)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (7:4)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (8:4)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (14:4)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (19:4)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (20:4)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (25:2)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (30:2)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (31:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive/output.json b/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive/output.json index a82b9fedbf..136553fe54 100644 --- a/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive/output.json @@ -13,18 +13,18 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (8:2)", - "SyntaxError: Octal literal in strict mode (9:2)", - "SyntaxError: Octal literal in strict mode (11:0)", - "SyntaxError: Octal literal in strict mode (12:0)", - "SyntaxError: Octal literal in strict mode (14:2)", - "SyntaxError: Octal literal in strict mode (14:10)", - "SyntaxError: Octal literal in strict mode (14:18)", - "SyntaxError: Octal literal in strict mode (1:2)", - "SyntaxError: Octal literal in strict mode (1:10)", - "SyntaxError: Octal literal in strict mode (1:18)", - "SyntaxError: Octal literal in strict mode (3:2)", - "SyntaxError: Octal literal in strict mode (4:2)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (8:2)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (9:2)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (11:0)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (12:0)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (14:2)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (14:10)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (14:18)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:2)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:10)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:18)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (3:2)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (4:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json index bda3123004..99253558c8 100644 --- a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:0)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json index 828fbbd75f..4f1229be25 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:35)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:35)" ], "program": { "type": "Program", @@ -158,4 +158,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json index f5ab6e0fd0..343c7244d1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:33)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)" ], "program": { "type": "Program", @@ -159,4 +159,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json index f73cb42cd9..6d3d9feff3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:38)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:38)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json index 9da2955ced..5eb3bcef0b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:36)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json index e52fa38ccf..81ea6460e3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:69)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:69)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json index ebcddc617e..98d2e05271 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:65)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:65)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json index 592b89bb27..9b383cded8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (2:10)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json index 4036096368..a7d3e10860 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (2:10)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json index b1c776635e..7a8ca4a874 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Constructor can't have get/set modifier (1:14)" + "SyntaxError: Class constructor may not be an accessor (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json index e964667083..18c0889f74 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:21)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json index e964667083..18c0889f74 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:21)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json index 48c8fda845..f2a0068be6 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:2)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json index 828fbbd75f..4f1229be25 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:35)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:35)" ], "program": { "type": "Program", @@ -158,4 +158,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json index f5ab6e0fd0..343c7244d1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:33)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)" ], "program": { "type": "Program", @@ -159,4 +159,4 @@ ], "directives": [] } -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json index f73cb42cd9..6d3d9feff3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:38)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:38)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json index 9da2955ced..5eb3bcef0b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:36)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json index 374201e48c..05630566bf 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:36)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json index 1c7a53167a..abebf79057 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json @@ -13,8 +13,8 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:36)", - "SyntaxError: Octal literal in strict mode (1:57)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)", + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:57)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json index e52fa38ccf..81ea6460e3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Octal literal in strict mode (1:69)" + "SyntaxError: Legacy octal literals are not allowed in strict mode (1:69)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json index d583a2ec11..d74849d8de 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Constructor can't have get/set modifier (1:13)" + "SyntaxError: Class constructor may not be an accessor (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json index 532d8ebe70..5fe83a6735 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Constructor can't have get/set modifier (1:13)" + "SyntaxError: Class constructor may not be an accessor (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json index 9f8814a38f..9ae808cfd6 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (2:14)" + "SyntaxError: Decorators cannot be used to decorate parameters (2:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json index ec6b85a88a..8443e39b2b 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (1:14)" + "SyntaxError: Decorators cannot be used to decorate parameters (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json index 2819428d5a..0628ebff2b 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (2:9)" + "SyntaxError: Decorators cannot be used to decorate parameters (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json index e50713954b..07e0fd653a 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Stage 2 decorators disallow object literal property decorators (2:2)" + "SyntaxError: Decorators cannot be used to decorate object literal properties (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json index 61c2c23daa..b1e699b351 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/no-export-decorators-without-class/options.json @@ -1,4 +1,7 @@ { - "throws": "You can only use decorators on an export when exporting a class (2:0)", + "plugins": [ + "decorators-legacy" + ], + "throws": "A decorated export must export a class declaration (2:0)", "sourceType": "module" -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/no-export-decorators/options.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-export-decorators/options.json index 61c2c23daa..b1e699b351 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/no-export-decorators/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/no-export-decorators/options.json @@ -1,4 +1,7 @@ { - "throws": "You can only use decorators on an export when exporting a class (2:0)", + "plugins": [ + "decorators-legacy" + ], + "throws": "A decorated export must export a class declaration (2:0)", "sourceType": "module" -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/42/options.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/42/options.json index 05a435eb99..7f6646ea0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/42/options.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/42/options.json @@ -1,4 +1,6 @@ { - "plugins": ["decorators-legacy"], - "throws": "You have trailing decorators with no method (1:18)" -} + "plugins": [ + "decorators-legacy" + ], + "throws": "Decorators must be attached to a class element (1:18)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/predicates/4/output.json b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json index e1e9eeffbc..7b38d3c94c 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Spaces between ´%´ and ´checks´ are not allowed here. (1:20)" + "SyntaxError: Spaces between `%` and `checks` are not allowed here. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/predicates/5/output.json b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json index 0d7a47afac..5d1c62f1f3 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Spaces between ´%´ and ´checks´ are not allowed here. (1:17)" + "SyntaxError: Spaces between `%` and `checks` are not allowed here. (1:17)" ], "program": { "type": "Program",