From 037273564f0b4e9dabb312593ef9b03c8ea17067 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Sun, 4 Apr 2021 02:31:07 +0900 Subject: [PATCH 01/12] Introduce parser error codes (#13033) --- .../babel-parser/src/parser/error-codes.js | 8 + .../babel-parser/src/parser/error-message.js | 437 +++++++++--------- packages/babel-parser/src/parser/error.js | 51 +- .../babel-parser/src/parser/expression.js | 14 +- packages/babel-parser/src/parser/statement.js | 10 +- packages/babel-parser/src/parser/util.js | 28 +- .../babel-parser/src/plugins/flow/index.js | 176 +++---- .../babel-parser/src/plugins/jsx/index.js | 40 +- .../babel-parser/src/plugins/placeholders.js | 10 +- .../src/plugins/typescript/index.js | 139 +++--- packages/babel-parser/src/tokenizer/index.js | 6 +- packages/babel-parser/src/tokenizer/state.js | 4 +- packages/babel-parser/src/util/class-scope.js | 4 +- .../babel-parser/src/util/expression-scope.js | 41 +- packages/babel-parser/src/util/scope.js | 4 +- packages/babel-parser/test/error-codes.js | 21 + 16 files changed, 551 insertions(+), 442 deletions(-) create mode 100644 packages/babel-parser/src/parser/error-codes.js create mode 100644 packages/babel-parser/test/error-codes.js diff --git a/packages/babel-parser/src/parser/error-codes.js b/packages/babel-parser/src/parser/error-codes.js new file mode 100644 index 000000000000..4e89302aae11 --- /dev/null +++ b/packages/babel-parser/src/parser/error-codes.js @@ -0,0 +1,8 @@ +// @flow + +export const ErrorCodes = Object.freeze({ + SyntaxError: "BABEL_PARSER_SYNTAX_ERROR", + SourceTypeModuleError: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED", +}); + +export type ErrorCode = $Values; diff --git a/packages/babel-parser/src/parser/error-message.js b/packages/babel-parser/src/parser/error-message.js index 2a46b8b7be00..a12f32ae23ea 100644 --- a/packages/babel-parser/src/parser/error-message.js +++ b/packages/babel-parser/src/parser/error-message.js @@ -1,4 +1,7 @@ // @flow + +import { makeErrorTemplates, ErrorCodes } from "./error"; + /* eslint sort-keys: "error" */ /** @@ -6,215 +9,225 @@ */ // The Errors key follows https://cs.chromium.org/chromium/src/v8/src/common/message-template.h unless it does not exist -export const ErrorMessages = Object.freeze({ - AccessorIsGenerator: "A %0ter cannot be a generator", - ArgumentsInClass: - "'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: - "Can not use 'await' as identifier inside an async function", - AwaitBindingIdentifierInStaticBlock: - "Can not use 'await' as identifier inside a static block", - AwaitExpressionFormalParameter: - "await is not allowed in async function parameters", - AwaitNotInAsyncContext: - "'await' is only allowed within async functions and at the top levels of modules", - AwaitNotInAsyncFunction: "'await' is only allowed within async functions", - BadGetterArity: "getter must not have any formal parameters", - BadSetterArity: "setter must have exactly one formal parameter", - BadSetterRestParameter: - "setter function argument must not be a rest parameter", - ConstructorClassField: "Classes may not have a field named 'constructor'", - ConstructorClassPrivateField: - "Classes may not have a private field named '#constructor'", - 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", - DecoratorBeforeExport: - "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax", - DecoratorConstructor: - "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", - DecoratorExportClass: - "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", - DecoratorSemicolon: "Decorators must not be followed by a semicolon", - DecoratorStaticBlock: "Decorators can't be used with a static block", - DeletePrivateField: "Deleting a private field is not allowed", - DestructureNamedImport: - "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", - DuplicateConstructor: "Duplicate constructor in the same class", - DuplicateDefaultExport: "Only one default export allowed per module.", - DuplicateExport: - "`%0` has already been exported. Exported identifiers must be unique.", - DuplicateProto: "Redefinition of __proto__ property", - DuplicateRegExpFlags: "Duplicate regular expression flag", - ElementAfterRest: "Rest element must be last element", - EscapedCharNotAnIdentifier: "Invalid Unicode escape", - ExportBindingIsString: - "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?", - ExportDefaultFromAsIdentifier: - "'from' is not allowed as an identifier after 'export default'", - ForInOfLoopInitializer: - "%0 loop variable declaration may not have an initializer", - ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", - GeneratorInSingleStatementContext: - "Generators can only be declared at the top level or inside a block", - IllegalBreakContinue: "Unsyntactic %0", - IllegalLanguageModeDirective: - "Illegal 'use strict' directive in function with non-simple parameter list", - IllegalReturn: "'return' outside of function", - ImportBindingIsString: - 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?', - ImportCallArgumentTrailingComma: - "Trailing comma is disallowed inside import(...) arguments", - ImportCallArity: "import() requires exactly %0", - ImportCallNotNewExpression: "Cannot use new with import(...)", - ImportCallSpreadArgument: "... is not allowed in import()", - ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`, - ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`, - InvalidBigIntLiteral: "Invalid BigIntLiteral", - InvalidCodePoint: "Code point out of bounds", - InvalidDecimal: "Invalid decimal", - InvalidDigit: "Expected number in radix %0", - InvalidEscapeSequence: "Bad character escape sequence", - InvalidEscapeSequenceTemplate: "Invalid escape sequence in template", - InvalidEscapedReservedWord: "Escape sequence in keyword %0", - InvalidIdentifier: "Invalid identifier %0", - InvalidLhs: "Invalid left-hand side in %0", - InvalidLhsBinding: "Binding invalid left-hand side in %0", - InvalidNumber: "Invalid number", - InvalidOrMissingExponent: - "Floating-point numbers require a valid exponent after the 'e'", - InvalidOrUnexpectedToken: "Unexpected character '%0'", - InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern", - InvalidPrivateFieldResolution: "Private name #%0 is not defined", - InvalidPropertyBindingPattern: "Binding member expression", - InvalidRecordProperty: - "Only properties and spread elements are allowed in record definitions", - InvalidRestAssignmentPattern: "Invalid rest operator's argument", - LabelRedeclaration: "Label '%0' is already declared", - LetInLexicalBinding: - "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", - LineTerminatorBeforeArrow: "No line break is allowed before '=>'", - MalformedRegExpFlags: "Invalid regular expression flag", - MissingClassName: "A class name is required", - MissingEqInAssignment: - "Only '=' operator can be used for specifying default value.", - MissingSemicolon: "Missing semicolon", - MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX", - MixingCoalesceWithLogical: - "Nullish coalescing operator(??) requires parens when mixing with logical operators", - ModuleAttributeDifferentFromType: - "The only accepted module attribute is `type`", - ModuleAttributeInvalidValue: - "Only string literals are allowed as module attribute values", - ModuleAttributesWithDuplicateKeys: - 'Duplicate key "%0" is not allowed in module attributes', - ModuleExportNameHasLoneSurrogate: - "An export name cannot include a lone surrogate, found '\\u%0'", - ModuleExportUndefined: "Export '%0' is not defined", - MultipleDefaultsInSwitch: "Multiple default clauses", - NewlineAfterThrow: "Illegal newline after throw", - NoCatchOrFinally: "Missing catch or finally clause", - NumberIdentifier: "Identifier directly after number", - NumericSeparatorInEscapeSequence: - "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences", - ObsoleteAwaitStar: - "await* has been removed from the async functions proposal. Use Promise.all() instead.", - OptionalChainingNoNew: - "constructors in/after an Optional Chain are not allowed", - OptionalChainingNoTemplate: - "Tagged Template Literals are not allowed in optionalChain", - ParamDupe: "Argument name clash", - PatternHasAccessor: "Object pattern can't contain getter or setter", - PatternHasMethod: "Object pattern can't contain methods", - PipelineBodyNoArrow: - 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized', - PipelineBodySequenceExpression: - "Pipeline body may not be a comma-separated sequence expression", - PipelineHeadSequenceExpression: - "Pipeline head should not be a comma-separated sequence expression", - PipelineTopicUnused: - "Pipeline is in topic style but does not use topic reference", - PrimaryTopicNotAllowed: - "Topic reference was used in a lexical context without topic binding", - PrimaryTopicRequiresSmartPipeline: - "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.", - PrivateInExpectedIn: - "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)", - PrivateNameRedeclaration: "Duplicate private name #%0", - RecordExpressionBarIncorrectEndSyntaxType: - "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", - RecordExpressionBarIncorrectStartSyntaxType: - "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", - RecordExpressionHashIncorrectStartSyntaxType: - "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'", - RecordNoProto: "'__proto__' is not allowed in Record expressions", - RestTrailingComma: "Unexpected trailing comma after rest element", - SloppyFunction: - "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement", - StaticPrototype: "Classes may not have static property named prototype", - StrictDelete: "Deleting local variable in strict mode", - StrictEvalArguments: "Assigning to '%0' in strict mode", - StrictEvalArgumentsBinding: "Binding '%0' in strict mode", - StrictFunction: - "In strict mode code, functions can only be declared at top level or inside a block", - StrictNumericEscape: "The only valid numeric escape in strict mode is '\\0'", - 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", - 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: - "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", - TupleExpressionHashIncorrectStartSyntaxType: - "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'", - UnexpectedArgumentPlaceholder: "Unexpected argument placeholder", - UnexpectedAwaitAfterPipelineBody: - 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal', - UnexpectedDigitAfterHash: "Unexpected digit after hash token", - UnexpectedImportExport: - "'import' and 'export' may only appear at the top level", - UnexpectedKeyword: "Unexpected keyword '%0'", - UnexpectedLeadingDecorator: - "Leading decorators must be attached to a class declaration", - UnexpectedLexicalDeclaration: - "Lexical declaration cannot appear in a single-statement context", - UnexpectedNewTarget: "new.target can only be used in functions", - UnexpectedNumericSeparator: - "A numeric separator is only allowed between two digits", - UnexpectedPrivateField: - "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).", - UnexpectedReservedWord: "Unexpected reserved word '%0'", - UnexpectedSuper: "super is only allowed in object methods and classes", - UnexpectedToken: "Unexpected token '%0'", - UnexpectedTokenUnaryExponentiation: - "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", - UnsupportedBind: "Binding should be performed on object property.", - UnsupportedDecoratorExport: - "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", - UnsupportedParameterDecorator: - "Decorators cannot be used to decorate parameters", - UnsupportedPropertyDecorator: - "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", - UnterminatedRegExp: "Unterminated regular expression", - UnterminatedString: "Unterminated string constant", - UnterminatedTemplate: "Unterminated template", - VarRedeclaration: "Identifier '%0' has already been declared", - YieldBindingIdentifier: - "Can not use 'yield' as identifier inside a generator", - YieldInParameter: "Yield expression is not allowed in formal parameters", - ZeroDigitNumericSeparator: - "Numeric separator can not be used after leading 0", -}); +export const ErrorMessages = makeErrorTemplates( + { + AccessorIsGenerator: "A %0ter cannot be a generator", + ArgumentsInClass: + "'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: + "Can not use 'await' as identifier inside an async function", + AwaitBindingIdentifierInStaticBlock: + "Can not use 'await' as identifier inside a static block", + AwaitExpressionFormalParameter: + "await is not allowed in async function parameters", + AwaitNotInAsyncContext: + "'await' is only allowed within async functions and at the top levels of modules", + AwaitNotInAsyncFunction: "'await' is only allowed within async functions", + BadGetterArity: "getter must not have any formal parameters", + BadSetterArity: "setter must have exactly one formal parameter", + BadSetterRestParameter: + "setter function argument must not be a rest parameter", + ConstructorClassField: "Classes may not have a field named 'constructor'", + ConstructorClassPrivateField: + "Classes may not have a private field named '#constructor'", + 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", + DecoratorBeforeExport: + "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax", + DecoratorConstructor: + "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", + DecoratorExportClass: + "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", + DecoratorSemicolon: "Decorators must not be followed by a semicolon", + DecoratorStaticBlock: "Decorators can't be used with a static block", + DeletePrivateField: "Deleting a private field is not allowed", + DestructureNamedImport: + "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", + DuplicateConstructor: "Duplicate constructor in the same class", + DuplicateDefaultExport: "Only one default export allowed per module.", + DuplicateExport: + "`%0` has already been exported. Exported identifiers must be unique.", + DuplicateProto: "Redefinition of __proto__ property", + DuplicateRegExpFlags: "Duplicate regular expression flag", + ElementAfterRest: "Rest element must be last element", + EscapedCharNotAnIdentifier: "Invalid Unicode escape", + ExportBindingIsString: + "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?", + ExportDefaultFromAsIdentifier: + "'from' is not allowed as an identifier after 'export default'", + ForInOfLoopInitializer: + "%0 loop variable declaration may not have an initializer", + ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", + GeneratorInSingleStatementContext: + "Generators can only be declared at the top level or inside a block", + IllegalBreakContinue: "Unsyntactic %0", + IllegalLanguageModeDirective: + "Illegal 'use strict' directive in function with non-simple parameter list", + IllegalReturn: "'return' outside of function", + ImportBindingIsString: + 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?', + ImportCallArgumentTrailingComma: + "Trailing comma is disallowed inside import(...) arguments", + ImportCallArity: "import() requires exactly %0", + ImportCallNotNewExpression: "Cannot use new with import(...)", + ImportCallSpreadArgument: "... is not allowed in import()", + InvalidBigIntLiteral: "Invalid BigIntLiteral", + InvalidCodePoint: "Code point out of bounds", + InvalidDecimal: "Invalid decimal", + InvalidDigit: "Expected number in radix %0", + InvalidEscapeSequence: "Bad character escape sequence", + InvalidEscapeSequenceTemplate: "Invalid escape sequence in template", + InvalidEscapedReservedWord: "Escape sequence in keyword %0", + InvalidIdentifier: "Invalid identifier %0", + InvalidLhs: "Invalid left-hand side in %0", + InvalidLhsBinding: "Binding invalid left-hand side in %0", + InvalidNumber: "Invalid number", + InvalidOrMissingExponent: + "Floating-point numbers require a valid exponent after the 'e'", + InvalidOrUnexpectedToken: "Unexpected character '%0'", + InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern", + InvalidPrivateFieldResolution: "Private name #%0 is not defined", + InvalidPropertyBindingPattern: "Binding member expression", + InvalidRecordProperty: + "Only properties and spread elements are allowed in record definitions", + InvalidRestAssignmentPattern: "Invalid rest operator's argument", + LabelRedeclaration: "Label '%0' is already declared", + LetInLexicalBinding: + "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", + LineTerminatorBeforeArrow: "No line break is allowed before '=>'", + MalformedRegExpFlags: "Invalid regular expression flag", + MissingClassName: "A class name is required", + MissingEqInAssignment: + "Only '=' operator can be used for specifying default value.", + MissingSemicolon: "Missing semicolon", + MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX", + MixingCoalesceWithLogical: + "Nullish coalescing operator(??) requires parens when mixing with logical operators", + ModuleAttributeDifferentFromType: + "The only accepted module attribute is `type`", + ModuleAttributeInvalidValue: + "Only string literals are allowed as module attribute values", + ModuleAttributesWithDuplicateKeys: + 'Duplicate key "%0" is not allowed in module attributes', + ModuleExportNameHasLoneSurrogate: + "An export name cannot include a lone surrogate, found '\\u%0'", + ModuleExportUndefined: "Export '%0' is not defined", + MultipleDefaultsInSwitch: "Multiple default clauses", + NewlineAfterThrow: "Illegal newline after throw", + NoCatchOrFinally: "Missing catch or finally clause", + NumberIdentifier: "Identifier directly after number", + NumericSeparatorInEscapeSequence: + "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences", + ObsoleteAwaitStar: + "await* has been removed from the async functions proposal. Use Promise.all() instead.", + OptionalChainingNoNew: + "constructors in/after an Optional Chain are not allowed", + OptionalChainingNoTemplate: + "Tagged Template Literals are not allowed in optionalChain", + ParamDupe: "Argument name clash", + PatternHasAccessor: "Object pattern can't contain getter or setter", + PatternHasMethod: "Object pattern can't contain methods", + PipelineBodyNoArrow: + 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized', + PipelineBodySequenceExpression: + "Pipeline body may not be a comma-separated sequence expression", + PipelineHeadSequenceExpression: + "Pipeline head should not be a comma-separated sequence expression", + PipelineTopicUnused: + "Pipeline is in topic style but does not use topic reference", + PrimaryTopicNotAllowed: + "Topic reference was used in a lexical context without topic binding", + PrimaryTopicRequiresSmartPipeline: + "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.", + PrivateInExpectedIn: + "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)", + PrivateNameRedeclaration: "Duplicate private name #%0", + RecordExpressionBarIncorrectEndSyntaxType: + "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", + RecordExpressionBarIncorrectStartSyntaxType: + "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", + RecordExpressionHashIncorrectStartSyntaxType: + "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'", + RecordNoProto: "'__proto__' is not allowed in Record expressions", + RestTrailingComma: "Unexpected trailing comma after rest element", + SloppyFunction: + "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement", + StaticPrototype: "Classes may not have static property named prototype", + StrictDelete: "Deleting local variable in strict mode", + StrictEvalArguments: "Assigning to '%0' in strict mode", + StrictEvalArgumentsBinding: "Binding '%0' in strict mode", + StrictFunction: + "In strict mode code, functions can only be declared at top level or inside a block", + StrictNumericEscape: + "The only valid numeric escape in strict mode is '\\0'", + 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", + 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: + "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", + TupleExpressionHashIncorrectStartSyntaxType: + "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'", + UnexpectedArgumentPlaceholder: "Unexpected argument placeholder", + UnexpectedAwaitAfterPipelineBody: + 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal', + UnexpectedDigitAfterHash: "Unexpected digit after hash token", + UnexpectedImportExport: + "'import' and 'export' may only appear at the top level", + UnexpectedKeyword: "Unexpected keyword '%0'", + UnexpectedLeadingDecorator: + "Leading decorators must be attached to a class declaration", + UnexpectedLexicalDeclaration: + "Lexical declaration cannot appear in a single-statement context", + UnexpectedNewTarget: "new.target can only be used in functions", + UnexpectedNumericSeparator: + "A numeric separator is only allowed between two digits", + UnexpectedPrivateField: + "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).", + UnexpectedReservedWord: "Unexpected reserved word '%0'", + UnexpectedSuper: "super is only allowed in object methods and classes", + UnexpectedToken: "Unexpected token '%0'", + UnexpectedTokenUnaryExponentiation: + "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", + UnsupportedBind: "Binding should be performed on object property.", + UnsupportedDecoratorExport: + "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", + UnsupportedParameterDecorator: + "Decorators cannot be used to decorate parameters", + UnsupportedPropertyDecorator: + "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", + UnterminatedRegExp: "Unterminated regular expression", + UnterminatedString: "Unterminated string constant", + UnterminatedTemplate: "Unterminated template", + VarRedeclaration: "Identifier '%0' has already been declared", + YieldBindingIdentifier: + "Can not use 'yield' as identifier inside a generator", + YieldInParameter: "Yield expression is not allowed in formal parameters", + ZeroDigitNumericSeparator: + "Numeric separator can not be used after leading 0", + }, + /* code */ ErrorCodes.SyntaxError, +); + +export const SourceTypeModuleErrorMessages = makeErrorTemplates( + { + ImportMetaOutsideModule: `import.meta may appear only with 'sourceType: "module"'`, + ImportOutsideModule: `'import' and 'export' may appear only with 'sourceType: "module"'`, + }, + /* code */ ErrorCodes.SourceTypeModuleError, +); diff --git a/packages/babel-parser/src/parser/error.js b/packages/babel-parser/src/parser/error.js index ead11e796bb0..7c805001e67a 100644 --- a/packages/babel-parser/src/parser/error.js +++ b/packages/babel-parser/src/parser/error.js @@ -2,6 +2,7 @@ /* eslint sort-keys: "error" */ import { getLineInfo, type Position } from "../util/location"; import CommentsParser from "./comments"; +import { type ErrorCode, ErrorCodes } from "./error-codes"; // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate @@ -14,11 +15,43 @@ type ErrorContext = { loc: Position, missingPlugin?: Array, code?: string, + reasonCode?: String, }; - export type ParsingError = SyntaxError & ErrorContext; -export { ErrorMessages as Errors } from "./error-message"; +export type ErrorTemplate = { + code: ErrorCode, + template: string, + reasonCode: string, +}; +export type ErrorTemplates = { + [key: string]: ErrorTemplate, +}; + +export function makeErrorTemplates( + messages: { + [key: string]: string, + }, + code: ErrorCode, +): ErrorTemplates { + const templates: ErrorTemplates = {}; + Object.keys(messages).forEach(reasonCode => { + templates[reasonCode] = { + code, + reasonCode, + template: messages[reasonCode], + }; + }); + return Object.freeze(templates); +} + +export { ErrorCodes }; +export { + ErrorMessages as Errors, + SourceTypeModuleErrorMessages as SourceTypeModuleErrors, +} from "./error-message"; + +export type raiseFunction = (number, ErrorTemplate, ...any) => void; export default class ParserError extends CommentsParser { // Forward-declaration: defined in tokenizer/index.js @@ -37,8 +70,12 @@ export default class ParserError extends CommentsParser { return loc; } - raise(pos: number, errorTemplate: string, ...params: any): Error | empty { - return this.raiseWithData(pos, undefined, errorTemplate, ...params); + raise( + pos: number, + { code, reasonCode, template }: ErrorTemplate, + ...params: any + ): Error | empty { + return this.raiseWithData(pos, { code, reasonCode }, template, ...params); } /** @@ -55,12 +92,12 @@ export default class ParserError extends CommentsParser { */ raiseOverwrite( pos: number, - errorTemplate: string, + { code, template }: ErrorTemplate, ...params: any ): Error | empty { const loc = this.getLocationForPosition(pos); const message = - errorTemplate.replace(/%(\d+)/g, (_, i: number) => params[i]) + + template.replace(/%(\d+)/g, (_, i: number) => params[i]) + ` (${loc.line}:${loc.column})`; if (this.options.errorRecovery) { const errors = this.state.errors; @@ -73,7 +110,7 @@ export default class ParserError extends CommentsParser { } } } - return this._raise({ loc, pos }, message); + return this._raise({ code, loc, pos }, message); } raiseWithData( diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 9a3271a8262b..3c3a640ca5e6 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -54,7 +54,7 @@ import { newAsyncArrowScope, newExpressionScope, } from "../util/expression-scope"; -import { Errors } from "./error"; +import { Errors, SourceTypeModuleErrors } from "./error"; /*:: import type { SourceType } from "../options"; @@ -1358,11 +1358,7 @@ export default class ExpressionParser extends LValParser { if (this.isContextual("meta")) { if (!this.inModule) { - this.raiseWithData( - id.start, - { code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" }, - Errors.ImportMetaOutsideModule, - ); + this.raise(id.start, SourceTypeModuleErrors.ImportMetaOutsideModule); } this.sawUnambiguousESM = true; } @@ -1524,14 +1520,14 @@ export default class ExpressionParser extends LValParser { const metaProp = this.parseMetaProperty(node, meta, "target"); if (!this.scope.inNonArrowFunction && !this.scope.inClass) { - let error = Errors.UnexpectedNewTarget; + const errorTemplate = { ...Errors.UnexpectedNewTarget }; if (this.hasPlugin("classProperties")) { - error += " or class properties"; + errorTemplate.template += " or class properties"; } /* eslint-disable @babel/development-internal/dry-error-messages */ - this.raise(metaProp.start, error); + this.raise(metaProp.start, errorTemplate); /* eslint-enable @babel/development-internal/dry-error-messages */ } diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 28813bb6de8b..0bc322207d01 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -3,7 +3,7 @@ import * as N from "../types"; import { types as tt, type TokenType } from "../tokenizer/types"; import ExpressionParser from "./expression"; -import { Errors } from "./error"; +import { Errors, SourceTypeModuleErrors } from "./error"; import { isIdentifierChar, isIdentifierStart, @@ -324,13 +324,7 @@ export default class StatementParser extends ExpressionParser { assertModuleNodeAllowed(node: N.Node): void { if (!this.options.allowImportExportEverywhere && !this.inModule) { - this.raiseWithData( - node.start, - { - code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED", - }, - Errors.ImportOutsideModule, - ); + this.raise(node.start, SourceTypeModuleErrors.ImportOutsideModule); } } diff --git a/packages/babel-parser/src/parser/util.js b/packages/babel-parser/src/parser/util.js index 53156c577f5d..6b768d6837eb 100644 --- a/packages/babel-parser/src/parser/util.js +++ b/packages/babel-parser/src/parser/util.js @@ -1,6 +1,6 @@ // @flow -import { types as tt, type TokenType } from "../tokenizer/types"; +import { types as tt, TokenType } from "../tokenizer/types"; import Tokenizer from "../tokenizer"; import State from "../tokenizer/state"; import type { Node } from "../types"; @@ -13,7 +13,7 @@ import ProductionParameterHandler, { PARAM_AWAIT, PARAM, } from "../util/production-parameter"; -import { Errors } from "./error"; +import { Errors, type ErrorTemplate, ErrorCodes } from "./error"; /*:: import type ScopeHandler from "../util/scope"; */ @@ -91,8 +91,8 @@ export default class UtilParser extends Tokenizer { // Asserts that following token is given contextual keyword. - expectContextual(name: string, message?: string): void { - if (!this.eatContextual(name)) this.unexpected(null, message); + expectContextual(name: string, template?: ErrorTemplate): void { + if (!this.eatContextual(name)) this.unexpected(null, template); } // Test whether a semicolon can be inserted at the current position. @@ -142,7 +142,11 @@ export default class UtilParser extends Tokenizer { assertNoSpace(message: string = "Unexpected space."): void { if (this.state.start > this.state.lastTokEnd) { /* eslint-disable @babel/development-internal/dry-error-messages */ - this.raise(this.state.lastTokEnd, message); + this.raise(this.state.lastTokEnd, { + code: ErrorCodes.SyntaxError, + reasonCode: "UnexpectedSpace", + template: message, + }); /* eslint-enable @babel/development-internal/dry-error-messages */ } } @@ -152,10 +156,18 @@ export default class UtilParser extends Tokenizer { unexpected( pos: ?number, - messageOrType: string | TokenType = "Unexpected token", + messageOrType: ErrorTemplate | TokenType = { + code: ErrorCodes.SyntaxError, + reasonCode: "UnexpectedToken", + template: "Unexpected token", + }, ): empty { - if (typeof messageOrType !== "string") { - messageOrType = `Unexpected token, expected "${messageOrType.label}"`; + if (messageOrType instanceof TokenType) { + messageOrType = { + code: ErrorCodes.SyntaxError, + reasonCode: "UnexpectedToken", + template: `Unexpected token, expected "${messageOrType.label}"`, + }; } /* eslint-disable @babel/development-internal/dry-error-messages */ throw this.raise(pos != null ? pos : this.state.start, messageOrType); diff --git a/packages/babel-parser/src/plugins/flow/index.js b/packages/babel-parser/src/plugins/flow/index.js index 8dba2a977a6e..7176a8e389dc 100644 --- a/packages/babel-parser/src/plugins/flow/index.js +++ b/packages/babel-parser/src/plugins/flow/index.js @@ -25,7 +25,7 @@ import { SCOPE_OTHER, } from "../../util/scopeflags"; import type { ExpressionErrors } from "../../parser/util"; -import { Errors } from "../../parser/error"; +import { Errors, makeErrorTemplates, ErrorCodes } from "../../parser/error"; const reservedTypes = new Set([ "_", @@ -48,91 +48,95 @@ const reservedTypes = new Set([ /* eslint sort-keys: "error" */ // The Errors key follows https://github.com/facebook/flow/blob/master/src/parser/parse_error.ml unless it does not exist -const FlowErrors = Object.freeze({ - AmbiguousConditionalArrow: - "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", - AmbiguousDeclareModuleKind: - "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module", - AssignReservedType: "Cannot overwrite reserved type %0", - DeclareClassElement: - "The `declare` modifier can only appear on class fields.", - DeclareClassFieldInitializer: - "Initializers are not allowed in fields with the `declare` modifier.", - DuplicateDeclareModuleExports: "Duplicate `declare module.exports` statement", - EnumBooleanMemberNotInitialized: - "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.", - EnumDuplicateMemberName: - "Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.", - EnumInconsistentMemberValues: - "Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.", - EnumInvalidExplicitType: - "Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.", - EnumInvalidExplicitTypeUnknownSupplied: - "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.", - EnumInvalidMemberInitializerPrimaryType: - "Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.", - EnumInvalidMemberInitializerSymbolType: - "Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.", - EnumInvalidMemberInitializerUnknownType: - "The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.", - EnumInvalidMemberName: - "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.", - EnumNumberMemberNotInitialized: - "Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.", - EnumStringMemberInconsistentlyInitailized: - "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.", - GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", - ImportTypeShorthandOnlyInPureImport: - "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements", - InexactInsideExact: - "Explicit inexact syntax cannot appear inside an explicit exact object type", - InexactInsideNonObject: - "Explicit inexact syntax cannot appear in class or interface definitions", - InexactVariance: "Explicit inexact syntax cannot have variance", - InvalidNonTypeImportInDeclareModule: - "Imports within a `declare module` body must always be `import type` or `import typeof`", - MissingTypeParamDefault: - "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", - NestedDeclareModule: - "`declare module` cannot be used inside another `declare module`", - NestedFlowComment: "Cannot have a flow comment inside another flow comment", - OptionalBindingPattern: - "A binding pattern parameter cannot be optional in an implementation signature.", - SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", - SpreadVariance: "Spread properties cannot have variance", - ThisParamAnnotationRequired: - "A type annotation is required for the `this` parameter.", - ThisParamBannedInConstructor: - "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", - ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", - ThisParamMustBeFirst: - "The `this` parameter must be the first function parameter.", - ThisParamNoDefault: "The `this` parameter may not have a default value.", - TypeBeforeInitializer: - "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", - TypeCastInPattern: - "The type cast expression is expected to be wrapped with parenthesis", - UnexpectedExplicitInexactInObject: - "Explicit inexact syntax must appear at the end of an inexact object", - UnexpectedReservedType: "Unexpected reserved type %0", - UnexpectedReservedUnderscore: - "`_` is only allowed as a type argument to call or new", - UnexpectedSpaceBetweenModuloChecks: - "Spaces between `%` and `checks` are not allowed here.", - UnexpectedSpreadType: - "Spread operator cannot appear in class or interface definitions", - UnexpectedSubtractionOperand: - 'Unexpected token, expected "number" or "bigint"', - UnexpectedTokenAfterTypeParameter: - "Expected an arrow function after this type parameter declaration", - UnexpectedTypeParameterBeforeAsyncArrowFunction: - "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`", - UnsupportedDeclareExportKind: - "`declare export %0` is not supported. Use `%1` instead", - UnsupportedStatementInDeclareModule: - "Only declares and type imports are allowed inside declare module", - UnterminatedFlowComment: "Unterminated flow-comment", -}); +const FlowErrors = makeErrorTemplates( + { + AmbiguousConditionalArrow: + "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", + AmbiguousDeclareModuleKind: + "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module", + AssignReservedType: "Cannot overwrite reserved type %0", + DeclareClassElement: + "The `declare` modifier can only appear on class fields.", + DeclareClassFieldInitializer: + "Initializers are not allowed in fields with the `declare` modifier.", + DuplicateDeclareModuleExports: + "Duplicate `declare module.exports` statement", + EnumBooleanMemberNotInitialized: + "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.", + EnumDuplicateMemberName: + "Enum member names need to be unique, but the name `%0` has already been used before in enum `%1`.", + EnumInconsistentMemberValues: + "Enum `%0` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.", + EnumInvalidExplicitType: + "Enum type `%1` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.", + EnumInvalidExplicitTypeUnknownSupplied: + "Supplied enum type is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `%0`.", + EnumInvalidMemberInitializerPrimaryType: + "Enum `%0` has type `%2`, so the initializer of `%1` needs to be a %2 literal.", + EnumInvalidMemberInitializerSymbolType: + "Symbol enum members cannot be initialized. Use `%1,` in enum `%0`.", + EnumInvalidMemberInitializerUnknownType: + "The enum member initializer for `%1` needs to be a literal (either a boolean, number, or string) in enum `%0`.", + EnumInvalidMemberName: + "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `%0`, consider using `%1`, in enum `%2`.", + EnumNumberMemberNotInitialized: + "Number enum members need to be initialized, e.g. `%1 = 1` in enum `%0`.", + EnumStringMemberInconsistentlyInitailized: + "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.", + GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", + ImportTypeShorthandOnlyInPureImport: + "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements", + InexactInsideExact: + "Explicit inexact syntax cannot appear inside an explicit exact object type", + InexactInsideNonObject: + "Explicit inexact syntax cannot appear in class or interface definitions", + InexactVariance: "Explicit inexact syntax cannot have variance", + InvalidNonTypeImportInDeclareModule: + "Imports within a `declare module` body must always be `import type` or `import typeof`", + MissingTypeParamDefault: + "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", + NestedDeclareModule: + "`declare module` cannot be used inside another `declare module`", + NestedFlowComment: "Cannot have a flow comment inside another flow comment", + OptionalBindingPattern: + "A binding pattern parameter cannot be optional in an implementation signature.", + SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", + SpreadVariance: "Spread properties cannot have variance", + ThisParamAnnotationRequired: + "A type annotation is required for the `this` parameter.", + ThisParamBannedInConstructor: + "Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.", + ThisParamMayNotBeOptional: "The `this` parameter cannot be optional.", + ThisParamMustBeFirst: + "The `this` parameter must be the first function parameter.", + ThisParamNoDefault: "The `this` parameter may not have a default value.", + TypeBeforeInitializer: + "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", + TypeCastInPattern: + "The type cast expression is expected to be wrapped with parenthesis", + UnexpectedExplicitInexactInObject: + "Explicit inexact syntax must appear at the end of an inexact object", + UnexpectedReservedType: "Unexpected reserved type %0", + UnexpectedReservedUnderscore: + "`_` is only allowed as a type argument to call or new", + UnexpectedSpaceBetweenModuloChecks: + "Spaces between `%` and `checks` are not allowed here.", + UnexpectedSpreadType: + "Spread operator cannot appear in class or interface definitions", + UnexpectedSubtractionOperand: + 'Unexpected token, expected "number" or "bigint"', + UnexpectedTokenAfterTypeParameter: + "Expected an arrow function after this type parameter declaration", + UnexpectedTypeParameterBeforeAsyncArrowFunction: + "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`", + UnsupportedDeclareExportKind: + "`declare export %0` is not supported. Use `%1` instead", + UnsupportedStatementInDeclareModule: + "Only declares and type imports are allowed inside declare module", + UnterminatedFlowComment: "Unterminated flow-comment", + }, + /* code */ ErrorCodes.SyntaxError, +); /* eslint-disable sort-keys */ function isEsModuleType(bodyElement: N.Node): boolean { diff --git a/packages/babel-parser/src/plugins/jsx/index.js b/packages/babel-parser/src/plugins/jsx/index.js index f8b6a3dd888b..1ee94e4bd802 100644 --- a/packages/babel-parser/src/plugins/jsx/index.js +++ b/packages/babel-parser/src/plugins/jsx/index.js @@ -14,25 +14,28 @@ import * as N from "../../types"; import { isIdentifierChar, isIdentifierStart } from "../../util/identifier"; import type { Position } from "../../util/location"; import { isNewLine } from "../../util/whitespace"; -import { Errors } from "../../parser/error"; +import { Errors, makeErrorTemplates, ErrorCodes } from "../../parser/error"; const HEX_NUMBER = /^[\da-fA-F]+$/; const DECIMAL_NUMBER = /^\d+$/; /* eslint sort-keys: "error" */ -const JsxErrors = Object.freeze({ - AttributeIsEmpty: - "JSX attributes must only be assigned a non-empty expression", - MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>", - MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>", - UnexpectedSequenceExpression: - "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", - UnsupportedJsxValue: - "JSX value should be either an expression or a quoted JSX text", - UnterminatedJsxContent: "Unterminated JSX contents", - UnwrappedAdjacentJSXElements: - "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?", -}); +const JsxErrors = makeErrorTemplates( + { + AttributeIsEmpty: + "JSX attributes must only be assigned a non-empty expression", + MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>", + MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>", + UnexpectedSequenceExpression: + "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", + UnsupportedJsxValue: + "JSX value should be either an expression or a quoted JSX text", + UnterminatedJsxContent: "Unterminated JSX contents", + UnwrappedAdjacentJSXElements: + "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?", + }, + /* code */ ErrorCodes.SyntaxError, +); /* eslint-disable sort-keys */ // Be aware that this file is always executed and not only when the plugin is enabled. @@ -133,10 +136,11 @@ export default (superClass: Class): Class => const htmlEntity = ch === charCodes.rightCurlyBrace ? "}" : ">"; const char = this.input[this.state.pos]; - this.raise( - this.state.pos, - `Unexpected token \`${char}\`. Did you mean \`${htmlEntity}\` or \`{'${char}'}\`?`, - ); + this.raise(this.state.pos, { + code: ErrorCodes.SyntaxError, + reasonCode: "UnexpectedToken", + template: `Unexpected token \`${char}\`. Did you mean \`${htmlEntity}\` or \`{'${char}'}\`?`, + }); } /* falls through */ diff --git a/packages/babel-parser/src/plugins/placeholders.js b/packages/babel-parser/src/plugins/placeholders.js index 3364a74ef15c..82f2acf974b7 100644 --- a/packages/babel-parser/src/plugins/placeholders.js +++ b/packages/babel-parser/src/plugins/placeholders.js @@ -5,6 +5,7 @@ import * as charCodes from "charcodes"; import { types as tt, TokenType } from "../tokenizer/types"; import type Parser from "../parser"; import * as N from "../types"; +import { makeErrorTemplates, ErrorCodes } from "../parser/error"; tt.placeholder = new TokenType("%%", { startsExpr: true }); @@ -47,6 +48,13 @@ type NodeOf = $Switch< // the substituted nodes. type MaybePlaceholder = NodeOf; // | Placeholder +const PlaceHolderErrors = makeErrorTemplates( + { + ClassNameIsRequired: "A class name is required", + }, + /* code */ ErrorCodes.SyntaxError, +); + export default (superClass: Class): Class => class extends superClass { parsePlaceholder( @@ -240,7 +248,7 @@ export default (superClass: Class): Class => node.body = this.finishPlaceholder(placeholder, "ClassBody"); return this.finishNode(node, type); } else { - this.unexpected(null, "A class name is required"); + this.unexpected(null, PlaceHolderErrors.ClassNameIsRequired); } } else { this.parseClassId(node, isStatement, optionalId); diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 0ec491241272..4f7795c03cf1 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -29,7 +29,12 @@ import TypeScriptScopeHandler from "./scope"; import * as charCodes from "charcodes"; import type { ExpressionErrors } from "../../parser/util"; import { PARAM } from "../../util/production-parameter"; -import { Errors } from "../../parser/error"; +import { + Errors, + makeErrorTemplates, + type ErrorTemplate, + ErrorCodes, +} from "../../parser/error"; type TsModifier = | "readonly" @@ -60,67 +65,75 @@ type ParsingContext = | "TypeParametersOrArguments"; /* eslint sort-keys: "error" */ -const TSErrors = Object.freeze({ - AbstractMethodHasImplementation: - "Method '%0' cannot have an implementation because it is marked abstract.", - ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier", - ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier", - ConstructorHasTypeParameters: - "Type parameters cannot appear on a constructor declaration.", +const TSErrors = makeErrorTemplates( + { + AbstractMethodHasImplementation: + "Method '%0' cannot have an implementation because it is marked abstract.", + ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier", + ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier", + ConstructorHasTypeParameters: + "Type parameters cannot appear on a constructor declaration.", DeclareAccessor: "'declare' is not allowed in %0ters.", - DeclareClassFieldHasInitializer: - "Initializers are not allowed in ambient contexts.", - DeclareFunctionHasImplementation: - "An implementation cannot be declared in ambient contexts.", - DuplicateAccessibilityModifier: "Accessibility modifier already seen.", - DuplicateModifier: "Duplicate modifier: '%0'", - EmptyHeritageClauseType: "'%0' list cannot be empty.", - EmptyTypeArguments: "Type argument list cannot be empty.", - EmptyTypeParameters: "Type parameter list cannot be empty.", - ExpectedAmbientAfterExportDeclare: - "'export declare' must be followed by an ambient declaration.", - ImportAliasHasImportType: "An import alias can not use 'import type'", - IndexSignatureHasAbstract: - "Index signatures cannot have the 'abstract' modifier", - IndexSignatureHasAccessibility: - "Index signatures cannot have an accessibility modifier ('%0')", - IndexSignatureHasDeclare: - "Index signatures cannot have the 'declare' modifier", - IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier", - InvalidModifierOnTypeMember: "'%0' modifier cannot appear on a type member.", - InvalidTupleMemberLabel: - "Tuple members must be labeled with a simple identifier.", - MixedLabeledAndUnlabeledElements: - "Tuple members must all have names or all not have names.", - NonAbstractClassHasAbstractMethod: - "Abstract methods can only appear within an abstract class.", - NonClassMethodPropertyHasAbstractModifer: - "'abstract' modifier can only appear on a class, method, or property declaration.", - OptionalTypeBeforeRequired: - "A required element cannot follow an optional element.", - PatternIsOptional: - "A binding pattern parameter cannot be optional in an implementation signature.", - PrivateElementHasAbstract: - "Private elements cannot have the 'abstract' modifier.", - PrivateElementHasAccessibility: - "Private elements cannot have an accessibility modifier ('%0')", - ReadonlyForMethodSignature: - "'readonly' modifier can only appear on a property declaration or index signature.", - TypeAnnotationAfterAssign: - "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", - UnexpectedParameterModifier: - "A parameter property is only allowed in a constructor implementation.", - UnexpectedReadonly: - "'readonly' type modifier is only permitted on array and tuple literal types.", - UnexpectedTypeAnnotation: "Did not expect a type annotation here.", - UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", - UnsupportedImportTypeArgument: - "Argument in a type import must be a string literal", - UnsupportedParameterPropertyKind: - "A parameter property may not be declared using a binding pattern.", - UnsupportedSignatureParameterKind: - "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0", -}); + DeclareClassFieldHasInitializer: + "Initializers are not allowed in ambient contexts.", + DeclareFunctionHasImplementation: + "An implementation cannot be declared in ambient contexts.", + DuplicateAccessibilityModifier: "Accessibility modifier already seen.", + DuplicateModifier: "Duplicate modifier: '%0'", + EmptyHeritageClauseType: "'%0' list cannot be empty.", + EmptyTypeArguments: "Type argument list cannot be empty.", + EmptyTypeParameters: "Type parameter list cannot be empty.", + ExpectedAmbientAfterExportDeclare: + "'export declare' must be followed by an ambient declaration.", + ImportAliasHasImportType: "An import alias can not use 'import type'", + IndexSignatureHasAbstract: + "Index signatures cannot have the 'abstract' modifier", + IndexSignatureHasAccessibility: + "Index signatures cannot have an accessibility modifier ('%0')", + IndexSignatureHasDeclare: + "Index signatures cannot have the 'declare' modifier", + IndexSignatureHasStatic: + "Index signatures cannot have the 'static' modifier", + InvalidModifierOnTypeMember: + "'%0' modifier cannot appear on a type member.", + InvalidTupleMemberLabel: + "Tuple members must be labeled with a simple identifier.", + MixedLabeledAndUnlabeledElements: + "Tuple members must all have names or all not have names.", + NonAbstractClassHasAbstractMethod: + "Abstract methods can only appear within an abstract class.", + NonClassMethodPropertyHasAbstractModifer: + "'abstract' modifier can only appear on a class, method, or property declaration.", + OptionalTypeBeforeRequired: + "A required element cannot follow an optional element.", + PatternIsOptional: + "A binding pattern parameter cannot be optional in an implementation signature.", + PrivateElementHasAbstract: + "Private elements cannot have the 'abstract' modifier.", + PrivateElementHasAccessibility: + "Private elements cannot have an accessibility modifier ('%0')", + ReadonlyForMethodSignature: + "'readonly' modifier can only appear on a property declaration or index signature.", + TypeAnnotationAfterAssign: + "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", + TypeImportCannotSpecifyDefaultAndNamed: + "A type-only import can specify a default import or named bindings, but not both.", + UnexpectedParameterModifier: + "A parameter property is only allowed in a constructor implementation.", + UnexpectedReadonly: + "'readonly' type modifier is only permitted on array and tuple literal types.", + UnexpectedTypeAnnotation: "Did not expect a type annotation here.", + UnexpectedTypeCastInParameter: + "Unexpected type cast in parameter position.", + UnsupportedImportTypeArgument: + "Argument in a type import must be a string literal", + UnsupportedParameterPropertyKind: + "A parameter property may not be declared using a binding pattern.", + UnsupportedSignatureParameterKind: + "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0", + }, + /* code */ ErrorCodes.SyntaxError, +); /* eslint-disable sort-keys */ // Doesn't handle "void" or "null" because those are keywords, not identifiers. @@ -217,7 +230,7 @@ export default (superClass: Class): Class => }, allowedModifiers: TsModifier[], disallowedModifiers?: TsModifier[], - errorTemplate?: string, + errorTemplate?: ErrorTemplate, ): void { for (;;) { const startPos = this.state.start; @@ -2098,7 +2111,7 @@ export default (superClass: Class): Class => ) { this.raise( importNode.start, - "A type-only import can specify a default import or named bindings, but not both.", + TSErrors.TypeImportCannotSpecifyDefaultAndNamed, ); } diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index 7c119c7d1111..26dec238024f 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -9,7 +9,7 @@ import * as charCodes from "charcodes"; import { isIdentifierStart, isIdentifierChar } from "../util/identifier"; import { types as tt, keywords as keywordTypes, type TokenType } from "./types"; import { type TokContext, types as ct } from "./context"; -import ParserErrors, { Errors } from "../parser/error"; +import ParserErrors, { Errors, type ErrorTemplate } from "../parser/error"; import { SourceLocation } from "../util/location"; import { lineBreak, @@ -115,7 +115,7 @@ export default class Tokenizer extends ParserErrors { // parser/util.js /*:: +hasPrecedingLineBreak: () => boolean; - +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty; + +unexpected: (pos?: ?number, messageOrType?: ErrorTemplate | TokenType) => empty; +expectPlugin: (name: string, pos?: ?number) => true; */ @@ -1321,7 +1321,7 @@ export default class Tokenizer extends ParserErrors { } } - recordStrictModeErrors(pos: number, message: string) { + recordStrictModeErrors(pos: number, message: ErrorTemplate) { if (this.state.strict && !this.state.strictErrors.has(pos)) { this.raise(pos, message); } else { diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index b3a45637bbe9..d2bdd9636964 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -6,7 +6,7 @@ import { Position } from "../util/location"; import { types as ct, type TokContext } from "./context"; import { types as tt, type TokenType } from "./types"; -import type { ParsingError } from "../parser/error"; +import type { ParsingError, ErrorTemplate } from "../parser/error"; type TopicContextState = { // When a topic binding has been currently established, @@ -147,7 +147,7 @@ export default class State { // todo(JLHwung): set strictErrors to null and avoid recording string errors // after a non-directive is parsed - strictErrors: Map = new Map(); + strictErrors: Map = new Map(); // Names of exports store. `default` is stored as a name for both // `export default foo;` and `export { foo as default };`. diff --git a/packages/babel-parser/src/util/class-scope.js b/packages/babel-parser/src/util/class-scope.js index 359af336e1a8..e5b973f7c0c8 100644 --- a/packages/babel-parser/src/util/class-scope.js +++ b/packages/babel-parser/src/util/class-scope.js @@ -5,7 +5,7 @@ import { CLASS_ELEMENT_FLAG_STATIC, type ClassElementTypes, } from "./scopeflags"; -import { Errors } from "../parser/error"; +import { Errors, type raiseFunction } from "../parser/error"; export class ClassScope { // A list of private named declared in the current class @@ -19,8 +19,6 @@ export class ClassScope { undefinedPrivateNames: Map = new Map(); } -type raiseFunction = (number, string, ...any) => void; - export default class ClassScopeHandler { stack: Array = []; declare raise: raiseFunction; diff --git a/packages/babel-parser/src/util/expression-scope.js b/packages/babel-parser/src/util/expression-scope.js index 809995864000..5d89b8d2afb8 100644 --- a/packages/babel-parser/src/util/expression-scope.js +++ b/packages/babel-parser/src/util/expression-scope.js @@ -1,5 +1,7 @@ // @flow +import type { ErrorTemplate, raiseFunction } from "../parser/error"; + /*:: declare var invariant; */ /** * @module util/expression-scope @@ -52,8 +54,6 @@ const kExpression = 0, type ExpressionScopeType = 0 | 1 | 2 | 3; -type raiseFunction = (number, string, ...any) => void; - class ExpressionScope { type: ExpressionScopeType; @@ -74,17 +74,17 @@ class ExpressionScope { } class ArrowHeadParsingScope extends ExpressionScope { - errors: Map = new Map(); + errors: Map = new Map(); constructor(type: 1 | 2) { super(type); } - recordDeclarationError(pos: number, message: string) { - this.errors.set(pos, message); + recordDeclarationError(pos: number, template: ErrorTemplate) { + this.errors.set(pos, template); } clearDeclarationError(pos: number) { this.errors.delete(pos); } - iterateErrors(iterator: (message: string, pos: number) => void) { + iterateErrors(iterator: (template: ErrorTemplate, pos: number) => void) { this.errors.forEach(iterator); } } @@ -110,17 +110,17 @@ export default class ExpressionScopeHandler { * otherwise it will be recorded to any ancestry MaybeArrowParameterDeclaration and * MaybeAsyncArrowParameterDeclaration scope until an Expression scope is seen. * @param {number} pos Error position - * @param {string} message Error message + * @param {ErrorTemplate} template Error template * @memberof ExpressionScopeHandler */ - recordParameterInitializerError(pos: number, message: string): void { + recordParameterInitializerError(pos: number, template: ErrorTemplate): void { const { stack } = this; let i = stack.length - 1; let scope: ExpressionScope = stack[i]; while (!scope.isCertainlyParameterDeclaration()) { if (scope.canBeArrowParameterDeclaration()) { /*:: invariant(scope instanceof ArrowHeadParsingScope) */ - scope.recordDeclarationError(pos, message); + scope.recordDeclarationError(pos, template); } else { /*:: invariant(scope.type == kExpression) */ // Type-Expression is the boundary where initializer error can populate to @@ -129,7 +129,7 @@ export default class ExpressionScopeHandler { scope = stack[--i]; } /* eslint-disable @babel/development-internal/dry-error-messages */ - this.raise(pos, message); + this.raise(pos, template); } /** @@ -149,18 +149,21 @@ export default class ExpressionScopeHandler { * arrow scope because when we finish parsing `( [(a) = []] = [] )`, it is an unambiguous assignment * expression and can not be cast to pattern * @param {number} pos - * @param {string} message + * @param {ErrorTemplate} template * @returns {void} * @memberof ExpressionScopeHandler */ - recordParenthesizedIdentifierError(pos: number, message: string): void { + recordParenthesizedIdentifierError( + pos: number, + template: ErrorTemplate, + ): void { const { stack } = this; const scope: ExpressionScope = stack[stack.length - 1]; if (scope.isCertainlyParameterDeclaration()) { - this.raise(pos, message); + this.raise(pos, template); } else if (scope.canBeArrowParameterDeclaration()) { /*:: invariant(scope instanceof ArrowHeadParsingScope) */ - scope.recordDeclarationError(pos, message); + scope.recordDeclarationError(pos, template); } else { return; } @@ -172,17 +175,17 @@ export default class ExpressionScopeHandler { * Errors will be recorded to any ancestry MaybeAsyncArrowParameterDeclaration * scope until an Expression scope is seen. * @param {number} pos - * @param {string} message + * @param {ErrorTemplate} template * @memberof ExpressionScopeHandler */ - recordAsyncArrowParametersError(pos: number, message: string): void { + recordAsyncArrowParametersError(pos: number, template: ErrorTemplate): void { const { stack } = this; let i = stack.length - 1; let scope: ExpressionScope = stack[i]; while (scope.canBeArrowParameterDeclaration()) { if (scope.type === kMaybeAsyncArrowParameterDeclaration) { /*:: invariant(scope instanceof ArrowHeadParsingScope) */ - scope.recordDeclarationError(pos, message); + scope.recordDeclarationError(pos, template); } scope = stack[--i]; } @@ -193,9 +196,9 @@ export default class ExpressionScopeHandler { const currentScope = stack[stack.length - 1]; if (!currentScope.canBeArrowParameterDeclaration()) return; /*:: invariant(currentScope instanceof ArrowHeadParsingScope) */ - currentScope.iterateErrors((message, pos) => { + currentScope.iterateErrors((template, pos) => { /* eslint-disable @babel/development-internal/dry-error-messages */ - this.raise(pos, message); + this.raise(pos, template); // iterate from parent scope let i = stack.length - 2; let scope = stack[i]; diff --git a/packages/babel-parser/src/util/scope.js b/packages/babel-parser/src/util/scope.js index bd3fc8cc37c8..03c01f57d844 100644 --- a/packages/babel-parser/src/util/scope.js +++ b/packages/babel-parser/src/util/scope.js @@ -17,7 +17,7 @@ import { type BindingTypes, } from "./scopeflags"; import * as N from "../types"; -import { Errors } from "../parser/error"; +import { Errors, type raiseFunction } from "../parser/error"; // Start an AST node, attaching a start offset. export class Scope { @@ -34,8 +34,6 @@ export class Scope { } } -type raiseFunction = (number, string, ...any) => void; - // The functions in this module keep track of declared variables in the // current scope in order to detect duplicate variable names. export default class ScopeHandler { diff --git a/packages/babel-parser/test/error-codes.js b/packages/babel-parser/test/error-codes.js new file mode 100644 index 000000000000..58bb5e411a6c --- /dev/null +++ b/packages/babel-parser/test/error-codes.js @@ -0,0 +1,21 @@ +import { parse } from "../lib"; + +describe("error codes", function () { + it("raises an error with BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED and reasonCode", function () { + const code = `import "foo"`; + const { errors } = parse(code, { + errorRecovery: true, + sourceType: "script", + }); + const error = errors[0]; + expect(error.code).toBe("BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"); + expect(error.reasonCode).toBe("ImportOutsideModule"); + }); + it("raises an error with BABEL_PARSER_SYNTAX_ERROR and reasonCode", function () { + const code = `a b`; + const { errors } = parse(code, { errorRecovery: true }); + const error = errors[0]; + expect(error.code).toBe("BABEL_PARSER_SYNTAX_ERROR"); + expect(error.reasonCode).toBe("MissingSemicolon"); + }); +}); From b387c0a26bc4e5e5bbd817355fb6c0c7f5db2d64 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 17 Apr 2021 11:10:27 -0400 Subject: [PATCH 02/12] Support TS 4.3 static index signature in classes (#13096) --- Makefile | 2 +- .../src/generators/typescript.ts | 6 +- .../typescript/class-index-signature/input.js | 1 + .../class-index-signature/output.js | 3 +- .../src/plugins/typescript/index.js | 22 ++++- packages/babel-parser/src/types.js | 1 + .../class/index-signature-errors/input.ts | 3 + .../class/index-signature-errors/output.json | 61 ++++++++++++ .../typescript/class/index-signature/input.ts | 2 + .../class/index-signature/output.json | 65 ++++++++++++- .../class/modifiers-index-signatures/input.ts | 1 - .../modifiers-index-signatures/output.json | 92 +++++++------------ .../src/ast-types/generated/index.ts | 1 + .../babel-types/src/definitions/typescript.ts | 1 + scripts/parser-tests/typescript/allowlist.txt | 21 ++++- 15 files changed, 207 insertions(+), 75 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/class/index-signature-errors/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/class/index-signature-errors/output.json diff --git a/Makefile b/Makefile index ac6a13bb89e5..063dc252355c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ FLOW_COMMIT = a1f9a4c709dcebb27a5084acf47755fbae699c25 TEST262_COMMIT = eca69e2c95972a4c5780ef58fe1f1e53e871b9b1 -TYPESCRIPT_COMMIT = da8633212023517630de5f3620a23736b63234b1 +TYPESCRIPT_COMMIT = 41dc625b0a609eb294b975dd92675e72b2b3fdec # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true diff --git a/packages/babel-generator/src/generators/typescript.ts b/packages/babel-generator/src/generators/typescript.ts index 0945de55ad5f..475ca7ba5f13 100644 --- a/packages/babel-generator/src/generators/typescript.ts +++ b/packages/babel-generator/src/generators/typescript.ts @@ -133,7 +133,11 @@ export function TSMethodSignature(this: Printer, node: t.TSMethodSignature) { } export function TSIndexSignature(this: Printer, node: t.TSIndexSignature) { - const { readonly } = node; + const { readonly, static: isStatic } = node; + if (isStatic) { + this.word("static"); + this.space(); + } if (readonly) { this.word("readonly"); this.space(); diff --git a/packages/babel-generator/test/fixtures/typescript/class-index-signature/input.js b/packages/babel-generator/test/fixtures/typescript/class-index-signature/input.js index a05c78333820..54c620ee7709 100644 --- a/packages/babel-generator/test/fixtures/typescript/class-index-signature/input.js +++ b/packages/babel-generator/test/fixtures/typescript/class-index-signature/input.js @@ -1,4 +1,5 @@ class C { [x: string]: any; readonly [x: string]: any; + static [x: string]: any; } diff --git a/packages/babel-generator/test/fixtures/typescript/class-index-signature/output.js b/packages/babel-generator/test/fixtures/typescript/class-index-signature/output.js index d55ebdbb81fe..7cddf1cc31d4 100644 --- a/packages/babel-generator/test/fixtures/typescript/class-index-signature/output.js +++ b/packages/babel-generator/test/fixtures/typescript/class-index-signature/output.js @@ -1,4 +1,5 @@ class C { [x: string]: any; readonly [x: string]: any; -} \ No newline at end of file + static [x: string]: any; +} diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 4f7795c03cf1..6a14194376e6 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -96,6 +96,7 @@ const TSErrors = makeErrorTemplates( "Index signatures cannot have the 'static' modifier", InvalidModifierOnTypeMember: "'%0' modifier cannot appear on a type member.", + InvalidModifiersOrder: "'%0' modifier must precede '%1' modifier.", InvalidTupleMemberLabel: "Tuple members must be labeled with a simple identifier.", MixedLabeledAndUnlabeledElements: @@ -249,6 +250,13 @@ export default (superClass: Class): Class => } else { if (Object.hasOwnProperty.call(modified, modifier)) { this.raise(startPos, TSErrors.DuplicateModifier, modifier); + } else if (modified.readonly && modifier === "static") { + this.raise( + startPos, + TSErrors.InvalidModifiersOrder, + "static", + "readonly", + ); } modified[modifier] = true; } @@ -2233,7 +2241,16 @@ export default (superClass: Class): Class => state: N.ParseClassMemberState, isStatic: boolean, ): void { - this.tsParseModifiers(member, ["abstract", "readonly", "declare"]); + this.tsParseModifiers(member, [ + "abstract", + "readonly", + "declare", + "static", + ]); + + if (isStatic) { + member.static = true; + } const idx = this.tsTryParseIndexSignature(member); if (idx) { @@ -2242,9 +2259,6 @@ export default (superClass: Class): Class => if ((member: any).abstract) { this.raise(member.start, TSErrors.IndexSignatureHasAbstract); } - if (isStatic) { - this.raise(member.start, TSErrors.IndexSignatureHasStatic); - } if ((member: any).accessibility) { this.raise( member.start, diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index 92f1c678a0af..018e3a39c90e 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -1205,6 +1205,7 @@ export type TsMethodSignature = TsSignatureDeclarationBase & // *Not* a ClassMemberBase: Can't have accessibility, can't be abstract, can't be optional. export type TsIndexSignature = TsSignatureDeclarationOrIndexSignatureBase & { readonly?: true, + static?: true, type: "TSIndexSignature", // Note: parameters.length must be 1. }; diff --git a/packages/babel-parser/test/fixtures/typescript/class/index-signature-errors/input.ts b/packages/babel-parser/test/fixtures/typescript/class/index-signature-errors/input.ts new file mode 100644 index 000000000000..bcae2434c5d2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/index-signature-errors/input.ts @@ -0,0 +1,3 @@ +class C { + readonly static [x: string]: any; +} diff --git a/packages/babel-parser/test/fixtures/typescript/class/index-signature-errors/output.json b/packages/babel-parser/test/fixtures/typescript/class/index-signature-errors/output.json new file mode 100644 index 000000000000..c1d11a26f668 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/index-signature-errors/output.json @@ -0,0 +1,61 @@ +{ + "type": "File", + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "errors": [ + "SyntaxError: 'static' modifier must precede 'readonly' modifier. (2:13)" + ], + "program": { + "type": "Program", + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":8,"end":49,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "TSIndexSignature", + "start":14,"end":47,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":37}}, + "readonly": true, + "static": true, + "parameters": [ + { + "type": "Identifier", + "start":31,"end":40,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":30},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":32,"end":40,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":30}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":34,"end":40,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":30}} + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":41,"end":46,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":36}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":43,"end":46,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":36}} + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/index-signature/input.ts b/packages/babel-parser/test/fixtures/typescript/class/index-signature/input.ts index a05c78333820..2a38f9c909af 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/index-signature/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/class/index-signature/input.ts @@ -1,4 +1,6 @@ class C { [x: string]: any; readonly [x: string]: any; + static [x: string]: any; + static readonly [x: string]: any; } diff --git a/packages/babel-parser/test/fixtures/typescript/class/index-signature/output.json b/packages/babel-parser/test/fixtures/typescript/class/index-signature/output.json index 3e05b3479d18..c27ce068c767 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/index-signature/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/index-signature/output.json @@ -1,15 +1,15 @@ { "type": "File", - "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "start":0,"end":131,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "start":0,"end":131,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "start":0,"end":131,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, @@ -18,7 +18,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start":8,"end":64,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, + "start":8,"end":131,"loc":{"start":{"line":1,"column":8},"end":{"line":6,"column":1}}, "body": [ { "type": "TSIndexSignature", @@ -74,6 +74,63 @@ "start":58,"end":61,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":29}} } } + }, + { + "type": "TSIndexSignature", + "start":67,"end":91,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":28}}, + "static": true, + "parameters": [ + { + "type": "Identifier", + "start":75,"end":84,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":21},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":76,"end":84,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":21}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":78,"end":84,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":21}} + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":85,"end":90,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":27}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":87,"end":90,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":27}} + } + } + }, + { + "type": "TSIndexSignature", + "start":96,"end":129,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":37}}, + "readonly": true, + "static": true, + "parameters": [ + { + "type": "Identifier", + "start":113,"end":122,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":30},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":114,"end":122,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":30}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":116,"end":122,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":30}} + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":123,"end":128,"loc":{"start":{"line":5,"column":31},"end":{"line":5,"column":36}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":125,"end":128,"loc":{"start":{"line":5,"column":33},"end":{"line":5,"column":36}} + } + } } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/input.ts b/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/input.ts index 11a1a06ce344..deb44172fa36 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/input.ts @@ -1,6 +1,5 @@ class C { abstract [key: string]: string; - static [key: string]: string; declare [key: string]: string; private [key: string]: string; public [key: string]: string; diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json index 2001c8258f84..45e7aad7b7d6 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json @@ -1,23 +1,22 @@ { "type": "File", - "start":0,"end":210,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, + "start":0,"end":178,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ "SyntaxError: Index signatures cannot have the 'abstract' modifier (2:2)", - "SyntaxError: Index signatures cannot have the 'static' modifier (3:2)", - "SyntaxError: Index signatures cannot have the 'declare' modifier (4:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('private') (5:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('public') (6:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('protected') (7:2)" + "SyntaxError: Index signatures cannot have the 'declare' modifier (3:2)", + "SyntaxError: Index signatures cannot have an accessibility modifier ('private') (4:2)", + "SyntaxError: Index signatures cannot have an accessibility modifier ('public') (5:2)", + "SyntaxError: Index signatures cannot have an accessibility modifier ('protected') (6:2)" ], "program": { "type": "Program", - "start":0,"end":210,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, + "start":0,"end":178,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start":0,"end":210,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, + "start":0,"end":178,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "id": { "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, @@ -26,7 +25,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start":8,"end":210,"loc":{"start":{"line":1,"column":8},"end":{"line":8,"column":1}}, + "start":8,"end":178,"loc":{"start":{"line":1,"column":8},"end":{"line":7,"column":1}}, "body": [ { "type": "TSIndexSignature", @@ -58,140 +57,113 @@ }, { "type": "TSIndexSignature", - "start":46,"end":75,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":31}}, - "parameters": [ - { - "type": "Identifier", - "start":54,"end":65,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":21},"identifierName":"key"}, - "name": "key", - "typeAnnotation": { - "type": "TSTypeAnnotation", - "start":57,"end":65,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, - "typeAnnotation": { - "type": "TSStringKeyword", - "start":59,"end":65,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":21}} - } - } - } - ], - "typeAnnotation": { - "type": "TSTypeAnnotation", - "start":66,"end":74,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":30}}, - "typeAnnotation": { - "type": "TSStringKeyword", - "start":68,"end":74,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":30}} - } - } - }, - { - "type": "TSIndexSignature", - "start":78,"end":108,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":32}}, + "start":46,"end":76,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":32}}, "declare": true, "parameters": [ { "type": "Identifier", - "start":87,"end":98,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":22},"identifierName":"key"}, + "start":55,"end":66,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":22},"identifierName":"key"}, "name": "key", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":90,"end":98,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":22}}, + "start":58,"end":66,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":22}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":92,"end":98,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":22}} + "start":60,"end":66,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":22}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start":99,"end":107,"loc":{"start":{"line":4,"column":23},"end":{"line":4,"column":31}}, + "start":67,"end":75,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":31}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":101,"end":107,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":31}} + "start":69,"end":75,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":31}} } } }, { "type": "TSIndexSignature", - "start":111,"end":141,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":32}}, + "start":79,"end":109,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":32}}, "accessibility": "private", "parameters": [ { "type": "Identifier", - "start":120,"end":131,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":22},"identifierName":"key"}, + "start":88,"end":99,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":22},"identifierName":"key"}, "name": "key", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":123,"end":131,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":22}}, + "start":91,"end":99,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":22}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":125,"end":131,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":22}} + "start":93,"end":99,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":22}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start":132,"end":140,"loc":{"start":{"line":5,"column":23},"end":{"line":5,"column":31}}, + "start":100,"end":108,"loc":{"start":{"line":4,"column":23},"end":{"line":4,"column":31}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":134,"end":140,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":31}} + "start":102,"end":108,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":31}} } } }, { "type": "TSIndexSignature", - "start":144,"end":173,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":31}}, + "start":112,"end":141,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":31}}, "accessibility": "public", "parameters": [ { "type": "Identifier", - "start":152,"end":163,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":21},"identifierName":"key"}, + "start":120,"end":131,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":21},"identifierName":"key"}, "name": "key", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":155,"end":163,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":21}}, + "start":123,"end":131,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":21}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":157,"end":163,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":21}} + "start":125,"end":131,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":21}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start":164,"end":172,"loc":{"start":{"line":6,"column":22},"end":{"line":6,"column":30}}, + "start":132,"end":140,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":30}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":166,"end":172,"loc":{"start":{"line":6,"column":24},"end":{"line":6,"column":30}} + "start":134,"end":140,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":30}} } } }, { "type": "TSIndexSignature", - "start":176,"end":208,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":34}}, + "start":144,"end":176,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":34}}, "accessibility": "protected", "parameters": [ { "type": "Identifier", - "start":187,"end":198,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":24},"identifierName":"key"}, + "start":155,"end":166,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":24},"identifierName":"key"}, "name": "key", "typeAnnotation": { "type": "TSTypeAnnotation", - "start":190,"end":198,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":24}}, + "start":158,"end":166,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":24}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":192,"end":198,"loc":{"start":{"line":7,"column":18},"end":{"line":7,"column":24}} + "start":160,"end":166,"loc":{"start":{"line":6,"column":18},"end":{"line":6,"column":24}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start":199,"end":207,"loc":{"start":{"line":7,"column":25},"end":{"line":7,"column":33}}, + "start":167,"end":175,"loc":{"start":{"line":6,"column":25},"end":{"line":6,"column":33}}, "typeAnnotation": { "type": "TSStringKeyword", - "start":201,"end":207,"loc":{"start":{"line":7,"column":27},"end":{"line":7,"column":33}} + "start":169,"end":175,"loc":{"start":{"line":6,"column":27},"end":{"line":6,"column":33}} } } } diff --git a/packages/babel-types/src/ast-types/generated/index.ts b/packages/babel-types/src/ast-types/generated/index.ts index df363a9e857d..1938f1feca13 100755 --- a/packages/babel-types/src/ast-types/generated/index.ts +++ b/packages/babel-types/src/ast-types/generated/index.ts @@ -1709,6 +1709,7 @@ export interface TSIndexSignature extends BaseNode { parameters: Array; typeAnnotation?: TSTypeAnnotation | null; readonly?: boolean | null; + static?: boolean | null; } export interface TSAnyKeyword extends BaseNode { diff --git a/packages/babel-types/src/definitions/typescript.ts b/packages/babel-types/src/definitions/typescript.ts index 7a0df86891b6..c805c0b751d0 100644 --- a/packages/babel-types/src/definitions/typescript.ts +++ b/packages/babel-types/src/definitions/typescript.ts @@ -126,6 +126,7 @@ defineType("TSIndexSignature", { visitor: ["parameters", "typeAnnotation"], fields: { readonly: validateOptional(bool), + static: validateOptional(bool), parameters: validateArrayOfType("Identifier"), // Length must be 1 typeAnnotation: validateOptionalType("TSTypeAnnotation"), }, diff --git a/scripts/parser-tests/typescript/allowlist.txt b/scripts/parser-tests/typescript/allowlist.txt index 82a74f141711..5ea3208fa25b 100644 --- a/scripts/parser-tests/typescript/allowlist.txt +++ b/scripts/parser-tests/typescript/allowlist.txt @@ -26,6 +26,8 @@ amdModuleName2.ts anonClassDeclarationEmitIsAnon.ts anyDeclare.ts argumentsBindsToFunctionScopeArgumentList.ts +argumentsReferenceInConstructor4_Js.ts +argumentsReferenceInMethod4_Js.ts arrayOfExportedClass.ts asiAbstract.ts asyncFunctionsAcrossFiles.ts @@ -80,12 +82,15 @@ conflictingTypeAnnotatedVar.ts constDeclarations-invalidContexts.ts constDeclarations-scopes.ts constDeclarations-validContexts.ts +constEnumNamespaceReferenceCausesNoImport2.ts constEnumNoEmitReexport.ts constEnumNoPreserveDeclarationReexport.ts constEnumPreserveEmitReexport.ts +contextualOverloadListFromArrayUnion.ts controlFlowPrivateClassField.ts convertKeywordsYes.ts declarationEmitAmdModuleNameDirective.ts +declarationEmitCommonSourceDirectoryDoesNotContainAllFiles.ts declarationEmitComputedNameCausesImportToBePainted.ts declarationEmitComputedNameConstEnumAlias.ts declarationEmitCrossFileImportTypeOfAmbientModule.ts @@ -99,12 +104,16 @@ declarationEmitExportAssignedNamespaceNoTripleSlashTypesReference.ts declarationEmitExportAssignment.ts declarationEmitExportDeclaration.ts declarationEmitExpressionInExtends6.ts +declarationEmitExpressionWithNonlocalPrivateUniqueSymbol.ts declarationEmitForModuleImportingModuleAugmentationRetainsImport.ts declarationEmitForTypesWhichNeedImportTypes.ts declarationEmitInterfaceWithNonEntityNameExpressionHeritage.ts +declarationEmitMixinPrivateProtected.ts declarationEmitPrefersPathKindBasedOnBundling.ts declarationEmitPrefersPathKindBasedOnBundling2.ts declarationEmitPrivateSymbolCausesVarDeclarationEmit2.ts +declarationEmitReadonlyComputedProperty.ts +declarationEmitStringEnumUsedInNonlocalSpread.ts declarationImportTypeAliasInferredAndEmittable.ts declarationMapsMultifile.ts declarationMapsOutFile.ts @@ -188,6 +197,7 @@ esModuleInterop.ts esModuleInteropImportTSLibHasImport.ts esModuleInteropNamedDefaultImports.ts esModuleInteropTslibHelpers.ts +esNextWeakRefs_IterableWeakMap.ts expandoFunctionContextualTypesNoValue.ts exportAssignClassAndModule.ts exportAssignmentImportMergeNoCrash.ts @@ -227,7 +237,6 @@ gettersAndSettersErrors.ts giant.ts globalThisDeclarationEmit.ts globalThisDeclarationEmit2.ts -hugeDeclarationOutputGetsTruncatedWithError.ts implementClausePrecedingExtends.ts implementsClauseAlreadySeen.ts importAndVariableDeclarationConflict1.ts @@ -271,6 +280,8 @@ interfaceWithImplements1.ts invalidReferenceSyntax1.ts isLiteral1.ts isLiteral2.ts +isolatedModulesImportConstEnum.ts +isolatedModulesImportConstEnumTypeOnly.ts isolatedModulesReExportType.ts jsEnumTagOnObjectFrozen.ts jsExportMemberMergedWithModuleAugmentation.ts @@ -336,7 +347,8 @@ moduleAugmentationsImports2.ts moduleAugmentationsImports3.ts moduleAugmentationsImports4.ts moduleDuplicateIdentifiers.ts -moduleResolutionNoTs.ts +moduleResolutionNoTsCJS.ts +moduleResolutionNoTsESM.ts moduleResolutionWithSymlinks.ts moduleResolutionWithSymlinks_withOutDir.ts moduleResolution_automaticTypeDirectiveNames.ts @@ -353,6 +365,7 @@ noBundledEmitFromNodeModules.ts noCrashOnImportShadowing.ts noImplicitAnyDestructuringVarDeclaration.ts noSymbolForMergeCrash.ts +nodeModuleReexportFromDottedPath.ts nodeResolution4.ts nodeResolution6.ts nodeResolution8.ts @@ -398,7 +411,8 @@ shorthandPropertyAssignmentInES6Module.ts sourceMap-LineBreaks.ts sourceMapValidationDecorators.ts sourceMapValidationStatements.ts -staticIndexer.ts +staticAsIdentifier.ts +staticModifierAlreadySeen.ts strictModeReservedWord.ts superCallFromClassThatHasNoBaseType1.ts symbolLinkDeclarationEmitModuleNames.ts @@ -422,6 +436,7 @@ typeReferenceDirectives7.ts typeReferenceDirectives8.ts typeReferenceDirectives9.ts uniqueSymbolPropertyDeclarationEmit.ts +unusedImportWithSpread.ts unusedImports1.ts unusedImports11.ts unusedImports12.ts From de28011f95aaab8730c8f3a8c54cc5370fcd0667 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Wed, 7 Apr 2021 18:15:46 +0900 Subject: [PATCH 03/12] Support parsing Flow's Indexed Access Types (#13053) --- .../babel-generator/src/generators/flow.ts | 7 + .../flow/indexed-access-types/input.js | 9 + .../flow/indexed-access-types/output.js | 5 + .../babel-parser/src/plugins/flow/index.js | 16 +- packages/babel-parser/src/types.js | 6 + .../flow/indexed-access-types/1/input.js | 9 + .../flow/indexed-access-types/1/output.json | 226 ++++++++++++++++++ .../src/path/generated/asserts.ts | 3 + .../src/path/generated/validators.ts | 1 + .../src/asserts/generated/index.ts | 6 + .../src/ast-types/generated/index.ts | 7 + .../src/builders/generated/index.ts | 6 + .../src/builders/generated/uppercase.js | 1 + packages/babel-types/src/definitions/flow.ts | 8 + .../src/validators/generated/index.ts | 17 ++ 15 files changed, 324 insertions(+), 3 deletions(-) create mode 100644 packages/babel-generator/test/fixtures/flow/indexed-access-types/input.js create mode 100644 packages/babel-generator/test/fixtures/flow/indexed-access-types/output.js create mode 100644 packages/babel-parser/test/fixtures/flow/indexed-access-types/1/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/indexed-access-types/1/output.json diff --git a/packages/babel-generator/src/generators/flow.ts b/packages/babel-generator/src/generators/flow.ts index 133fec107f37..b4373bffe3fe 100644 --- a/packages/babel-generator/src/generators/flow.ts +++ b/packages/babel-generator/src/generators/flow.ts @@ -738,3 +738,10 @@ export function Variance(this: Printer, node: t.Variance) { export function VoidTypeAnnotation(this: Printer) { this.word("void"); } + +export function IndexedAccessType(this: Printer, node: t.IndexedAccessType) { + this.print(node.objectType, node); + this.token("["); + this.print(node.indexType, node); + this.token("]"); +} diff --git a/packages/babel-generator/test/fixtures/flow/indexed-access-types/input.js b/packages/babel-generator/test/fixtures/flow/indexed-access-types/input.js new file mode 100644 index 000000000000..12a8ba2307c7 --- /dev/null +++ b/packages/babel-generator/test/fixtures/flow/indexed-access-types/input.js @@ -0,0 +1,9 @@ +type A = Obj['a']; + +type B = Array[number]; + +type C = Obj['bar'][foo]['boz']; + +type D = (Obj['bar'])['baz']; + +type E = Obj['bar'][]; diff --git a/packages/babel-generator/test/fixtures/flow/indexed-access-types/output.js b/packages/babel-generator/test/fixtures/flow/indexed-access-types/output.js new file mode 100644 index 000000000000..f1e611956ce9 --- /dev/null +++ b/packages/babel-generator/test/fixtures/flow/indexed-access-types/output.js @@ -0,0 +1,5 @@ +type A = Obj['a']; +type B = Array[number]; +type C = Obj['bar'][foo]['boz']; +type D = Obj['bar']['baz']; +type E = Obj['bar'][]; \ No newline at end of file diff --git a/packages/babel-parser/src/plugins/flow/index.js b/packages/babel-parser/src/plugins/flow/index.js index 7176a8e389dc..b94cc482cb11 100644 --- a/packages/babel-parser/src/plugins/flow/index.js +++ b/packages/babel-parser/src/plugins/flow/index.js @@ -1623,10 +1623,20 @@ export default (superClass: Class): Class => let type = this.flowParsePrimaryType(); while (this.match(tt.bracketL) && !this.canInsertSemicolon()) { const node = this.startNodeAt(startPos, startLoc); - node.elementType = type; this.expect(tt.bracketL); - this.expect(tt.bracketR); - type = this.finishNode(node, "ArrayTypeAnnotation"); + if (this.match(tt.bracketR)) { + node.elementType = type; + this.next(); // eat `]` + type = this.finishNode(node, "ArrayTypeAnnotation"); + } else { + node.objectType = type; + node.indexType = this.flowParseType(); + this.expect(tt.bracketR); + type = this.finishNode( + node, + "IndexedAccessType", + ); + } } return type; } diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index 018e3a39c90e..c85630767246 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -1050,6 +1050,12 @@ export type FlowInterfaceType = NodeBase & { body: FlowObjectTypeAnnotation, }; +export type FlowIndexedAccessType = Node & { + type: "IndexedAccessType", + objectType: FlowType, + indexType: FlowType, +}; + // ESTree export type EstreeProperty = NodeBase & { diff --git a/packages/babel-parser/test/fixtures/flow/indexed-access-types/1/input.js b/packages/babel-parser/test/fixtures/flow/indexed-access-types/1/input.js new file mode 100644 index 000000000000..12a8ba2307c7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/indexed-access-types/1/input.js @@ -0,0 +1,9 @@ +type A = Obj['a']; + +type B = Array[number]; + +type C = Obj['bar'][foo]['boz']; + +type D = (Obj['bar'])['baz']; + +type E = Obj['bar'][]; diff --git a/packages/babel-parser/test/fixtures/flow/indexed-access-types/1/output.json b/packages/babel-parser/test/fixtures/flow/indexed-access-types/1/output.json new file mode 100644 index 000000000000..49d9978d61f9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/indexed-access-types/1/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start":0,"end":140,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":22}}, + "program": { + "type": "Program", + "start":0,"end":140,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":22}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, + "id": { + "type": "Identifier", + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "IndexedAccessType", + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"Obj"}, + "name": "Obj" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + } + } + }, + { + "type": "TypeAlias", + "start":20,"end":51,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":31}}, + "id": { + "type": "Identifier", + "start":25,"end":26,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"B"}, + "name": "B" + }, + "typeParameters": null, + "right": { + "type": "IndexedAccessType", + "start":29,"end":50,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":30}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":29,"end":42,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":22}}, + "typeParameters": { + "type": "TypeParameterInstantiation", + "start":34,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":22}}, + "params": [ + { + "type": "StringTypeAnnotation", + "start":35,"end":41,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":21}} + } + ] + }, + "id": { + "type": "Identifier", + "start":29,"end":34,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":14},"identifierName":"Array"}, + "name": "Array" + } + }, + "indexType": { + "type": "NumberTypeAnnotation", + "start":43,"end":49,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":29}} + } + } + }, + { + "type": "TypeAlias", + "start":53,"end":85,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":32}}, + "id": { + "type": "Identifier", + "start":58,"end":59,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6},"identifierName":"C"}, + "name": "C" + }, + "typeParameters": null, + "right": { + "type": "IndexedAccessType", + "start":62,"end":84,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":31}}, + "objectType": { + "type": "IndexedAccessType", + "start":62,"end":77,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":24}}, + "objectType": { + "type": "IndexedAccessType", + "start":62,"end":72,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":19}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":62,"end":65,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":12}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":62,"end":65,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":12},"identifierName":"Obj"}, + "name": "Obj" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":66,"end":71,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":18}}, + "extra": { + "rawValue": "bar", + "raw": "'bar'" + }, + "value": "bar" + } + }, + "indexType": { + "type": "GenericTypeAnnotation", + "start":73,"end":76,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":23}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":73,"end":76,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":23},"identifierName":"foo"}, + "name": "foo" + } + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":78,"end":83,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":30}}, + "extra": { + "rawValue": "boz", + "raw": "'boz'" + }, + "value": "boz" + } + } + }, + { + "type": "TypeAlias", + "start":87,"end":116,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":29}}, + "id": { + "type": "Identifier", + "start":92,"end":93,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":6},"identifierName":"D"}, + "name": "D" + }, + "typeParameters": null, + "right": { + "type": "IndexedAccessType", + "start":96,"end":115,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":28}}, + "objectType": { + "type": "IndexedAccessType", + "start":97,"end":107,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":20}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":97,"end":100,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":13}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":97,"end":100,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":13},"identifierName":"Obj"}, + "name": "Obj" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":101,"end":106,"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":19}}, + "extra": { + "rawValue": "bar", + "raw": "'bar'" + }, + "value": "bar" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":109,"end":114,"loc":{"start":{"line":7,"column":22},"end":{"line":7,"column":27}}, + "extra": { + "rawValue": "baz", + "raw": "'baz'" + }, + "value": "baz" + } + } + }, + { + "type": "TypeAlias", + "start":118,"end":140,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":22}}, + "id": { + "type": "Identifier", + "start":123,"end":124,"loc":{"start":{"line":9,"column":5},"end":{"line":9,"column":6},"identifierName":"E"}, + "name": "E" + }, + "typeParameters": null, + "right": { + "type": "ArrayTypeAnnotation", + "start":127,"end":139,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":21}}, + "elementType": { + "type": "IndexedAccessType", + "start":127,"end":137,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":19}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":127,"end":130,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":12}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":127,"end":130,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":12},"identifierName":"Obj"}, + "name": "Obj" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":131,"end":136,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":18}}, + "extra": { + "rawValue": "bar", + "raw": "'bar'" + }, + "value": "bar" + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-traverse/src/path/generated/asserts.ts b/packages/babel-traverse/src/path/generated/asserts.ts index b0e6e22ccf05..ac9c5bd4895e 100755 --- a/packages/babel-traverse/src/path/generated/asserts.ts +++ b/packages/babel-traverse/src/path/generated/asserts.ts @@ -257,6 +257,9 @@ export interface NodePathAssetions { assertImportSpecifier( opts?: object, ): asserts this is NodePath; + assertIndexedAccessType( + opts?: object, + ): asserts this is NodePath; assertInferredPredicate( opts?: object, ): asserts this is NodePath; diff --git a/packages/babel-traverse/src/path/generated/validators.ts b/packages/babel-traverse/src/path/generated/validators.ts index ced5e539075a..271f5e5595fa 100755 --- a/packages/babel-traverse/src/path/generated/validators.ts +++ b/packages/babel-traverse/src/path/generated/validators.ts @@ -149,6 +149,7 @@ export interface NodePathValidators { opts?: object, ): this is NodePath; isImportSpecifier(opts?: object): this is NodePath; + isIndexedAccessType(opts?: object): this is NodePath; isInferredPredicate(opts?: object): this is NodePath; isInterfaceDeclaration( opts?: object, diff --git a/packages/babel-types/src/asserts/generated/index.ts b/packages/babel-types/src/asserts/generated/index.ts index 04cf3195f184..ea97792a1e1c 100755 --- a/packages/babel-types/src/asserts/generated/index.ts +++ b/packages/babel-types/src/asserts/generated/index.ts @@ -878,6 +878,12 @@ export function assertEnumDefaultedMember( ): asserts node is t.EnumDefaultedMember { assert("EnumDefaultedMember", node, opts); } +export function assertIndexedAccessType( + node: object | null | undefined, + opts?: object | null, +): asserts node is t.IndexedAccessType { + assert("IndexedAccessType", node, opts); +} export function assertJSXAttribute( node: object | null | undefined, opts?: object | null, diff --git a/packages/babel-types/src/ast-types/generated/index.ts b/packages/babel-types/src/ast-types/generated/index.ts index 1938f1feca13..80b653c30440 100755 --- a/packages/babel-types/src/ast-types/generated/index.ts +++ b/packages/babel-types/src/ast-types/generated/index.ts @@ -151,6 +151,7 @@ export type Node = | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier + | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends @@ -1387,6 +1388,12 @@ export interface EnumDefaultedMember extends BaseNode { id: Identifier; } +export interface IndexedAccessType extends BaseNode { + type: "IndexedAccessType"; + objectType: FlowType; + indexType: FlowType; +} + export interface JSXAttribute extends BaseNode { type: "JSXAttribute"; name: JSXIdentifier | JSXNamespacedName; diff --git a/packages/babel-types/src/builders/generated/index.ts b/packages/babel-types/src/builders/generated/index.ts index 2ade18539370..a0adb832b1cc 100755 --- a/packages/babel-types/src/builders/generated/index.ts +++ b/packages/babel-types/src/builders/generated/index.ts @@ -854,6 +854,12 @@ export function enumStringMember( export function enumDefaultedMember(id: t.Identifier): t.EnumDefaultedMember { return builder("EnumDefaultedMember", ...arguments); } +export function indexedAccessType( + objectType: t.FlowType, + indexType: t.FlowType, +): t.IndexedAccessType { + return builder("IndexedAccessType", ...arguments); +} export function jsxAttribute( name: t.JSXIdentifier | t.JSXNamespacedName, value?: diff --git a/packages/babel-types/src/builders/generated/uppercase.js b/packages/babel-types/src/builders/generated/uppercase.js index 3e25736a38d1..464b86423ce3 100755 --- a/packages/babel-types/src/builders/generated/uppercase.js +++ b/packages/babel-types/src/builders/generated/uppercase.js @@ -153,6 +153,7 @@ export { enumNumberMember as EnumNumberMember, enumStringMember as EnumStringMember, enumDefaultedMember as EnumDefaultedMember, + indexedAccessType as IndexedAccessType, jsxAttribute as JSXAttribute, jsxClosingElement as JSXClosingElement, jsxElement as JSXElement, diff --git a/packages/babel-types/src/definitions/flow.ts b/packages/babel-types/src/definitions/flow.ts index 3a0a9cebcc15..91ce3405a811 100644 --- a/packages/babel-types/src/definitions/flow.ts +++ b/packages/babel-types/src/definitions/flow.ts @@ -559,3 +559,11 @@ defineType("EnumDefaultedMember", { id: validateType("Identifier"), }, }); + +defineType("IndexedAccessType", { + visitor: ["objectType", "indexType"], + fields: { + objectType: validateType("FlowType"), + indexType: validateType("FlowType"), + }, +}); diff --git a/packages/babel-types/src/validators/generated/index.ts b/packages/babel-types/src/validators/generated/index.ts index d24f3f81bfbf..e86131e2182b 100755 --- a/packages/babel-types/src/validators/generated/index.ts +++ b/packages/babel-types/src/validators/generated/index.ts @@ -2453,6 +2453,23 @@ export function isEnumDefaultedMember( return false; } +export function isIndexedAccessType( + node: object | null | undefined, + opts?: object | null, +): node is t.IndexedAccessType { + if (!node) return false; + + const nodeType = (node as t.Node).type; + if (nodeType === "IndexedAccessType") { + if (typeof opts === "undefined") { + return true; + } else { + return shallowEqual(node, opts); + } + } + + return false; +} export function isJSXAttribute( node: object | null | undefined, opts?: object | null, From 6c6240c7a13c5bce2f2b4ac3ccd85fbe16eedefb Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 17 Apr 2021 11:11:04 -0400 Subject: [PATCH 04/12] Support TS 4.3 `override` syntax in class (#13097) * support TS 4.3 `override` syntax in class * fix types * fix types * tweak error message * update TypeScript commit * split tests * add more tests * update allowlist * disallow `override` with `declare` * disallow `override` in non-sub class * update TypeScript allowlist * rename error message key * add more tests --- Makefile | 2 +- .../src/generators/typescript.ts | 4 + .../class-modifier-override/input.js | 8 + .../class-modifier-override/options.json | 4 + .../class-modifier-override/output.js | 11 + .../babel-parser/src/parser/error-message.js | 2 + packages/babel-parser/src/parser/statement.js | 12 +- .../src/plugins/typescript/index.js | 44 ++- packages/babel-parser/src/types.js | 4 +- .../class/modifiers-override-errors/input.ts | 15 + .../modifiers-override-errors/output.json | 237 +++++++++++++ .../class/modifiers-override/input.ts | 20 ++ .../class/modifiers-override/output.json | 332 ++++++++++++++++++ .../src/ast-types/generated/index.ts | 4 + packages/babel-types/src/definitions/core.ts | 3 + 15 files changed, 693 insertions(+), 9 deletions(-) create mode 100644 packages/babel-generator/test/fixtures/typescript/class-modifier-override/input.js create mode 100644 packages/babel-generator/test/fixtures/typescript/class-modifier-override/options.json create mode 100644 packages/babel-generator/test/fixtures/typescript/class-modifier-override/output.js create mode 100644 packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json diff --git a/Makefile b/Makefile index 063dc252355c..74e37474c9cf 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ FLOW_COMMIT = a1f9a4c709dcebb27a5084acf47755fbae699c25 TEST262_COMMIT = eca69e2c95972a4c5780ef58fe1f1e53e871b9b1 -TYPESCRIPT_COMMIT = 41dc625b0a609eb294b975dd92675e72b2b3fdec +TYPESCRIPT_COMMIT = dd1ef88d016dc40a145eafc0a1169e7f0a4a9ebe # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true diff --git a/packages/babel-generator/src/generators/typescript.ts b/packages/babel-generator/src/generators/typescript.ts index 475ca7ba5f13..af70e81923d5 100644 --- a/packages/babel-generator/src/generators/typescript.ts +++ b/packages/babel-generator/src/generators/typescript.ts @@ -644,6 +644,10 @@ export function tsPrintClassMemberModifiers(this: Printer, node: any, isField) { this.word("declare"); this.space(); } + if (node.override) { + this.word("override"); + this.space(); + } if (node.accessibility) { this.word(node.accessibility); this.space(); diff --git a/packages/babel-generator/test/fixtures/typescript/class-modifier-override/input.js b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/input.js new file mode 100644 index 000000000000..d70119f8f51d --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/input.js @@ -0,0 +1,8 @@ +class MyClass extends BaseClass { + override show() {} + override public show() {} + public override show() {} + override size = 5; + override readonly size = 5; + readonly override size = 5; +} diff --git a/packages/babel-generator/test/fixtures/typescript/class-modifier-override/options.json b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/options.json new file mode 100644 index 000000000000..9f3a0c2c0ff1 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/options.json @@ -0,0 +1,4 @@ +{ + "sourceType": "module", + "plugins": ["typescript", "classProperties"] +} diff --git a/packages/babel-generator/test/fixtures/typescript/class-modifier-override/output.js b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/output.js new file mode 100644 index 000000000000..2be71cd1f582 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/output.js @@ -0,0 +1,11 @@ +class MyClass extends BaseClass { + override show() {} + + override public show() {} + + override public show() {} + + override size = 5; + override readonly size = 5; + override readonly size = 5; +} diff --git a/packages/babel-parser/src/parser/error-message.js b/packages/babel-parser/src/parser/error-message.js index a12f32ae23ea..dd582890d4ab 100644 --- a/packages/babel-parser/src/parser/error-message.js +++ b/packages/babel-parser/src/parser/error-message.js @@ -128,6 +128,8 @@ export const ErrorMessages = makeErrorTemplates( "constructors in/after an Optional Chain are not allowed", OptionalChainingNoTemplate: "Tagged Template Literals are not allowed in optionalChain", + OverrideOnConstructor: + "'override' modifier cannot appear on a constructor declaration.", ParamDupe: "Argument name clash", PatternHasAccessor: "Object pattern can't contain getter or setter", PatternHasMethod: "Object pattern can't contain methods", diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 0bc322207d01..52fe66190f68 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1205,15 +1205,12 @@ export default class StatementParser extends ExpressionParser { } // https://tc39.es/ecma262/#prod-ClassBody - parseClassBody( - constructorAllowsSuper: boolean, - oldStrict: boolean, - ): N.ClassBody { + parseClassBody(hadSuperClass: boolean, oldStrict: boolean): N.ClassBody { this.classScope.enter(); const state: N.ParseClassMemberState = { - constructorAllowsSuper, hadConstructor: false, + hadSuperClass, }; let decorators: N.Decorator[] = []; const classBody: N.ClassBody = this.startNode(); @@ -1400,8 +1397,11 @@ export default class StatementParser extends ExpressionParser { if (state.hadConstructor && !this.hasPlugin("typescript")) { this.raise(key.start, Errors.DuplicateConstructor); } + if (isConstructor && this.hasPlugin("typescript") && member.override) { + this.raise(key.start, Errors.OverrideOnConstructor); + } state.hadConstructor = true; - allowsDirectSuper = state.constructorAllowsSuper; + allowsDirectSuper = state.hadSuperClass; } this.pushClassMethod( diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 6a14194376e6..b5eaef411bcb 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -41,6 +41,7 @@ type TsModifier = | "abstract" | "declare" | "static" + | "override" | N.Accessibility; function nonNull(x: ?T): T { @@ -86,12 +87,15 @@ const TSErrors = makeErrorTemplates( ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", ImportAliasHasImportType: "An import alias can not use 'import type'", + IncompatibleModifiers: "'%0' modifier cannot be used with '%1' modifier.", IndexSignatureHasAbstract: "Index signatures cannot have the 'abstract' modifier", IndexSignatureHasAccessibility: "Index signatures cannot have an accessibility modifier ('%0')", IndexSignatureHasDeclare: "Index signatures cannot have the 'declare' modifier", + IndexSignatureHasOverride: + "'override' modifier cannot appear on an index signature.", IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier", InvalidModifierOnTypeMember: @@ -107,6 +111,8 @@ const TSErrors = makeErrorTemplates( "'abstract' modifier can only appear on a class, method, or property declaration.", OptionalTypeBeforeRequired: "A required element cannot follow an optional element.", + OverrideNotInSubClass: + "This member cannot have an 'override' modifier because its containing class does not extend another class.", PatternIsOptional: "A binding pattern parameter cannot be optional in an implementation signature.", PrivateElementHasAbstract: @@ -257,6 +263,16 @@ export default (superClass: Class): Class => "static", "readonly", ); + } else if ( + (modified.declare && modifier === "override") || + (modified.override && modifier === "declare") + ) { + this.raise( + startPos, + TSErrors.IncompatibleModifiers, + "declare", + "override", + ); } modified[modifier] = true; } @@ -622,7 +638,15 @@ export default (superClass: Class): Class => this.tsParseModifiers( node, ["readonly"], - ["declare", "abstract", "private", "protected", "public", "static"], + [ + "declare", + "abstract", + "private", + "protected", + "public", + "static", + "override", + ], TSErrors.InvalidModifierOnTypeMember, ); @@ -2223,6 +2247,7 @@ export default (superClass: Class): Class => "private", "public", "protected", + "override", ]); const callParseClassMember = () => { @@ -2246,6 +2271,7 @@ export default (superClass: Class): Class => "readonly", "declare", "static", + "override", ]); if (isStatic) { @@ -2269,6 +2295,9 @@ export default (superClass: Class): Class => if ((member: any).declare) { this.raise(member.start, TSErrors.IndexSignatureHasDeclare); } + if ((member: any).override) { + this.raise(member.start, TSErrors.IndexSignatureHasOverride); + } return; } @@ -2277,6 +2306,19 @@ export default (superClass: Class): Class => this.raise(member.start, TSErrors.NonAbstractClassHasAbstractMethod); } + if ((member: any).override) { + if (isStatic) { + this.raise( + member.start, + TSErrors.IncompatibleModifiers, + "static", + "override", + ); + } else if (!state.hadSuperClass) { + this.raise(member.start, TSErrors.OverrideNotInSubClass); + } + } + /*:: invariant(member.type !== "TSIndexSignature") */ super.parseClassMemberWithIsStatic(classBody, member, state, isStatic); diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index c85630767246..6bf9b9cb0f78 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -730,6 +730,7 @@ export type ClassMemberBase = NodeBase & computed: boolean, // TypeScript only: accessibility?: ?Accessibility, + override?: ?true, abstract?: ?true, optional?: ?true, }; @@ -807,6 +808,7 @@ export type ClassPrivateProperty = NodeBase & { optional?: true, definite?: true, readonly?: true, + override?: true, }; export type OptClassDeclaration = ClassBase & @@ -1536,5 +1538,5 @@ export type ParseSubscriptState = { export type ParseClassMemberState = {| hadConstructor: boolean, - constructorAllowsSuper: boolean, + hadSuperClass: boolean, |}; diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/input.ts b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/input.ts new file mode 100644 index 000000000000..346b74aaf281 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/input.ts @@ -0,0 +1,15 @@ +class MyClass2 extends BaseClass { + override constructor() {} + override [x: string]: any; + override static size = 5; + static override size = 5; +} + +declare class MyClass3 extends BaseClass { + declare override prop1: any + override declare prop2: any +} + +class MyClass4 { + override prop: any +} diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json new file mode 100644 index 000000000000..85c86638186c --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json @@ -0,0 +1,237 @@ +{ + "type": "File", + "start":0,"end":296,"loc":{"start":{"line":1,"column":0},"end":{"line":15,"column":1}}, + "errors": [ + "SyntaxError: 'override' modifier cannot appear on a constructor declaration. (2:11)", + "SyntaxError: 'override' modifier cannot appear on an index signature. (3:2)", + "SyntaxError: 'static' modifier cannot be used with 'override' modifier. (4:2)", + "SyntaxError: 'static' modifier cannot be used with 'override' modifier. (5:2)", + "SyntaxError: 'declare' modifier cannot be used with 'override' modifier. (9:10)", + "SyntaxError: 'declare' modifier cannot be used with 'override' modifier. (10:11)", + "SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. (14:2)" + ], + "program": { + "type": "Program", + "start":0,"end":296,"loc":{"start":{"line":1,"column":0},"end":{"line":15,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":149,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14},"identifierName":"MyClass2"}, + "name": "MyClass2" + }, + "superClass": { + "type": "Identifier", + "start":23,"end":32,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":32},"identifierName":"BaseClass"}, + "name": "BaseClass" + }, + "body": { + "type": "ClassBody", + "start":33,"end":149,"loc":{"start":{"line":1,"column":33},"end":{"line":6,"column":1}}, + "body": [ + { + "type": "ClassMethod", + "start":37,"end":62,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}}, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":46,"end":57,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":22},"identifierName":"constructor"}, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":60,"end":62,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}}, + "body": [], + "directives": [] + } + }, + { + "type": "TSIndexSignature", + "start":65,"end":91,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":28}}, + "override": true, + "parameters": [ + { + "type": "Identifier", + "start":75,"end":84,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":21},"identifierName":"x"}, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":76,"end":84,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":78,"end":84,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":21}} + } + } + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":85,"end":90,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":27}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":87,"end":90,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":27}} + } + } + }, + { + "type": "ClassProperty", + "start":94,"end":119,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":27}}, + "override": true, + "static": true, + "key": { + "type": "Identifier", + "start":110,"end":114,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":22},"identifierName":"size"}, + "name": "size" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":117,"end":118,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":26}}, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + { + "type": "ClassProperty", + "start":122,"end":147,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}}, + "override": true, + "static": true, + "key": { + "type": "Identifier", + "start":138,"end":142,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":22},"identifierName":"size"}, + "name": "size" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":145,"end":146,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":26}}, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + } + ] + } + }, + { + "type": "ClassDeclaration", + "start":151,"end":255,"loc":{"start":{"line":8,"column":0},"end":{"line":11,"column":1}}, + "declare": true, + "id": { + "type": "Identifier", + "start":165,"end":173,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":22},"identifierName":"MyClass3"}, + "name": "MyClass3" + }, + "superClass": { + "type": "Identifier", + "start":182,"end":191,"loc":{"start":{"line":8,"column":31},"end":{"line":8,"column":40},"identifierName":"BaseClass"}, + "name": "BaseClass" + }, + "body": { + "type": "ClassBody", + "start":192,"end":255,"loc":{"start":{"line":8,"column":41},"end":{"line":11,"column":1}}, + "body": [ + { + "type": "ClassProperty", + "start":196,"end":223,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":29}}, + "declare": true, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":213,"end":218,"loc":{"start":{"line":9,"column":19},"end":{"line":9,"column":24},"identifierName":"prop1"}, + "name": "prop1" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":218,"end":223,"loc":{"start":{"line":9,"column":24},"end":{"line":9,"column":29}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":220,"end":223,"loc":{"start":{"line":9,"column":26},"end":{"line":9,"column":29}} + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":226,"end":253,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":29}}, + "override": true, + "declare": true, + "static": false, + "key": { + "type": "Identifier", + "start":243,"end":248,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":24},"identifierName":"prop2"}, + "name": "prop2" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":248,"end":253,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":29}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":250,"end":253,"loc":{"start":{"line":10,"column":26},"end":{"line":10,"column":29}} + } + }, + "value": null + } + ] + } + }, + { + "type": "ClassDeclaration", + "start":257,"end":296,"loc":{"start":{"line":13,"column":0},"end":{"line":15,"column":1}}, + "id": { + "type": "Identifier", + "start":263,"end":271,"loc":{"start":{"line":13,"column":6},"end":{"line":13,"column":14},"identifierName":"MyClass4"}, + "name": "MyClass4" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":272,"end":296,"loc":{"start":{"line":13,"column":15},"end":{"line":15,"column":1}}, + "body": [ + { + "type": "ClassProperty", + "start":276,"end":294,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":20}}, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":285,"end":289,"loc":{"start":{"line":14,"column":11},"end":{"line":14,"column":15},"identifierName":"prop"}, + "name": "prop" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":289,"end":294,"loc":{"start":{"line":14,"column":15},"end":{"line":14,"column":20}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":291,"end":294,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":20}} + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts new file mode 100644 index 000000000000..b532036d7e90 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts @@ -0,0 +1,20 @@ +class MyClass extends BaseClass { + override show() {} + override public show() {} + public override show() {} + override size = 5; + override readonly size = 5; + readonly override size = 5; + + override get text() {} + override set text(value) {} + + override async fetch() {} + + override [x] = 2 + override [x]() {} +} + +declare class DeclaredClass extends BaseClass { + override test() {} +} diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json new file mode 100644 index 000000000000..293d14d661e2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json @@ -0,0 +1,332 @@ +{ + "type": "File", + "start":0,"end":390,"loc":{"start":{"line":1,"column":0},"end":{"line":20,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":390,"loc":{"start":{"line":1,"column":0},"end":{"line":20,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":318,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"MyClass"}, + "name": "MyClass" + }, + "superClass": { + "type": "Identifier", + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31},"identifierName":"BaseClass"}, + "name": "BaseClass" + }, + "body": { + "type": "ClassBody", + "start":32,"end":318,"loc":{"start":{"line":1,"column":32},"end":{"line":16,"column":1}}, + "body": [ + { + "type": "ClassMethod", + "start":36,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":45,"end":49,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":15},"identifierName":"show"}, + "name": "show" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":52,"end":54,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":57,"end":82,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":27}}, + "override": true, + "accessibility": "public", + "static": false, + "key": { + "type": "Identifier", + "start":73,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":22},"identifierName":"show"}, + "name": "show" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":80,"end":82,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":27}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":85,"end":110,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":27}}, + "accessibility": "public", + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":101,"end":105,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":22},"identifierName":"show"}, + "name": "show" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":108,"end":110,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":27}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassProperty", + "start":113,"end":131,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":20}}, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":122,"end":126,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":15},"identifierName":"size"}, + "name": "size" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":129,"end":130,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":19}}, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + { + "type": "ClassProperty", + "start":134,"end":161,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":29}}, + "override": true, + "readonly": true, + "static": false, + "key": { + "type": "Identifier", + "start":152,"end":156,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":24},"identifierName":"size"}, + "name": "size" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":159,"end":160,"loc":{"start":{"line":6,"column":27},"end":{"line":6,"column":28}}, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + { + "type": "ClassProperty", + "start":164,"end":191,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":29}}, + "readonly": true, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":182,"end":186,"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":24},"identifierName":"size"}, + "name": "size" + }, + "computed": false, + "value": { + "type": "NumericLiteral", + "start":189,"end":190,"loc":{"start":{"line":7,"column":27},"end":{"line":7,"column":28}}, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + { + "type": "ClassMethod", + "start":195,"end":217,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":24}}, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":208,"end":212,"loc":{"start":{"line":9,"column":15},"end":{"line":9,"column":19},"identifierName":"text"}, + "name": "text" + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":215,"end":217,"loc":{"start":{"line":9,"column":22},"end":{"line":9,"column":24}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":220,"end":247,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":29}}, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":233,"end":237,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":19},"identifierName":"text"}, + "name": "text" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start":238,"end":243,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":25},"identifierName":"value"}, + "name": "value" + } + ], + "body": { + "type": "BlockStatement", + "start":245,"end":247,"loc":{"start":{"line":10,"column":27},"end":{"line":10,"column":29}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":251,"end":276,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":27}}, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":266,"end":271,"loc":{"start":{"line":12,"column":17},"end":{"line":12,"column":22},"identifierName":"fetch"}, + "name": "fetch" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start":274,"end":276,"loc":{"start":{"line":12,"column":25},"end":{"line":12,"column":27}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassProperty", + "start":280,"end":296,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":18}}, + "override": true, + "static": false, + "computed": true, + "key": { + "type": "Identifier", + "start":290,"end":291,"loc":{"start":{"line":14,"column":12},"end":{"line":14,"column":13},"identifierName":"x"}, + "name": "x" + }, + "value": { + "type": "NumericLiteral", + "start":295,"end":296,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":18}}, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + }, + { + "type": "ClassMethod", + "start":299,"end":316,"loc":{"start":{"line":15,"column":2},"end":{"line":15,"column":19}}, + "override": true, + "static": false, + "computed": true, + "key": { + "type": "Identifier", + "start":309,"end":310,"loc":{"start":{"line":15,"column":12},"end":{"line":15,"column":13},"identifierName":"x"}, + "name": "x" + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":314,"end":316,"loc":{"start":{"line":15,"column":17},"end":{"line":15,"column":19}}, + "body": [], + "directives": [] + } + } + ] + } + }, + { + "type": "ClassDeclaration", + "start":320,"end":390,"loc":{"start":{"line":18,"column":0},"end":{"line":20,"column":1}}, + "declare": true, + "id": { + "type": "Identifier", + "start":334,"end":347,"loc":{"start":{"line":18,"column":14},"end":{"line":18,"column":27},"identifierName":"DeclaredClass"}, + "name": "DeclaredClass" + }, + "superClass": { + "type": "Identifier", + "start":356,"end":365,"loc":{"start":{"line":18,"column":36},"end":{"line":18,"column":45},"identifierName":"BaseClass"}, + "name": "BaseClass" + }, + "body": { + "type": "ClassBody", + "start":366,"end":390,"loc":{"start":{"line":18,"column":46},"end":{"line":20,"column":1}}, + "body": [ + { + "type": "ClassMethod", + "start":370,"end":388,"loc":{"start":{"line":19,"column":2},"end":{"line":19,"column":20}}, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":379,"end":383,"loc":{"start":{"line":19,"column":11},"end":{"line":19,"column":15},"identifierName":"test"}, + "name": "test" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":386,"end":388,"loc":{"start":{"line":19,"column":18},"end":{"line":19,"column":20}}, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-types/src/ast-types/generated/index.ts b/packages/babel-types/src/ast-types/generated/index.ts index 80b653c30440..da47784f7529 100755 --- a/packages/babel-types/src/ast-types/generated/index.ts +++ b/packages/babel-types/src/ast-types/generated/index.ts @@ -909,6 +909,7 @@ export interface ClassMethod extends BaseNode { accessibility?: "public" | "private" | "protected" | null; decorators?: Array | null; optional?: boolean | null; + override?: boolean; returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; typeParameters?: | TypeParameterDeclaration @@ -1535,6 +1536,7 @@ export interface ClassProperty extends BaseNode { declare?: boolean | null; definite?: boolean | null; optional?: boolean | null; + override?: boolean; readonly?: boolean | null; } @@ -1576,6 +1578,7 @@ export interface ClassPrivateMethod extends BaseNode { decorators?: Array | null; generator?: boolean; optional?: boolean | null; + override?: boolean; returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; typeParameters?: | TypeParameterDeclaration @@ -1668,6 +1671,7 @@ export interface TSDeclareMethod extends BaseNode { generator?: boolean; kind?: "get" | "set" | "method" | "constructor"; optional?: boolean | null; + override?: boolean; static?: boolean; } diff --git a/packages/babel-types/src/definitions/core.ts b/packages/babel-types/src/definitions/core.ts index a14636cd0fed..412f670989f3 100644 --- a/packages/babel-types/src/definitions/core.ts +++ b/packages/babel-types/src/definitions/core.ts @@ -1705,6 +1705,9 @@ export const classMethodOrPropertyCommon = { static: { default: false, }, + override: { + default: false, + }, computed: { default: false, }, From 75bca21e8eaa33f8066cceb5bbdba65918bf0ae3 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Mon, 12 Apr 2021 06:22:19 +0900 Subject: [PATCH 05/12] Add internal ESLint rule for consistent parser error messages (#13130) --- .eslintrc.cjs | 1 + .../README.md | 39 +++ .../src/index.js | 2 + .../src/rules/report-error-message-format.js | 31 +++ .../rules/report-error-message-formtat.js | 44 +++ .../babel/stdin --filename windows/stderr.txt | 2 +- .../babel/stdin --filename/stderr.txt | 2 +- .../transformation/errors/syntax/options.json | 2 +- .../babel-parser/src/parser/error-message.js | 261 +++++++++--------- .../babel-parser/src/plugins/flow/index.js | 47 ++-- .../babel-parser/src/plugins/jsx/index.js | 11 +- .../babel-parser/src/plugins/placeholders.js | 2 +- .../src/plugins/typescript/index.js | 25 +- .../fail/7/output.json | 98 +------ .../fail/8/output.json | 16 +- .../for-missing-semicolons/output.json | 4 +- .../invalid-assignment-pattern-1/output.json | 10 +- .../invalid-assignment-pattern-2/output.json | 10 +- .../invalid-assignment-pattern-3/output.json | 12 +- .../invalid-assignment-pattern-4/output.json | 12 +- .../invalid-assignment-pattern-5/output.json | 12 +- .../invalid-fn-decl-inside-loop/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 8 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../core/escape-keyword/invalid/output.json | 8 +- .../output.json | 12 +- .../output.json | 20 +- .../output.json | 8 +- .../non-octal-eight-and-nine/output.json | 4 +- .../numeric-escape-in-directive/output.json | 10 +- .../output.json | 16 +- .../non-octal-eight/output.json | 2 +- .../non-octal-nine/output.json | 2 +- .../output.json | 6 +- .../legacy-octal-after-use-strict/output.json | 4 +- .../core/object/invalid-setter/output.json | 12 +- .../non-octal-float-strict-mode/output.json | 2 +- .../regression/octal-float-fail/output.json | 2 +- .../dupl-bind-2nd-lvl-lex-nested/output.json | 2 +- .../scope/dupl-bind-2nd-lvl-lex/output.json | 2 +- .../dupl-bind-2nd-lvl-var-nested/output.json | 2 +- .../scope/dupl-bind-2nd-lvl-var/output.json | 2 +- .../dupl-bind-catch-arr-destr/output.json | 2 +- .../scope/dupl-bind-catch-dbl-let/output.json | 2 +- .../scope/dupl-bind-catch-func/output.json | 2 +- .../scope/dupl-bind-catch-let/output.json | 2 +- .../dupl-bind-catch-obj-destr/output.json | 2 +- .../dupl-bind-catch-var-arr-destr/output.json | 2 +- .../dupl-bind-catch-var-obj-destr/output.json | 8 +- .../scope/dupl-bind-class-class/output.json | 2 +- .../scope/dupl-bind-class-const/output.json | 2 +- .../scope/dupl-bind-class-func/output.json | 2 +- .../scope/dupl-bind-class-let/output.json | 2 +- .../scope/dupl-bind-class-var/output.json | 2 +- .../scope/dupl-bind-const-const/output.json | 2 +- .../core/scope/dupl-bind-func-gen/output.json | 2 +- .../dupl-bind-func-module-sloppy/output.json | 2 +- .../scope/dupl-bind-func-module/output.json | 2 +- .../dupl-bind-func-var-sloppy/output.json | 2 +- .../core/scope/dupl-bind-gen-func/output.json | 2 +- .../core/scope/dupl-bind-let-let/output.json | 2 +- .../dupl-bind-nested-let-var/output.json | 2 +- .../fixtures/core/scope/for-var/output.json | 2 +- .../undecl-export-as-default/output.json | 2 +- .../core/scope/undecl-export-as/output.json | 2 +- .../scope/undecl-export-block/output.json | 2 +- .../undecl-export-builtin-as/output.json | 2 +- .../scope/undecl-export-builtin/output.json | 2 +- .../core/scope/undecl-export-if/output.json | 4 +- .../core/scope/undecl-export/output.json | 2 +- .../core/uncategorised/108/output.json | 10 +- .../core/uncategorised/347/options.json | 4 +- .../core/uncategorised/348/options.json | 4 +- .../core/uncategorised/349/output.json | 2 +- .../core/uncategorised/350/output.json | 2 +- .../core/uncategorised/351/output.json | 2 +- .../core/uncategorised/352/options.json | 4 +- .../core/uncategorised/353/options.json | 4 +- .../core/uncategorised/354/output.json | 2 +- .../core/uncategorised/357/options.json | 4 +- .../core/uncategorised/358/options.json | 4 +- .../core/uncategorised/359/options.json | 4 +- .../core/uncategorised/360/options.json | 4 +- .../core/uncategorised/361/output.json | 2 +- .../core/uncategorised/362/output.json | 2 +- .../core/uncategorised/363/output.json | 2 +- .../core/uncategorised/364/options.json | 4 +- .../core/uncategorised/365/options.json | 4 +- .../core/uncategorised/366/output.json | 4 +- .../core/uncategorised/367/output.json | 2 +- .../core/uncategorised/368/output.json | 2 +- .../core/uncategorised/369/output.json | 12 +- .../core/uncategorised/370/output.json | 2 +- .../core/uncategorised/371/output.json | 2 +- .../core/uncategorised/372/output.json | 2 +- .../core/uncategorised/373/output.json | 2 +- .../core/uncategorised/374/output.json | 12 +- .../core/uncategorised/380/options.json | 4 +- .../core/uncategorised/381/options.json | 4 +- .../core/uncategorised/382/output.json | 2 +- .../core/uncategorised/383/output.json | 2 +- .../core/uncategorised/384/output.json | 2 +- .../core/uncategorised/388/output.json | 2 +- .../core/uncategorised/389/output.json | 2 +- .../core/uncategorised/396/options.json | 4 +- .../core/uncategorised/397/output.json | 2 +- .../core/uncategorised/398/output.json | 2 +- .../core/uncategorised/399/output.json | 2 +- .../core/uncategorised/400/output.json | 2 +- .../core/uncategorised/401/output.json | 2 +- .../core/uncategorised/402/output.json | 2 +- .../core/uncategorised/403/output.json | 2 +- .../core/uncategorised/404/output.json | 2 +- .../core/uncategorised/405/output.json | 2 +- .../core/uncategorised/408/options.json | 2 +- .../core/uncategorised/409/output.json | 2 +- .../core/uncategorised/411/output.json | 2 +- .../core/uncategorised/417/output.json | 2 +- .../core/uncategorised/418/output.json | 2 +- .../core/uncategorised/425/output.json | 2 +- .../core/uncategorised/426/options.json | 4 +- .../core/uncategorised/427/output.json | 2 +- .../core/uncategorised/429/options.json | 4 +- .../core/uncategorised/430/options.json | 4 +- .../core/uncategorised/431/options.json | 4 +- .../core/uncategorised/432/options.json | 4 +- .../core/uncategorised/433/options.json | 4 +- .../core/uncategorised/434/options.json | 4 +- .../core/uncategorised/441/options.json | 4 +- .../core/uncategorised/446/output.json | 4 +- .../core/uncategorised/447/output.json | 2 +- .../core/uncategorised/448/output.json | 2 +- .../core/uncategorised/449/output.json | 2 +- .../core/uncategorised/450/options.json | 4 +- .../core/uncategorised/451/options.json | 4 +- .../core/uncategorised/452/options.json | 4 +- .../core/uncategorised/453/options.json | 4 +- .../core/uncategorised/454/output.json | 2 +- .../core/uncategorised/455/output.json | 2 +- .../core/uncategorised/456/output.json | 2 +- .../core/uncategorised/457/output.json | 2 +- .../core/uncategorised/459/output.json | 2 +- .../core/uncategorised/460/output.json | 2 +- .../core/uncategorised/461/output.json | 10 +- .../core/uncategorised/462/output.json | 10 +- .../core/uncategorised/463/output.json | 10 +- .../core/uncategorised/464/output.json | 10 +- .../core/uncategorised/465/output.json | 2 +- .../core/uncategorised/466/output.json | 16 +- .../core/uncategorised/467/output.json | 16 +- .../core/uncategorised/468/output.json | 6 +- .../core/uncategorised/469/output.json | 6 +- .../core/uncategorised/470/output.json | 6 +- .../core/uncategorised/471/output.json | 6 +- .../core/uncategorised/472/output.json | 6 +- .../core/uncategorised/473/output.json | 6 +- .../core/uncategorised/474/output.json | 6 +- .../core/uncategorised/475/output.json | 6 +- .../core/uncategorised/476/output.json | 6 +- .../core/uncategorised/477/output.json | 6 +- .../core/uncategorised/478/output.json | 6 +- .../core/uncategorised/479/output.json | 6 +- .../core/uncategorised/480/output.json | 6 +- .../core/uncategorised/481/output.json | 6 +- .../core/uncategorised/482/output.json | 6 +- .../core/uncategorised/483/output.json | 6 +- .../core/uncategorised/484/output.json | 6 +- .../core/uncategorised/485/output.json | 6 +- .../core/uncategorised/486/output.json | 16 +- .../core/uncategorised/487/output.json | 16 +- .../core/uncategorised/488/output.json | 14 +- .../core/uncategorised/489/output.json | 14 +- .../core/uncategorised/490/output.json | 16 +- .../core/uncategorised/491/output.json | 14 +- .../core/uncategorised/492/output.json | 16 +- .../core/uncategorised/493/output.json | 16 +- .../core/uncategorised/494/output.json | 16 +- .../core/uncategorised/495/output.json | 6 +- .../core/uncategorised/496/output.json | 6 +- .../core/uncategorised/497/output.json | 6 +- .../core/uncategorised/498/output.json | 6 +- .../core/uncategorised/500/output.json | 6 +- .../core/uncategorised/502/output.json | 16 +- .../core/uncategorised/504/output.json | 6 +- .../core/uncategorised/505/output.json | 6 +- .../core/uncategorised/506/output.json | 6 +- .../core/uncategorised/507/output.json | 6 +- .../core/uncategorised/508/output.json | 6 +- .../core/uncategorised/509/output.json | 6 +- .../core/uncategorised/510/output.json | 6 +- .../core/uncategorised/511/output.json | 6 +- .../core/uncategorised/512/output.json | 6 +- .../core/uncategorised/513/output.json | 6 +- .../core/uncategorised/514/output.json | 6 +- .../core/uncategorised/515/output.json | 6 +- .../core/uncategorised/516/output.json | 6 +- .../core/uncategorised/517/output.json | 6 +- .../core/uncategorised/518/output.json | 14 +- .../core/uncategorised/519/output.json | 14 +- .../core/uncategorised/520/output.json | 14 +- .../core/uncategorised/521/output.json | 14 +- .../core/uncategorised/522/output.json | 10 +- .../core/uncategorised/523/output.json | 2 +- .../core/uncategorised/524/output.json | 2 +- .../core/uncategorised/536/output.json | 2 +- .../core/uncategorised/544/output.json | 12 +- .../core/uncategorised/545/output.json | 8 +- .../core/uncategorised/550/output.json | 6 +- .../core/uncategorised/552/output.json | 6 +- .../core/uncategorised/555/options.json | 4 +- .../comma-after-rest/output.json | 2 +- .../comma-after-spread-for-in/output.json | 2 +- .../comma-after-spread-nested/output.json | 2 +- .../invalid-location/options.json | 4 +- .../inner-parens-2/output.json | 2 +- .../inner-parens-array-pattern-2/output.json | 2 +- .../inner-parens-array-pattern-3/output.json | 2 +- .../inner-parens-array-pattern/output.json | 2 +- .../output.json | 2 +- .../inner-parens-object-pattern/output.json | 2 +- .../arrow-functions/inner-parens/output.json | 2 +- .../invalid-rest-in-params/options.json | 4 +- .../direct-super-in-object-method/output.json | 10 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../disallow-static-prototype/output.json | 2 +- .../getter-signature/output.json | 2 +- .../malformed-super-expression/output.json | 2 +- .../es2015/class/extends-strict/output.json | 12 +- .../binding-arguments-module/output.json | 8 +- .../binding-arguments-strict/output.json | 12 +- .../destructuring/binding-eval/output.json | 20 +- .../destructuring/binding-this/output.json | 8 +- .../parenthesized-lhs-array/output.json | 12 +- .../parenthesized-lhs-object/output.json | 18 +- .../in-new-expression/output.json | 6 +- .../for-in/bare-initializer/output.json | 2 +- .../for-in/const-initializer/output.json | 2 +- .../es2015/for-in/let-initializer/output.json | 2 +- .../for-in/strict-initializer/output.json | 6 +- .../output.json | 2 +- .../output.json | 8 +- .../for-of/bare-initializer/output.json | 2 +- .../for-of/invalid-escape-of/output.json | 4 +- .../invalid-escape-yield/output.json | 10 +- .../generators/invalid-hanging/output.json | 2 +- .../invalid-escape-seq-const/output.json | 6 +- .../invalid-escape-seq-export/output.json | 6 +- .../invalid-escape-seq-if/output.json | 2 +- .../invalid-escape-seq-import/output.json | 6 +- .../invalid-escape-seq-null/output.json | 2 +- .../invalid-escape-seq-true/output.json | 2 +- .../es2015/let/invalid-escape/output.json | 2 +- .../let-as-identifier-strict-fail/output.json | 6 +- .../invalid-arrow-function/output.json | 2 +- .../new-invalid-prop/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../new-target-invalid/output.json | 2 +- .../output.json | 2 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 8 +- .../output.json | 2 +- .../duplicate-named-export/output.json | 4 +- .../import-invalid-keyword-flow/output.json | 2 +- .../output.json | 2 +- .../import-invalid-keyword-typeof/output.json | 2 +- .../import-invalid-keyword/output.json | 2 +- .../output.json | 12 +- .../invalid-accessor-generator/output.json | 16 +- .../es2015/regex/duplicate-flags/output.json | 2 +- .../reserved-word-strict/output.json | 38 +-- .../shorthand/reserved-word/output.json | 34 +-- .../label-invalid-const/output.json | 2 +- .../label-invalid-func-async/output.json | 2 +- .../label-invalid-func-generator/output.json | 2 +- .../label-invalid-func-strict/output.json | 6 +- .../statements/label-invalid-let/output.json | 2 +- .../es2015/uncategorised/109/output.json | 2 +- .../es2015/uncategorised/123/output.json | 14 +- .../es2015/uncategorised/125/output.json | 2 +- .../es2015/uncategorised/126/output.json | 2 +- .../es2015/uncategorised/127/output.json | 2 +- .../es2015/uncategorised/166/output.json | 8 +- .../es2015/uncategorised/198/output.json | 2 +- .../es2015/uncategorised/199/options.json | 4 +- .../es2015/uncategorised/200/output.json | 2 +- .../es2015/uncategorised/201/output.json | 2 +- .../es2015/uncategorised/202/output.json | 2 +- .../es2015/uncategorised/203/options.json | 4 +- .../es2015/uncategorised/204/output.json | 2 +- .../es2015/uncategorised/205/output.json | 2 +- .../es2015/uncategorised/206/output.json | 2 +- .../es2015/uncategorised/207/options.json | 4 +- .../es2015/uncategorised/208/output.json | 2 +- .../es2015/uncategorised/209/output.json | 2 +- .../es2015/uncategorised/210/output.json | 2 +- .../es2015/uncategorised/211/output.json | 2 +- .../es2015/uncategorised/212/options.json | 4 +- .../es2015/uncategorised/213/output.json | 2 +- .../es2015/uncategorised/214/output.json | 2 +- .../es2015/uncategorised/215/output.json | 2 +- .../es2015/uncategorised/217/output.json | 6 +- .../es2015/uncategorised/218/output.json | 6 +- .../es2015/uncategorised/219/output.json | 6 +- .../es2015/uncategorised/220/output.json | 2 +- .../es2015/uncategorised/221/output.json | 2 +- .../es2015/uncategorised/222/output.json | 10 +- .../es2015/uncategorised/223/output.json | 10 +- .../es2015/uncategorised/224/output.json | 2 +- .../es2015/uncategorised/225/output.json | 2 +- .../es2015/uncategorised/226/output.json | 2 +- .../es2015/uncategorised/227/output.json | 16 +- .../es2015/uncategorised/228/output.json | 16 +- .../es2015/uncategorised/229/output.json | 2 +- .../es2015/uncategorised/230/output.json | 2 +- .../es2015/uncategorised/231/output.json | 2 +- .../es2015/uncategorised/232/output.json | 2 +- .../es2015/uncategorised/233/output.json | 14 +- .../es2015/uncategorised/234/output.json | 14 +- .../es2015/uncategorised/235/output.json | 2 +- .../es2015/uncategorised/236/output.json | 2 +- .../es2015/uncategorised/242/output.json | 8 +- .../es2015/uncategorised/243/output.json | 6 +- .../es2015/uncategorised/244/output.json | 6 +- .../es2015/uncategorised/245/output.json | 6 +- .../es2015/uncategorised/246/output.json | 6 +- .../es2015/uncategorised/247/output.json | 6 +- .../es2015/uncategorised/248/output.json | 6 +- .../es2015/uncategorised/249/output.json | 6 +- .../es2015/uncategorised/251/output.json | 2 +- .../es2015/uncategorised/252/output.json | 4 +- .../es2015/uncategorised/263/options.json | 4 +- .../es2015/uncategorised/264/options.json | 4 +- .../es2015/uncategorised/277/options.json | 4 +- .../es2015/uncategorised/280/output.json | 12 +- .../es2015/uncategorised/281/output.json | 18 +- .../es2015/uncategorised/283/options.json | 4 +- .../es2015/uncategorised/284/output.json | 2 +- .../es2015/uncategorised/289/output.json | 16 +- .../es2015/uncategorised/290/output.json | 6 +- .../es2015/uncategorised/291/output.json | 2 +- .../es2015/uncategorised/296/output.json | 6 +- .../es2015/uncategorised/297/output.json | 6 +- .../es2015/uncategorised/298/output.json | 2 +- .../es2015/uncategorised/324/output.json | 2 +- .../es2015/uncategorised/325/output.json | 2 +- .../es2015/uncategorised/326/options.json | 4 +- .../es2015/uncategorised/327/options.json | 4 +- .../es2015/uncategorised/328/output.json | 2 +- .../es2015/uncategorised/329/output.json | 2 +- .../es2015/uncategorised/332/output.json | 6 +- .../es2015/uncategorised/334/output.json | 2 +- .../es2015/uncategorised/339/output.json | 2 +- .../es2015/uncategorised/344/output.json | 4 +- .../es2015/uncategorised/347/output.json | 2 +- .../es2015/uncategorised/348/output.json | 12 +- .../es2015/uncategorised/349/output.json | 12 +- .../es2015/uncategorised/357/output.json | 2 +- .../es2015/uncategorised/359/output.json | 2 +- .../es2015/uncategorised/361/output.json | 2 +- .../es2015/uncategorised/363/output.json | 2 +- .../es2015/uncategorised/365/output.json | 2 +- .../es2015/uncategorised/367/output.json | 2 +- .../es2015/uncategorised/368/output.json | 2 +- .../es2015/uncategorised/369/output.json | 2 +- .../es2015/uncategorised/37/output.json | 6 +- .../es2015/uncategorised/370/output.json | 2 +- .../es2015/uncategorised/371/output.json | 2 +- .../es2015/uncategorised/372/output.json | 8 +- .../es2015/uncategorised/373/output.json | 8 +- .../es2015/uncategorised/374/output.json | 8 +- .../es2015/uncategorised/375/output.json | 8 +- .../es2015/uncategorised/376/output.json | 2 +- .../es2015/uncategorised/377/output.json | 2 +- .../es2015/uncategorised/378/output.json | 2 +- .../es2015/uncategorised/379/output.json | 2 +- .../es2015/uncategorised/395/output.json | 6 +- .../output.json | 2 +- .../output.json | 2 +- .../function-name-strict-body/output.json | 6 +- .../yield/function-name-strict/output.json | 6 +- .../es2015/yield/in-global-scope/output.json | 2 +- .../yield/in-plain-function/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 4 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../parameter-default-strict/output.json | 6 +- .../output.json | 4 +- .../output.json | 4 +- .../output.json | 4 +- .../output.json | 12 +- .../parameter-name-generator/output.json | 2 +- .../parameter-name-strict-body/output.json | 6 +- .../yield/parameter-name-strict/output.json | 6 +- .../output.json | 4 +- .../array-pattern-default/output.json | 6 +- .../array-pattern/output.json | 6 +- .../arrow-function/output.json | 6 +- .../async-arrow-function/output.json | 6 +- .../async-function/output.json | 6 +- .../simple-parameter-list/default/output.json | 6 +- .../generator-function/output.json | 6 +- .../generator-method/output.json | 6 +- .../simple-parameter-list/method/output.json | 6 +- .../object-pattern-default/output.json | 18 +- .../object-pattern/output.json | 18 +- .../simple-parameter-list/rest/output.json | 6 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../parenthesized-binding-pattern/output.json | 2 +- .../parenthesized-rest-array/output.json | 2 +- .../parenthesized-rest-object/output.json | 2 +- .../es2017/async-functions/2/output.json | 2 +- .../es2017/async-functions/9/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 10 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 4 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 4 +- .../await-inside-parameters/output.json | 2 +- .../output.json | 2 +- .../invalid-escape-await/output.json | 4 +- .../output.json | 4 +- .../invalid-escape-sequence-arrow/output.json | 4 +- .../invalid-inside-loop/output.json | 2 +- .../invalid-parens-async-func/output.json | 2 +- .../output.json | 6 +- .../newline-before-arrow/output.json | 4 +- .../no-constructor/output.json | 2 +- .../output.json | 2 +- .../trailing-function-commas/5/output.json | 8 +- .../es2018/object-rest-spread/11/output.json | 8 +- .../es2018/object-rest-spread/12/output.json | 8 +- .../es2018/object-rest-spread/13/output.json | 8 +- .../es2018/object-rest-spread/14/output.json | 8 +- .../es2018/object-rest-spread/15/output.json | 8 +- .../es2018/object-rest-spread/18/output.json | 10 +- .../es2018/object-rest-spread/21/output.json | 10 +- .../es2018/object-rest-spread/24/output.json | 10 +- .../es2018/object-rest-spread/7/options.json | 4 +- .../es2018/object-rest-spread/8/output.json | 22 +- .../es2018/object-rest-spread/9/options.json | 4 +- .../comma-after-rest/options.json | 4 +- .../comma-after-spread-for-in/options.json | 4 +- .../comma-after-spread-nested/options.json | 4 +- .../options.json | 4 +- .../es2020/bigint/invalid-decimal/output.json | 2 +- .../es2020/bigint/invalid-e/output.json | 2 +- .../invalid-non-octal-decimal-int/output.json | 2 +- .../bigint/invalid-octal-legacy/output.json | 2 +- .../direct-calls-only/output.json | 2 +- .../invalid-arguments-spread/output.json | 2 +- .../dynamic-import/invalid-new/output.json | 2 +- .../invalid-trailing-comma/output.json | 8 +- .../dynamic-import/multiple-args/output.json | 2 +- .../es2020/dynamic-import/no-args/output.json | 2 +- .../no-other-prop-names/output.json | 2 +- .../import-meta/not-assignable/output.json | 2 +- .../no-paren-and-nullish/options.json | 8 +- .../no-paren-nullish-and/options.json | 4 +- .../no-paren-nullish-or/options.json | 4 +- .../no-paren-or-nullish/options.json | 8 +- .../class-contructor-call/output.json | 6 +- .../optional-constructor/output.json | 2 +- .../optional-super-property-class/output.json | 4 +- .../optional-super-property/output.json | 4 +- .../output.json | 4 +- .../numeric-separator/invalid-0/output.json | 2 +- .../numeric-separator/invalid-1/output.json | 2 +- .../numeric-separator/invalid-10/output.json | 2 +- .../numeric-separator/invalid-100/output.json | 2 +- .../numeric-separator/invalid-101/output.json | 2 +- .../numeric-separator/invalid-102/output.json | 4 +- .../numeric-separator/invalid-103/output.json | 4 +- .../numeric-separator/invalid-104/output.json | 2 +- .../numeric-separator/invalid-105/output.json | 2 +- .../numeric-separator/invalid-106/output.json | 2 +- .../numeric-separator/invalid-107/output.json | 2 +- .../numeric-separator/invalid-108/output.json | 2 +- .../numeric-separator/invalid-109/output.json | 2 +- .../numeric-separator/invalid-11/output.json | 2 +- .../numeric-separator/invalid-110/output.json | 2 +- .../numeric-separator/invalid-111/output.json | 2 +- .../numeric-separator/invalid-112/output.json | 2 +- .../numeric-separator/invalid-113/output.json | 6 +- .../numeric-separator/invalid-114/output.json | 6 +- .../numeric-separator/invalid-115/output.json | 4 +- .../numeric-separator/invalid-116/output.json | 2 +- .../numeric-separator/invalid-117/output.json | 2 +- .../numeric-separator/invalid-118/output.json | 4 +- .../numeric-separator/invalid-119/output.json | 2 +- .../numeric-separator/invalid-12/output.json | 2 +- .../numeric-separator/invalid-120/output.json | 4 +- .../numeric-separator/invalid-121/output.json | 2 +- .../numeric-separator/invalid-122/output.json | 2 +- .../numeric-separator/invalid-123/output.json | 4 +- .../numeric-separator/invalid-124/output.json | 2 +- .../numeric-separator/invalid-125/output.json | 2 +- .../numeric-separator/invalid-126/output.json | 4 +- .../numeric-separator/invalid-127/output.json | 4 +- .../numeric-separator/invalid-128/output.json | 2 +- .../numeric-separator/invalid-129/output.json | 2 +- .../numeric-separator/invalid-13/output.json | 6 +- .../numeric-separator/invalid-130/output.json | 2 +- .../numeric-separator/invalid-131/output.json | 2 +- .../numeric-separator/invalid-132/output.json | 2 +- .../numeric-separator/invalid-133/output.json | 2 +- .../numeric-separator/invalid-134/output.json | 2 +- .../numeric-separator/invalid-135/output.json | 2 +- .../numeric-separator/invalid-136/output.json | 2 +- .../numeric-separator/invalid-137/output.json | 6 +- .../numeric-separator/invalid-138/output.json | 6 +- .../numeric-separator/invalid-139/output.json | 4 +- .../numeric-separator/invalid-14/output.json | 6 +- .../numeric-separator/invalid-140/output.json | 2 +- .../numeric-separator/invalid-141/output.json | 2 +- .../numeric-separator/invalid-142/output.json | 4 +- .../numeric-separator/invalid-143/output.json | 2 +- .../numeric-separator/invalid-144/output.json | 4 +- .../numeric-separator/invalid-145/output.json | 2 +- .../numeric-separator/invalid-146/output.json | 2 +- .../numeric-separator/invalid-147/output.json | 4 +- .../numeric-separator/invalid-15/output.json | 4 +- .../numeric-separator/invalid-16/output.json | 2 +- .../numeric-separator/invalid-17/output.json | 2 +- .../numeric-separator/invalid-18/output.json | 4 +- .../numeric-separator/invalid-19/output.json | 2 +- .../numeric-separator/invalid-2/output.json | 4 +- .../numeric-separator/invalid-20/output.json | 4 +- .../numeric-separator/invalid-21/output.json | 2 +- .../numeric-separator/invalid-22/output.json | 2 +- .../numeric-separator/invalid-23/output.json | 4 +- .../numeric-separator/invalid-25/output.json | 4 +- .../numeric-separator/invalid-26/output.json | 2 +- .../numeric-separator/invalid-27/options.json | 4 +- .../numeric-separator/invalid-28/output.json | 2 +- .../numeric-separator/invalid-29/output.json | 2 +- .../numeric-separator/invalid-3/output.json | 4 +- .../numeric-separator/invalid-30/output.json | 4 +- .../numeric-separator/invalid-31/output.json | 4 +- .../numeric-separator/invalid-32/output.json | 2 +- .../numeric-separator/invalid-33/output.json | 2 +- .../numeric-separator/invalid-34/output.json | 2 +- .../numeric-separator/invalid-35/output.json | 2 +- .../numeric-separator/invalid-36/output.json | 2 +- .../numeric-separator/invalid-37/output.json | 2 +- .../numeric-separator/invalid-38/output.json | 2 +- .../numeric-separator/invalid-39/output.json | 2 +- .../numeric-separator/invalid-4/output.json | 2 +- .../numeric-separator/invalid-40/output.json | 2 +- .../numeric-separator/invalid-41/output.json | 6 +- .../numeric-separator/invalid-42/output.json | 6 +- .../numeric-separator/invalid-43/output.json | 4 +- .../numeric-separator/invalid-44/output.json | 2 +- .../numeric-separator/invalid-45/output.json | 2 +- .../numeric-separator/invalid-46/output.json | 4 +- .../numeric-separator/invalid-47/output.json | 2 +- .../numeric-separator/invalid-48/output.json | 4 +- .../numeric-separator/invalid-49/output.json | 2 +- .../numeric-separator/invalid-5/output.json | 2 +- .../numeric-separator/invalid-50/output.json | 2 +- .../numeric-separator/invalid-51/output.json | 4 +- .../numeric-separator/invalid-52/output.json | 2 +- .../numeric-separator/invalid-53/output.json | 2 +- .../numeric-separator/invalid-54/output.json | 4 +- .../numeric-separator/invalid-55/output.json | 4 +- .../numeric-separator/invalid-56/output.json | 2 +- .../numeric-separator/invalid-57/output.json | 2 +- .../numeric-separator/invalid-58/output.json | 2 +- .../numeric-separator/invalid-59/output.json | 2 +- .../numeric-separator/invalid-6/output.json | 2 +- .../numeric-separator/invalid-60/output.json | 2 +- .../numeric-separator/invalid-61/output.json | 2 +- .../numeric-separator/invalid-62/output.json | 2 +- .../numeric-separator/invalid-63/output.json | 2 +- .../numeric-separator/invalid-64/output.json | 2 +- .../numeric-separator/invalid-65/output.json | 6 +- .../numeric-separator/invalid-66/output.json | 6 +- .../numeric-separator/invalid-67/output.json | 4 +- .../numeric-separator/invalid-68/output.json | 2 +- .../numeric-separator/invalid-69/output.json | 2 +- .../numeric-separator/invalid-7/output.json | 2 +- .../numeric-separator/invalid-70/output.json | 4 +- .../numeric-separator/invalid-71/output.json | 2 +- .../numeric-separator/invalid-72/output.json | 4 +- .../numeric-separator/invalid-73/output.json | 2 +- .../numeric-separator/invalid-74/output.json | 2 +- .../numeric-separator/invalid-75/output.json | 4 +- .../numeric-separator/invalid-76/output.json | 2 +- .../numeric-separator/invalid-77/output.json | 2 +- .../numeric-separator/invalid-78/output.json | 4 +- .../numeric-separator/invalid-79/output.json | 4 +- .../numeric-separator/invalid-8/output.json | 2 +- .../numeric-separator/invalid-80/output.json | 2 +- .../numeric-separator/invalid-81/output.json | 2 +- .../numeric-separator/invalid-82/output.json | 2 +- .../numeric-separator/invalid-83/output.json | 2 +- .../numeric-separator/invalid-84/output.json | 2 +- .../numeric-separator/invalid-85/output.json | 2 +- .../numeric-separator/invalid-86/output.json | 2 +- .../numeric-separator/invalid-87/output.json | 2 +- .../numeric-separator/invalid-88/output.json | 2 +- .../numeric-separator/invalid-89/output.json | 6 +- .../numeric-separator/invalid-9/output.json | 2 +- .../numeric-separator/invalid-90/output.json | 6 +- .../numeric-separator/invalid-91/output.json | 4 +- .../numeric-separator/invalid-92/output.json | 2 +- .../numeric-separator/invalid-93/output.json | 2 +- .../numeric-separator/invalid-94/output.json | 4 +- .../numeric-separator/invalid-95/output.json | 2 +- .../numeric-separator/invalid-96/output.json | 4 +- .../numeric-separator/invalid-97/output.json | 2 +- .../numeric-separator/invalid-98/output.json | 2 +- .../numeric-separator/invalid-99/output.json | 4 +- .../numeric-separator/invalid-hex/output.json | 6 +- .../invalid-leading-zero/output.json | 2 +- .../invalid-legacy-octal-literal/output.json | 2 +- .../invalid-non-octal-decimal-int/output.json | 4 +- .../invalid-unicode-2/output.json | 6 +- .../invalid-unicode/output.json | 6 +- .../dupe-param/output.json | 6 +- .../invalid-dup-param/output.json | 2 +- .../dupe-param-1/output.json | 6 +- .../dupe-param-2/output.json | 6 +- .../dupe-param-3/output.json | 12 +- .../arrow-with-multiple-rest/options.json | 4 +- .../output.json | 2 +- .../invalid-duplicated-params/output.json | 2 +- .../invalid-param-strict-mode/output.json | 6 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 6 +- .../output.json | 2 +- .../output.json | 6 +- .../invalid-lhs-01/output.json | 10 +- .../invalid-lhs-02/output.json | 10 +- .../invalid-pattern-with-method/output.json | 10 +- .../invalid-group-assignment/output.json | 24 +- .../invalid-export-named-default/output.json | 4 +- .../invalid-const-init/output.json | 2 +- .../invalid-let-init/output.json | 2 +- .../invalid-lhs-init/output.json | 2 +- .../invalid-var-init/output.json | 2 +- .../unexpected-number/output.json | 6 +- .../output.json | 4 +- .../invalid_id_smp/options.json | 4 +- .../output.json | 2 +- .../invalid_const_forin/output.json | 2 +- .../invalid_let_forin/output.json | 2 +- .../invalid-new-target/output.json | 2 +- .../unknown-property/output.json | 2 +- .../output.json | 14 +- .../output.json | 12 +- .../invalid-proto-identifiers/output.json | 12 +- .../output.json | 12 +- .../invalid-proto-literals/output.json | 12 +- .../output.json | 14 +- .../output.json | 2 +- .../invalid-escape/output.json | 2 +- .../unclosed/options.json | 4 +- .../invalid-yield-expression/output.json | 2 +- .../output.json | 2 +- .../output.json | 4 +- .../output.json | 4 +- .../invalid-yield-generator-catch/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 10 +- .../output.json | 10 +- .../output.json | 10 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../invalid-yield-generator-rest/output.json | 2 +- .../output.json | 6 +- .../output.json | 6 +- .../output.json | 2 +- .../output.json | 14 +- .../output.json | 6 +- .../output.json | 6 +- .../output.json | 6 +- .../output.json | 6 +- .../output.json | 6 +- .../output.json | 6 +- .../output.json | 14 +- .../output.json | 6 +- .../output.json | 6 +- .../output.json | 6 +- .../output.json | 6 +- .../yield-generator-arrow-default/output.json | 2 +- .../migrated_0012/output.json | 2 +- .../invalid-syntax/GH-1106-00/output.json | 6 +- .../invalid-syntax/GH-1106-01/output.json | 6 +- .../invalid-syntax/GH-1106-02/output.json | 6 +- .../invalid-syntax/GH-1106-03/output.json | 6 +- .../invalid-syntax/GH-1106-04/output.json | 6 +- .../invalid-syntax/GH-1106-05/output.json | 6 +- .../invalid-syntax/GH-1106-06/output.json | 6 +- .../invalid-syntax/GH-1106-07/output.json | 6 +- .../invalid-syntax/migrated_0002/options.json | 4 +- .../invalid-syntax/migrated_0003/options.json | 4 +- .../invalid-syntax/migrated_0004/output.json | 2 +- .../invalid-syntax/migrated_0005/output.json | 2 +- .../invalid-syntax/migrated_0006/output.json | 2 +- .../invalid-syntax/migrated_0007/options.json | 4 +- .../invalid-syntax/migrated_0008/options.json | 4 +- .../invalid-syntax/migrated_0009/output.json | 2 +- .../invalid-syntax/migrated_0010/options.json | 4 +- .../invalid-syntax/migrated_0011/options.json | 4 +- .../invalid-syntax/migrated_0012/output.json | 2 +- .../invalid-syntax/migrated_0013/output.json | 2 +- .../invalid-syntax/migrated_0014/output.json | 2 +- .../invalid-syntax/migrated_0015/output.json | 2 +- .../invalid-syntax/migrated_0016/options.json | 4 +- .../invalid-syntax/migrated_0017/output.json | 2 +- .../invalid-syntax/migrated_0018/options.json | 4 +- .../invalid-syntax/migrated_0019/output.json | 2 +- .../invalid-syntax/migrated_0020/output.json | 2 +- .../invalid-syntax/migrated_0021/output.json | 2 +- .../invalid-syntax/migrated_0022/output.json | 2 +- .../invalid-syntax/migrated_0023/options.json | 4 +- .../invalid-syntax/migrated_0024/output.json | 2 +- .../invalid-syntax/migrated_0025/output.json | 2 +- .../invalid-syntax/migrated_0026/output.json | 2 +- .../invalid-syntax/migrated_0027/output.json | 2 +- .../invalid-syntax/migrated_0028/output.json | 2 +- .../invalid-syntax/migrated_0029/options.json | 4 +- .../invalid-syntax/migrated_0030/options.json | 4 +- .../invalid-syntax/migrated_0031/options.json | 4 +- .../invalid-syntax/migrated_0032/output.json | 2 +- .../invalid-syntax/migrated_0033/output.json | 2 +- .../invalid-syntax/migrated_0034/output.json | 2 +- .../invalid-syntax/migrated_0036/output.json | 2 +- .../invalid-syntax/migrated_0037/output.json | 2 +- .../invalid-syntax/migrated_0038/options.json | 4 +- .../invalid-syntax/migrated_0039/options.json | 4 +- .../invalid-syntax/migrated_0040/options.json | 4 +- .../invalid-syntax/migrated_0041/output.json | 4 +- .../invalid-syntax/migrated_0042/output.json | 4 +- .../invalid-syntax/migrated_0043/output.json | 6 +- .../invalid-syntax/migrated_0044/output.json | 12 +- .../invalid-syntax/migrated_0045/output.json | 2 +- .../invalid-syntax/migrated_0046/output.json | 2 +- .../invalid-syntax/migrated_0047/output.json | 12 +- .../invalid-syntax/migrated_0049/output.json | 2 +- .../invalid-syntax/migrated_0050/output.json | 2 +- .../invalid-syntax/migrated_0051/output.json | 2 +- .../invalid-syntax/migrated_0052/output.json | 2 +- .../invalid-syntax/migrated_0053/output.json | 2 +- .../invalid-syntax/migrated_0054/output.json | 2 +- .../invalid-syntax/migrated_0055/output.json | 2 +- .../invalid-syntax/migrated_0056/output.json | 12 +- .../invalid-syntax/migrated_0062/options.json | 4 +- .../invalid-syntax/migrated_0063/options.json | 4 +- .../invalid-syntax/migrated_0064/output.json | 2 +- .../invalid-syntax/migrated_0066/output.json | 2 +- .../invalid-syntax/migrated_0067/output.json | 2 +- .../invalid-syntax/migrated_0071/output.json | 2 +- .../invalid-syntax/migrated_0072/output.json | 2 +- .../invalid-syntax/migrated_0075/output.json | 12 +- .../invalid-syntax/migrated_0087/output.json | 8 +- .../invalid-syntax/migrated_0088/output.json | 6 +- .../invalid-syntax/migrated_0089/output.json | 6 +- .../invalid-syntax/migrated_0090/output.json | 6 +- .../invalid-syntax/migrated_0091/output.json | 6 +- .../invalid-syntax/migrated_0092/output.json | 2 +- .../invalid-syntax/migrated_0093/output.json | 6 +- .../invalid-syntax/migrated_0094/output.json | 6 +- .../invalid-syntax/migrated_0098/output.json | 2 +- .../invalid-syntax/migrated_0099/output.json | 4 +- .../invalid-syntax/migrated_0100/output.json | 6 +- .../invalid-syntax/migrated_0101/output.json | 6 +- .../invalid-syntax/migrated_0112/output.json | 2 +- .../invalid-syntax/migrated_0115/output.json | 4 +- .../invalid-syntax/migrated_0116/output.json | 2 +- .../invalid-syntax/migrated_0118/output.json | 2 +- .../invalid-syntax/migrated_0125/output.json | 2 +- .../invalid-syntax/migrated_0126/output.json | 2 +- .../invalid-syntax/migrated_0133/output.json | 2 +- .../invalid-syntax/migrated_0137/output.json | 2 +- .../invalid-syntax/migrated_0138/output.json | 2 +- .../invalid-syntax/migrated_0139/output.json | 2 +- .../invalid-syntax/migrated_0140/output.json | 2 +- .../invalid-syntax/migrated_0141/output.json | 2 +- .../invalid-syntax/migrated_0142/output.json | 2 +- .../invalid-syntax/migrated_0143/output.json | 2 +- .../invalid-syntax/migrated_0145/options.json | 4 +- .../invalid-syntax/migrated_0146/options.json | 4 +- .../invalid-syntax/migrated_0147/options.json | 4 +- .../invalid-syntax/migrated_0148/options.json | 4 +- .../invalid-syntax/migrated_0149/options.json | 4 +- .../invalid-syntax/migrated_0150/options.json | 4 +- .../invalid-syntax/migrated_0157/options.json | 4 +- .../invalid-syntax/migrated_0162/output.json | 2 +- .../invalid-syntax/migrated_0163/output.json | 2 +- .../invalid-syntax/migrated_0164/output.json | 2 +- .../invalid-syntax/migrated_0165/output.json | 2 +- .../invalid-syntax/migrated_0166/output.json | 2 +- .../invalid-syntax/migrated_0167/output.json | 2 +- .../invalid-syntax/migrated_0168/options.json | 4 +- .../invalid-syntax/migrated_0169/options.json | 4 +- .../invalid-syntax/migrated_0171/output.json | 2 +- .../invalid-syntax/migrated_0172/output.json | 2 +- .../invalid-syntax/migrated_0173/output.json | 2 +- .../invalid-syntax/migrated_0174/output.json | 2 +- .../invalid-syntax/migrated_0176/output.json | 2 +- .../invalid-syntax/migrated_0177/output.json | 2 +- .../invalid-syntax/migrated_0178/output.json | 10 +- .../invalid-syntax/migrated_0179/output.json | 10 +- .../invalid-syntax/migrated_0180/output.json | 10 +- .../invalid-syntax/migrated_0181/output.json | 10 +- .../invalid-syntax/migrated_0182/output.json | 2 +- .../invalid-syntax/migrated_0183/output.json | 16 +- .../invalid-syntax/migrated_0184/output.json | 16 +- .../invalid-syntax/migrated_0185/output.json | 6 +- .../invalid-syntax/migrated_0186/output.json | 6 +- .../invalid-syntax/migrated_0187/output.json | 6 +- .../invalid-syntax/migrated_0188/output.json | 6 +- .../invalid-syntax/migrated_0189/output.json | 6 +- .../invalid-syntax/migrated_0190/output.json | 6 +- .../invalid-syntax/migrated_0191/output.json | 6 +- .../invalid-syntax/migrated_0192/output.json | 6 +- .../invalid-syntax/migrated_0193/output.json | 6 +- .../invalid-syntax/migrated_0194/output.json | 6 +- .../invalid-syntax/migrated_0195/output.json | 6 +- .../invalid-syntax/migrated_0196/output.json | 6 +- .../invalid-syntax/migrated_0197/output.json | 6 +- .../invalid-syntax/migrated_0198/output.json | 6 +- .../invalid-syntax/migrated_0199/output.json | 6 +- .../invalid-syntax/migrated_0200/output.json | 6 +- .../invalid-syntax/migrated_0201/output.json | 6 +- .../invalid-syntax/migrated_0202/output.json | 6 +- .../invalid-syntax/migrated_0203/output.json | 16 +- .../invalid-syntax/migrated_0204/output.json | 16 +- .../invalid-syntax/migrated_0205/output.json | 14 +- .../invalid-syntax/migrated_0206/output.json | 14 +- .../invalid-syntax/migrated_0207/output.json | 16 +- .../invalid-syntax/migrated_0208/output.json | 14 +- .../invalid-syntax/migrated_0209/output.json | 16 +- .../invalid-syntax/migrated_0210/output.json | 16 +- .../invalid-syntax/migrated_0211/output.json | 16 +- .../invalid-syntax/migrated_0212/output.json | 6 +- .../invalid-syntax/migrated_0213/output.json | 6 +- .../invalid-syntax/migrated_0214/output.json | 6 +- .../invalid-syntax/migrated_0215/output.json | 6 +- .../invalid-syntax/migrated_0216/output.json | 2 +- .../invalid-syntax/migrated_0217/output.json | 2 +- .../invalid-syntax/migrated_0218/output.json | 6 +- .../invalid-syntax/migrated_0219/output.json | 16 +- .../invalid-syntax/migrated_0220/output.json | 16 +- .../invalid-syntax/migrated_0221/output.json | 2 +- .../invalid-syntax/migrated_0222/output.json | 4 +- .../invalid-syntax/migrated_0223/output.json | 10 +- .../invalid-syntax/migrated_0224/output.json | 6 +- .../invalid-syntax/migrated_0225/output.json | 6 +- .../invalid-syntax/migrated_0226/output.json | 6 +- .../invalid-syntax/migrated_0227/output.json | 6 +- .../invalid-syntax/migrated_0228/output.json | 6 +- .../invalid-syntax/migrated_0229/output.json | 6 +- .../invalid-syntax/migrated_0230/output.json | 6 +- .../invalid-syntax/migrated_0231/output.json | 6 +- .../invalid-syntax/migrated_0232/output.json | 6 +- .../invalid-syntax/migrated_0233/output.json | 6 +- .../invalid-syntax/migrated_0234/output.json | 6 +- .../invalid-syntax/migrated_0235/output.json | 6 +- .../invalid-syntax/migrated_0236/output.json | 6 +- .../invalid-syntax/migrated_0239/output.json | 6 +- .../invalid-syntax/migrated_0240/output.json | 6 +- .../invalid-syntax/migrated_0241/output.json | 6 +- .../invalid-syntax/migrated_0242/output.json | 6 +- .../invalid-syntax/migrated_0243/output.json | 6 +- .../invalid-syntax/migrated_0244/output.json | 14 +- .../invalid-syntax/migrated_0245/output.json | 14 +- .../invalid-syntax/migrated_0246/output.json | 14 +- .../invalid-syntax/migrated_0247/output.json | 14 +- .../invalid-syntax/migrated_0248/output.json | 2 +- .../invalid-syntax/migrated_0249/output.json | 6 +- .../invalid-syntax/migrated_0250/output.json | 2 +- .../invalid-syntax/migrated_0257/output.json | 4 +- .../invalid-syntax/migrated_0258/options.json | 4 +- .../invalid-syntax/migrated_0261/options.json | 4 +- .../invalid-syntax/migrated_0262/options.json | 4 +- .../invalid-syntax/migrated_0263/options.json | 4 +- .../invalid-syntax/migrated_0270/output.json | 2 +- .../invalid-syntax/migrated_0271/output.json | 2 +- .../invalid-syntax/migrated_0272/output.json | 2 +- .../invalid-syntax/migrated_0273/output.json | 2 +- .../invalid-syntax/migrated_0274/output.json | 2 +- .../invalid-syntax/migrated_0277/output.json | 2 +- .../invalid-syntax/migrated_0278/output.json | 2 +- .../invalid-setter-rest/output.json | 2 +- .../migrated_0002/output.json | 2 +- .../migrated_0003/output.json | 2 +- .../migrated_0004/output.json | 2 +- .../migrated_0005/output.json | 2 +- .../complex-pattern-requires-init/output.json | 2 +- .../object-method/invalid-setter/output.json | 2 +- .../typescript/getter-setter/output.json | 4 +- .../failure-name-constructor/output.json | 2 +- .../instance-field-instance-field/output.json | 2 +- .../instance-field-instance-get/output.json | 2 +- .../output.json | 2 +- .../instance-field-instance-set/output.json | 2 +- .../instance-field-static-field/output.json | 2 +- .../instance-field-static-get/output.json | 2 +- .../instance-field-static-method/output.json | 2 +- .../instance-field-static-set/output.json | 2 +- .../instance-get-instance-field/output.json | 2 +- .../instance-get-instance-get/output.json | 2 +- .../instance-get-instance-method/output.json | 2 +- .../instance-get-static-field/output.json | 2 +- .../instance-get-static-get/output.json | 2 +- .../instance-get-static-method/output.json | 2 +- .../instance-get-static-set/output.json | 2 +- .../output.json | 2 +- .../instance-method-instance-get/output.json | 2 +- .../output.json | 2 +- .../instance-method-instance-set/output.json | 2 +- .../instance-method-static-field/output.json | 2 +- .../instance-method-static-get/output.json | 2 +- .../instance-method-static-method/output.json | 2 +- .../instance-method-static-set/output.json | 2 +- .../instance-set-instance-field/output.json | 2 +- .../instance-set-instance-method/output.json | 2 +- .../instance-set-instance-set/output.json | 2 +- .../instance-set-static-field/output.json | 2 +- .../instance-set-static-get/output.json | 2 +- .../instance-set-static-method/output.json | 2 +- .../instance-set-static-set/output.json | 2 +- .../static-field-instance-field/output.json | 2 +- .../static-field-instance-get/output.json | 2 +- .../static-field-instance-method/output.json | 2 +- .../static-field-instance-set/output.json | 2 +- .../static-field-static-field/output.json | 2 +- .../static-field-static-get/output.json | 2 +- .../static-field-static-method/output.json | 2 +- .../static-field-static-set/output.json | 2 +- .../static-get-instance-field/output.json | 2 +- .../static-get-instance-get/output.json | 2 +- .../static-get-instance-method/output.json | 2 +- .../static-get-instance-set/output.json | 2 +- .../static-get-static-field/output.json | 2 +- .../static-get-static-get/output.json | 2 +- .../static-get-static-method/output.json | 2 +- .../static-method-instance-field/output.json | 2 +- .../static-method-instance-get/output.json | 2 +- .../static-method-instance-method/output.json | 2 +- .../static-method-instance-set/output.json | 2 +- .../static-method-static-field/output.json | 2 +- .../static-method-static-get/output.json | 2 +- .../static-method-static-method/output.json | 2 +- .../static-method-static-set/output.json | 2 +- .../static-set-instance-field/output.json | 2 +- .../static-set-instance-get/output.json | 2 +- .../static-set-instance-method/output.json | 2 +- .../static-set-instance-set/output.json | 2 +- .../static-set-static-field/output.json | 2 +- .../static-set-static-method/output.json | 2 +- .../static-set-static-set/output.json | 2 +- .../output.json | 4 +- .../output.json | 6 +- .../failure-name-constructor/output.json | 2 +- .../failure-numeric-literal/options.json | 8 +- .../options.json | 8 +- .../super-call/output.json | 2 +- .../super-private-member-access/output.json | 6 +- .../undeclared-nested/output.json | 6 +- .../undeclared-top-level/output.json | 6 +- .../arguments-in-arrow-function/output.json | 2 +- .../output.json | 2 +- .../class-properties/arguments/output.json | 2 +- .../output.json | 2 +- .../new-target-invalid/output.json | 2 +- .../class-properties/no-ctor-2/output.json | 2 +- .../class-properties/no-ctor/output.json | 2 +- .../no-static-prototype-2/output.json | 2 +- .../no-static-prototype/output.json | 2 +- .../output.json | 2 +- .../class-properties/super-call/output.json | 2 +- .../super-inside-function/output.json | 6 +- .../output.json | 18 +- .../await-binding-in-static-block/output.json | 26 +- .../invalid-arguments/output.json | 2 +- .../invalid-await/output.json | 2 +- .../invalid-break/output.json | 2 +- .../invalid-continue/output.json | 4 +- .../invalid-decorators/output.json | 2 +- .../invalid-legacy-decorators/output.json | 2 +- .../invalid-legacy-octal/output.json | 2 +- .../invalid-return/output.json | 2 +- .../invalid-super-call/output.json | 2 +- .../invalid-yield/output.json | 4 +- .../decimal/invalid-binary/options.json | 2 +- .../decimal/invalid-e/output.json | 2 +- .../decimal/invalid-hexadecimal/options.json | 2 +- .../invalid-non-octal-decimal-int/output.json | 2 +- .../decimal/invalid-octal-legacy/output.json | 2 +- .../decimal/invalid-octal-new/options.json | 2 +- .../output.json | 2 +- .../options.json | 13 +- .../no-class-method-parameter/output.json | 2 +- .../no-function-parameters/output.json | 2 +- .../no-object-method-parameters/output.json | 2 +- .../no-object-methods/output.json | 2 +- .../decorators-2/no-semi/options.json | 12 +- .../decorators-2/restricted-1/options.json | 12 +- .../decorators-2/restricted-2/options.json | 12 +- .../options.json | 2 +- .../no-export-decorators/options.json | 2 +- .../decorators/no-semi/options.json | 9 +- .../invalid-lone-import/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../incorrect-arity/output.json | 4 +- .../invalid-escaped-assert/output.json | 4 +- .../invalid-export-without-from/output.json | 4 +- .../output.json | 2 +- .../output.json | 4 +- .../output.json | 2 +- .../string-literal/output.json | 4 +- .../options.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../options.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../import-with-statement/output.json | 2 +- .../incorrect-arity/output.json | 4 +- .../output.json | 2 +- .../options.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../in-SuperCall/output.json | 8 +- .../partial-application/in-new/output.json | 4 +- .../proposal-fsharp-ban-await-f/output.json | 2 +- .../output.json | 2 +- .../proposal-minimal-ban-await-f/options.json | 13 +- .../proposal-minimal-ban-await/options.json | 13 +- .../output.json | 12 +- .../options.json | 13 +- .../output.json | 10 +- .../output.json | 10 +- .../output.json | 10 +- .../output.json | 10 +- .../output.json | 10 +- .../output.json | 12 +- .../output.json | 12 +- .../output.json | 6 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 4 +- .../output.json | 4 +- .../output.json | 4 +- .../output.json | 4 +- .../output.json | 4 +- .../output.json | 10 +- .../output.json | 4 +- .../output.json | 4 +- .../options.json | 13 +- .../output.json | 8 +- .../output.json | 4 +- .../output.json | 4 +- .../output.json | 2 +- .../output.json | 2 +- .../private-in/private-expression/output.json | 2 +- .../private-in-parenthesized/output.json | 10 +- .../private-in-without-field/output.json | 2 +- .../options.json | 13 +- .../options.json | 13 +- .../options.json | 13 +- .../incorrect-type-tuple-end-bar/options.json | 13 +- .../options.json | 13 +- .../options.json | 13 +- .../invalid-record-method/output.json | 10 +- .../invalid-record-proto/output.json | 2 +- .../invalid-tuple-holes/output.json | 2 +- .../1/output.json | 2 +- .../10/output.json | 2 +- .../11/output.json | 2 +- .../12/output.json | 2 +- .../13/output.json | 2 +- .../14/output.json | 2 +- .../15/output.json | 2 +- .../16/output.json | 2 +- .../17/output.json | 2 +- .../18/output.json | 2 +- .../19/output.json | 2 +- .../2/output.json | 2 +- .../20/output.json | 2 +- .../21/output.json | 2 +- .../22/output.json | 2 +- .../23/output.json | 2 +- .../24/output.json | 2 +- .../25/output.json | 2 +- .../26/output.json | 2 +- .../27/output.json | 2 +- .../28/output.json | 2 +- .../29/output.json | 2 +- .../3/output.json | 2 +- .../30/output.json | 2 +- .../31/output.json | 2 +- .../32/output.json | 2 +- .../33/output.json | 2 +- .../34/output.json | 2 +- .../35/output.json | 2 +- .../36/output.json | 2 +- .../37/output.json | 2 +- .../38/output.json | 2 +- .../39/output.json | 2 +- .../4/output.json | 2 +- .../40/output.json | 2 +- .../41/output.json | 2 +- .../42/output.json | 2 +- .../43/output.json | 2 +- .../44/output.json | 2 +- .../45/output.json | 2 +- .../46/output.json | 2 +- .../47/output.json | 2 +- .../48/output.json | 2 +- .../49/output.json | 2 +- .../5/output.json | 2 +- .../50/output.json | 2 +- .../51/output.json | 2 +- .../52/output.json | 2 +- .../53/output.json | 2 +- .../54/output.json | 2 +- .../55/output.json | 2 +- .../56/output.json | 2 +- .../57/output.json | 2 +- .../58/output.json | 2 +- .../59/output.json | 2 +- .../6/output.json | 2 +- .../60/output.json | 2 +- .../61/output.json | 2 +- .../62/output.json | 2 +- .../63/output.json | 2 +- .../64/output.json | 2 +- .../65/output.json | 2 +- .../66/output.json | 2 +- .../67/output.json | 2 +- .../68/output.json | 2 +- .../7/output.json | 2 +- .../8/output.json | 2 +- .../9/output.json | 2 +- .../top-level-await/inside-arrow/output.json | 2 +- .../inside-class-property/output.json | 2 +- .../inside-function/output.json | 2 +- .../top-level-script/output.json | 2 +- .../uncategorised/41/options.json | 8 +- .../uncategorised/42/options.json | 2 +- .../output.json | 2 +- .../06-type-include-error/options.json | 16 +- .../07-type-include-error/options.json | 16 +- .../08-type-flow-include-error/options.json | 16 +- .../09-type-flow-include-error/options.json | 16 +- .../10-type-annotation-error/options.json | 16 +- .../11-nested-comments-invalid/options.json | 16 +- .../output.json | 12 +- .../options.json | 16 +- .../invalid-declare-export-type/options.json | 9 +- .../invalid-export-const/options.json | 9 +- .../invalid-export-default-var/output.json | 2 +- .../invalid-export-interface/options.json | 9 +- .../invalid-export-let/options.json | 9 +- .../flow/declare-module/8/options.json | 9 +- .../invalid-commonjs-module/output.json | 2 +- .../invalid-es-module/output.json | 2 +- .../declare-module/invalid-import/output.json | 2 +- .../invalid-module-in-module/output.json | 2 +- .../invalid-multiple-commonjs/output.json | 2 +- .../invalid-literal/output.json | 2 +- .../reserved-word-enum-name/output.json | 6 +- .../output.json | 18 +- .../output.json | 18 +- .../output.json | 20 +- .../output.json | 20 +- .../output.json | 18 +- .../output.json | 20 +- .../output.json | 20 +- .../output.json | 18 +- .../output.json | 18 +- .../output.json | 18 +- .../output.json | 18 +- .../output.json | 18 +- .../output.json | 18 +- .../output.json | 18 +- .../extends-reserved-invalid-1/output.json | 18 +- .../extends-reserved-invalid-2/output.json | 18 +- .../assignment-expression/output.json | 2 +- .../binary-expression/output.json | 2 +- .../call-expression/output.json | 2 +- .../class-declaration/output.json | 2 +- .../conditional-expression/output.json | 2 +- .../function-declaration/output.json | 2 +- .../import-statement/output.json | 2 +- .../member-expression/output.json | 2 +- .../new-expression/output.json | 2 +- .../sequence-expression/output.json | 2 +- .../unary-expression/output.json | 2 +- .../variable/output.json | 2 +- .../id-reserved-type-invalid/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../fixtures/flow/iterator/03/output.json | 2 +- .../fixtures/flow/iterator/04/output.json | 2 +- .../fixtures/flow/iterator/05/output.json | 2 +- .../fixtures/flow/iterator/06/output.json | 2 +- .../fixtures/flow/iterator/07/output.json | 2 +- .../fixtures/flow/iterator/08/output.json | 2 +- .../fixtures/flow/iterator/09/output.json | 2 +- .../fixtures/flow/iterator/10/output.json | 2 +- .../fixtures/flow/iterator/11/output.json | 2 +- .../invalid-number-negative/options.json | 9 +- .../multiple-declarations/class/output.json | 2 +- .../interface/output.json | 2 +- .../multiple-declarations/type/output.json | 2 +- .../output.json | 2 +- .../invalid-getter-param-count/output.json | 2 +- .../invalid-setter-param-count/output.json | 2 +- .../invalid-setter-param-type/output.json | 2 +- .../reserved-type-invalid/output.json | 2 +- .../regression/issue-58-failing-1/output.json | 22 +- .../regression/issue-58-failing-2/output.json | 22 +- .../regression/issue-58-failing-3/output.json | 22 +- .../regression/issue-58-failing-4/output.json | 22 +- .../dupl-decl-const-declare-class/output.json | 2 +- .../output.json | 2 +- .../dupl-decl-const-interface/output.json | 2 +- .../dupl-decl-const-opaque-type/output.json | 2 +- .../scope/dupl-decl-const-type/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../dupl-decl-declare-var-let/output.json | 2 +- .../dupl-decl-func-declare-func/output.json | 2 +- .../dupl-decl-interface-interface/output.json | 2 +- .../dupl-decl-let-declare-class/output.json | 2 +- .../output.json | 2 +- .../scope/dupl-decl-let-interface/output.json | 2 +- .../dupl-decl-let-opaque-type/output.json | 2 +- .../flow/scope/dupl-decl-let-type/output.json | 2 +- .../dupl-decl-opaque-type-const/output.json | 2 +- .../dupl-decl-opaque-type-let/output.json | 2 +- .../output.json | 2 +- .../dupl-decl-opaque-type-type/output.json | 2 +- .../dupl-decl-opaque-type-var/output.json | 2 +- .../scope/dupl-decl-type-const/output.json | 2 +- .../dupl-decl-type-interface/output.json | 2 +- .../flow/scope/dupl-decl-type-let/output.json | 2 +- .../dupl-decl-type-opaque-type/output.json | 2 +- .../scope/dupl-decl-type-type/output.json | 2 +- .../flow/scope/dupl-decl-type-var/output.json | 2 +- .../output.json | 2 +- .../scope/dupl-decl-var-interface/output.json | 2 +- .../dupl-decl-var-opaque-type/output.json | 2 +- .../flow/scope/dupl-decl-var-type/output.json | 2 +- .../this-arrow-function/output.json | 2 +- .../this-annotation/this-getter/output.json | 2 +- .../this-setter-type/output.json | 2 +- .../flow/type-annotations/131/output.json | 2 +- .../flow/type-annotations/132/output.json | 2 +- .../flow/type-annotations/133/output.json | 2 +- .../flow/type-annotations/134/output.json | 2 +- .../flow/type-annotations/137/output.json | 2 +- .../flow/type-annotations/139/output.json | 2 +- .../typeof-reserved-invalid-2/output.json | 18 +- .../typeof-reserved-invalid-3/output.json | 18 +- .../typeof-reserved-invalid-4/output.json | 18 +- .../typeof-reserved-invalid-6/output.json | 18 +- .../with-default-invalid/output.json | 2 +- .../async-arrow-invalid/output.json | 4 +- .../invalid-import-type-2/output.json | 2 +- .../invalid-import-type-3/output.json | 2 +- .../invalid-import-type-4/output.json | 2 +- .../invalid-import-type-as/output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../invalid-import-type-shorthand/output.json | 2 +- .../invalid-import-type/output.json | 2 +- .../arrow_error_with_jsx/options.json | 10 +- .../arrow_error_without_jsx/options.json | 9 +- .../output.json | 2 +- .../output.json | 18 +- .../output.json | 18 +- .../output.json | 20 +- .../fail-in-calls-with-one-arg/output.json | 2 +- .../flow/typecasts/fail-in-calls/output.json | 2 +- .../fail-in-optional-calls/output.json | 2 +- .../typecasts/fail-without-parens/output.json | 12 +- .../fails-in-array-expression-1/output.json | 2 +- .../fails-in-array-expression-2/output.json | 12 +- .../fails-in-array-expression-3/output.json | 12 +- .../fails-in-array-expression-4/output.json | 2 +- .../fails-in-array-expression-5/output.json | 2 +- .../options.json | 8 +- .../generic-arrow-func-invalid/options.json | 8 +- .../options.json | 8 +- .../attribute-empty-expression/output.json | 2 +- .../jsx/errors/unclosed-tag/options.json | 8 +- .../errors/unterminated-string/options.json | 8 +- .../wrong-closing-tag-fragment/output.json | 2 +- .../jsx/errors/wrong-closing-tag/output.json | 2 +- .../wrong-opening-tag-fragment/output.json | 2 +- .../variable/let-context-3/output.json | 2 +- .../output.json | 2 +- .../parenthesized-object-assign/output.json | 2 +- .../output.json | 4 +- .../output.json | 2 +- .../class/declare-method/output.json | 2 +- .../declare-new-line-abstract/output.json | 2 +- .../class/duplicate-modifier-1/output.json | 2 +- .../class/duplicate-modifier-2/output.json | 2 +- .../class/method-readonly/output.json | 2 +- .../modifiers-index-signatures/output.json | 10 +- .../output.json | 2 +- .../output.json | 2 +- .../output.json | 2 +- .../import/export-import-type/output.json | 2 +- .../typescript/import/type-equals/output.json | 4 +- .../interface/declare-new-line/output.json | 2 +- .../invalid-abstract-interface/output.json | 4 +- .../interface/new-line-error/output.json | 2 +- .../module-declare-new-line/output.json | 2 +- .../module-new-line-error/output.json | 2 +- .../namespace-declare-new-line/output.json | 2 +- .../namespace-new-line-error/output.json | 2 +- .../top-level-await/output.json | 2 +- .../redeclaration-class-class/output.json | 2 +- .../redeclaration-class-enum/output.json | 2 +- .../redeclaration-class-type/output.json | 2 +- .../redeclaration-constenum-enum/output.json | 2 +- .../redeclaration-enum-class/output.json | 2 +- .../redeclaration-enum-constenum/output.json | 2 +- .../redeclaration-enum-function/output.json | 2 +- .../redeclaration-enum-interface/output.json | 2 +- .../scope/redeclaration-enum-let/output.json | 2 +- .../scope/redeclaration-enum-type/output.json | 2 +- .../scope/redeclaration-enum-var/output.json | 2 +- .../redeclaration-function-enum/output.json | 2 +- .../redeclaration-interface-enum/output.json | 2 +- .../scope/redeclaration-let-enum/output.json | 2 +- .../redeclaration-type-class/output.json | 2 +- .../scope/redeclaration-type-enum/output.json | 2 +- .../redeclaration-type-interface/output.json | 2 +- .../scope/redeclaration-type-type/output.json | 2 +- .../scope/redeclaration-var-enum/output.json | 2 +- .../type-alias/declare-new-line/output.json | 2 +- .../import-type-dynamic-errors/output.json | 6 +- .../types/intrinsic-keyword-error/output.json | 2 +- .../options.json | 2 +- .../top-level-await/unsupported/options.json | 2 +- .../flow-compat/js-invalid/options.json | 2 +- 1398 files changed, 3596 insertions(+), 3312 deletions(-) create mode 100644 eslint/babel-eslint-plugin-development-internal/src/rules/report-error-message-format.js create mode 100644 eslint/babel-eslint-plugin-development-internal/test/rules/report-error-message-formtat.js diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ca286559d9c9..e0dbbb883fed 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -109,6 +109,7 @@ module.exports = { ), }, ], + "@babel/development-internal/report-error-message-format": "error", }, }, { diff --git a/eslint/babel-eslint-plugin-development-internal/README.md b/eslint/babel-eslint-plugin-development-internal/README.md index b412c36013d8..2d8fa5e626ac 100644 --- a/eslint/babel-eslint-plugin-development-internal/README.md +++ b/eslint/babel-eslint-plugin-development-internal/README.md @@ -68,3 +68,42 @@ and } } ``` + +### `@babel/development-internal/report-error-message-format` + +This rule is inspired by https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/report-message-format.md. + +Intended for use in `packages/babel-parser/src/**/*`. When enabled, this rule warns for inconsistently error messages format in arguments of `makeErrorTemplates` function calls. + +Basically, it starts with an uppercase Latin letter(A~Z) and ends with a period(.) or a question(?). But it can start with `'keyword'` or `` `code` `` to include JavaScript keywords or code in error messages. + +valid: + +```js +makeErrorTemplates({ ThisIsAnError: "This is an error." }); +makeErrorTemplates({ ThisIsAnError: "'this' is an error." }); +makeErrorTemplates({ ThisIsAnError: "`this` is an error." }); +makeErrorTemplates({ ThisIsAnError: "This is an error?" }); +makeErrorTemplates({ ThisIsAnError: "'this' is an error?" }); +makeErrorTemplates({ ThisIsAnError: "`this` is an error?" }); +``` + +invalid: + +```js +makeErrorTemplates({ ThisIsAnError: 'this is an error.' }); +makeErrorTemplates({ ThisIsAnError: 'This is an error' }); +makeErrorTemplates({ ThisIsAnError: 'this is an error?' }); +makeErrorTemplates({ ThisIsAnError: '`this` is an error' }); +makeErrorTemplates({ ThisIsAnError: "'this' is an error" }); +``` + +Example configuration: + +```js +{ + rules: { + "@babel/development-internal/report-error-message-format": "error" + } +} +``` diff --git a/eslint/babel-eslint-plugin-development-internal/src/index.js b/eslint/babel-eslint-plugin-development-internal/src/index.js index 41efa01891c5..b64e280d2378 100644 --- a/eslint/babel-eslint-plugin-development-internal/src/index.js +++ b/eslint/babel-eslint-plugin-development-internal/src/index.js @@ -1,7 +1,9 @@ import dryErrorMessages from "./rules/dry-error-messages"; +import reportErrorMessageFormat from "./rules/report-error-message-format"; export const rules = { "dry-error-messages": dryErrorMessages, + "report-error-message-format": reportErrorMessageFormat, }; export default { rules }; diff --git a/eslint/babel-eslint-plugin-development-internal/src/rules/report-error-message-format.js b/eslint/babel-eslint-plugin-development-internal/src/rules/report-error-message-format.js new file mode 100644 index 000000000000..344c8f1e11d7 --- /dev/null +++ b/eslint/babel-eslint-plugin-development-internal/src/rules/report-error-message-format.js @@ -0,0 +1,31 @@ +const messageId = "mustMatchPattern"; + +const pattern = /(('.*')|(`.*`)|[A-Z]).*(\.|\?)$/s; + +export default { + meta: { + type: "suggestion", + docs: { + description: "enforce @babel/parser's error message formatting.", + }, + messages: { + [messageId]: `Report message does not match the pattern ${pattern.toString()}.`, + }, + }, + create({ report }) { + return { + "CallExpression[callee.type='Identifier'][callee.name='makeErrorTemplates'] > ObjectExpression > Property[value.type='Literal']"( + node, + ) { + const { value } = node; + if (typeof value.value === "string" && pattern.test(value.value)) { + return; + } + report({ + node: value, + messageId, + }); + }, + }; + }, +}; diff --git a/eslint/babel-eslint-plugin-development-internal/test/rules/report-error-message-formtat.js b/eslint/babel-eslint-plugin-development-internal/test/rules/report-error-message-formtat.js new file mode 100644 index 000000000000..453eba7462d9 --- /dev/null +++ b/eslint/babel-eslint-plugin-development-internal/test/rules/report-error-message-formtat.js @@ -0,0 +1,44 @@ +import RuleTester from "../../../babel-eslint-shared-fixtures/utils/RuleTester"; +import rule from "../../src/rules/report-error-message-format"; + +const ruleTester = new RuleTester(); + +ruleTester.run("report-error-message-format", rule, { + valid: [ + "makeErrorTemplates({});", + 'makeErrorTemplates({ ThisIsAnError: "This is an error." });', + `makeErrorTemplates({ ThisIsAnError: "'this' is an error." });`, + `makeErrorTemplates({ ThisIsAnError: "\`this\` is an error." });`, + `makeErrorTemplates({ ThisIsAnError: "This is an error?" });`, + `makeErrorTemplates({ ThisIsAnError: "'this' is an error?" });`, + `makeErrorTemplates({ ThisIsAnError: "\`this\` is an error?" });`, + 'makeErrorTemplates({ ThisIsAnError: "This is\\nan error." });', + `makeErrorTemplates({ ThisIsAnError: "'this' is\\nan error." });`, + `makeErrorTemplates({ ThisIsAnError: "\`this\` is\\nan error." });`, + `makeErrorTemplates({ ThisIsAnError: "This is\\nan error?" });`, + `makeErrorTemplates({ ThisIsAnError: "'this' is\\nan error?" });`, + `makeErrorTemplates({ ThisIsAnError: "\`this\` is\\nan error?" });`, + ], + invalid: [ + { + code: "makeErrorTemplates({ ThisIsAnError: 'this is an error.' });", + errors: [{ messageId: "mustMatchPattern" }], + }, + { + code: "makeErrorTemplates({ ThisIsAnError: 'This is an error' });", + errors: [{ messageId: "mustMatchPattern" }], + }, + { + code: "makeErrorTemplates({ ThisIsAnError: 'this is an error?' });", + errors: [{ messageId: "mustMatchPattern" }], + }, + { + code: "makeErrorTemplates({ ThisIsAnError: '`this` is an error' });", + errors: [{ messageId: "mustMatchPattern" }], + }, + { + code: `makeErrorTemplates({ ThisIsAnError: "'this' is an error" });`, + errors: [{ messageId: "mustMatchPattern" }], + }, + ], +}); diff --git a/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stderr.txt b/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stderr.txt index b4566e9fe6c5..453c8d3ebba6 100644 --- a/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stderr.txt +++ b/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stderr.txt @@ -1 +1 @@ -SyntaxError: \test.js: Missing semicolon (2:10) +SyntaxError: \test.js: Missing semicolon. (2:10) diff --git a/packages/babel-cli/test/fixtures/babel/stdin --filename/stderr.txt b/packages/babel-cli/test/fixtures/babel/stdin --filename/stderr.txt index a2d342315741..8087b6e97852 100644 --- a/packages/babel-cli/test/fixtures/babel/stdin --filename/stderr.txt +++ b/packages/babel-cli/test/fixtures/babel/stdin --filename/stderr.txt @@ -1 +1 @@ -SyntaxError: /test.js: Missing semicolon (2:10) +SyntaxError: /test.js: Missing semicolon. (2:10) diff --git a/packages/babel-core/test/fixtures/transformation/errors/syntax/options.json b/packages/babel-core/test/fixtures/transformation/errors/syntax/options.json index 937e44f2f467..f0cca2940fdc 100644 --- a/packages/babel-core/test/fixtures/transformation/errors/syntax/options.json +++ b/packages/babel-core/test/fixtures/transformation/errors/syntax/options.json @@ -1,3 +1,3 @@ { - "throws": "Missing semicolon (2:10)" + "throws": "Missing semicolon. (2:10)" } diff --git a/packages/babel-parser/src/parser/error-message.js b/packages/babel-parser/src/parser/error-message.js index dd582890d4ab..eba5a60cb2fe 100644 --- a/packages/babel-parser/src/parser/error-message.js +++ b/packages/babel-parser/src/parser/error-message.js @@ -11,217 +11,218 @@ import { makeErrorTemplates, ErrorCodes } from "./error"; // The Errors key follows https://cs.chromium.org/chromium/src/v8/src/common/message-template.h unless it does not exist export const ErrorMessages = makeErrorTemplates( { - AccessorIsGenerator: "A %0ter cannot be a generator", + AccessorIsGenerator: "A %0ter cannot be a generator.", ArgumentsInClass: - "'arguments' is only allowed in functions and class methods", + "'arguments' is only allowed in functions and class methods.", AsyncFunctionInSingleStatementContext: - "Async functions can only be declared at the top level or inside a block", + "Async functions can only be declared at the top level or inside a block.", AwaitBindingIdentifier: - "Can not use 'await' as identifier inside an async function", + "Can not use 'await' as identifier inside an async function.", AwaitBindingIdentifierInStaticBlock: - "Can not use 'await' as identifier inside a static block", + "Can not use 'await' as identifier inside a static block.", AwaitExpressionFormalParameter: - "await is not allowed in async function parameters", + "'await' is not allowed in async function parameters.", AwaitNotInAsyncContext: - "'await' is only allowed within async functions and at the top levels of modules", - AwaitNotInAsyncFunction: "'await' is only allowed within async functions", - BadGetterArity: "getter must not have any formal parameters", - BadSetterArity: "setter must have exactly one formal parameter", + "'await' is only allowed within async functions and at the top levels of modules.", + AwaitNotInAsyncFunction: "'await' is only allowed within async functions.", + BadGetterArity: "A 'get' accesor must not have any formal parameters.", + BadSetterArity: "A 'set' accesor must have exactly one formal parameter.", BadSetterRestParameter: - "setter function argument must not be a rest parameter", - ConstructorClassField: "Classes may not have a field named 'constructor'", + "A 'set' accesor function argument must not be a rest parameter.", + ConstructorClassField: "Classes may not have a field named 'constructor'.", ConstructorClassPrivateField: - "Classes may not have a private field named '#constructor'", - 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", + "Classes may not have a private field named '#constructor'.", + 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.", DecoratorBeforeExport: - "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax", + "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax.", DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?", DecoratorExportClass: "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead.", - DecoratorSemicolon: "Decorators must not be followed by a semicolon", - DecoratorStaticBlock: "Decorators can't be used with a static block", - DeletePrivateField: "Deleting a private field is not allowed", + DecoratorSemicolon: "Decorators must not be followed by a semicolon.", + DecoratorStaticBlock: "Decorators can't be used with a static block.", + DeletePrivateField: "Deleting a private field is not allowed.", DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", - DuplicateConstructor: "Duplicate constructor in the same class", + DuplicateConstructor: "Duplicate constructor in the same class.", DuplicateDefaultExport: "Only one default export allowed per module.", DuplicateExport: "`%0` has already been exported. Exported identifiers must be unique.", - DuplicateProto: "Redefinition of __proto__ property", - DuplicateRegExpFlags: "Duplicate regular expression flag", - ElementAfterRest: "Rest element must be last element", - EscapedCharNotAnIdentifier: "Invalid Unicode escape", + DuplicateProto: "Redefinition of __proto__ property.", + DuplicateRegExpFlags: "Duplicate regular expression flag.", + ElementAfterRest: "Rest element must be last element.", + EscapedCharNotAnIdentifier: "Invalid Unicode escape.", ExportBindingIsString: "A string literal cannot be used as an exported binding without `from`.\n- Did you mean `export { '%0' as '%1' } from 'some-module'`?", ExportDefaultFromAsIdentifier: - "'from' is not allowed as an identifier after 'export default'", + "'from' is not allowed as an identifier after 'export default'.", ForInOfLoopInitializer: - "%0 loop variable declaration may not have an initializer", + "'%0' loop variable declaration may not have an initializer.", ForOfLet: "The left-hand side of a for-of loop may not start with 'let'.", GeneratorInSingleStatementContext: - "Generators can only be declared at the top level or inside a block", - IllegalBreakContinue: "Unsyntactic %0", + "Generators can only be declared at the top level or inside a block.", + IllegalBreakContinue: "Unsyntactic %0.", IllegalLanguageModeDirective: - "Illegal 'use strict' directive in function with non-simple parameter list", - IllegalReturn: "'return' outside of function", + "Illegal 'use strict' directive in function with non-simple parameter list.", + IllegalReturn: "'return' outside of function.", ImportBindingIsString: 'A string literal cannot be used as an imported binding.\n- Did you mean `import { "%0" as foo }`?', ImportCallArgumentTrailingComma: - "Trailing comma is disallowed inside import(...) arguments", - ImportCallArity: "import() requires exactly %0", - ImportCallNotNewExpression: "Cannot use new with import(...)", - ImportCallSpreadArgument: "... is not allowed in import()", - InvalidBigIntLiteral: "Invalid BigIntLiteral", - InvalidCodePoint: "Code point out of bounds", - InvalidDecimal: "Invalid decimal", - InvalidDigit: "Expected number in radix %0", - InvalidEscapeSequence: "Bad character escape sequence", - InvalidEscapeSequenceTemplate: "Invalid escape sequence in template", - InvalidEscapedReservedWord: "Escape sequence in keyword %0", - InvalidIdentifier: "Invalid identifier %0", - InvalidLhs: "Invalid left-hand side in %0", - InvalidLhsBinding: "Binding invalid left-hand side in %0", - InvalidNumber: "Invalid number", + "Trailing comma is disallowed inside import(...) arguments.", + ImportCallArity: "`import()` requires exactly %0.", + ImportCallNotNewExpression: "Cannot use new with import(...).", + ImportCallSpreadArgument: "`...` is not allowed in `import()`.", + InvalidBigIntLiteral: "Invalid BigIntLiteral.", + InvalidCodePoint: "Code point out of bounds.", + InvalidDecimal: "Invalid decimal.", + InvalidDigit: "Expected number in radix %0.", + InvalidEscapeSequence: "Bad character escape sequence.", + InvalidEscapeSequenceTemplate: "Invalid escape sequence in template.", + InvalidEscapedReservedWord: "Escape sequence in keyword %0.", + InvalidIdentifier: "Invalid identifier %0.", + InvalidLhs: "Invalid left-hand side in %0.", + InvalidLhsBinding: "Binding invalid left-hand side in %0.", + InvalidNumber: "Invalid number.", InvalidOrMissingExponent: - "Floating-point numbers require a valid exponent after the 'e'", - InvalidOrUnexpectedToken: "Unexpected character '%0'", - InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern", - InvalidPrivateFieldResolution: "Private name #%0 is not defined", - InvalidPropertyBindingPattern: "Binding member expression", + "Floating-point numbers require a valid exponent after the 'e'.", + InvalidOrUnexpectedToken: "Unexpected character '%0'.", + InvalidParenthesizedAssignment: "Invalid parenthesized assignment pattern.", + InvalidPrivateFieldResolution: "Private name #%0 is not defined.", + InvalidPropertyBindingPattern: "Binding member expression.", InvalidRecordProperty: - "Only properties and spread elements are allowed in record definitions", - InvalidRestAssignmentPattern: "Invalid rest operator's argument", - LabelRedeclaration: "Label '%0' is already declared", + "Only properties and spread elements are allowed in record definitions.", + InvalidRestAssignmentPattern: "Invalid rest operator's argument.", + LabelRedeclaration: "Label '%0' is already declared.", LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", - LineTerminatorBeforeArrow: "No line break is allowed before '=>'", - MalformedRegExpFlags: "Invalid regular expression flag", - MissingClassName: "A class name is required", + LineTerminatorBeforeArrow: "No line break is allowed before '=>'.", + MalformedRegExpFlags: "Invalid regular expression flag.", + MissingClassName: "A class name is required.", MissingEqInAssignment: "Only '=' operator can be used for specifying default value.", - MissingSemicolon: "Missing semicolon", - MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX", + MissingSemicolon: "Missing semicolon.", + MissingUnicodeEscape: "Expecting Unicode escape sequence \\uXXXX.", MixingCoalesceWithLogical: - "Nullish coalescing operator(??) requires parens when mixing with logical operators", + "Nullish coalescing operator(??) requires parens when mixing with logical operators.", ModuleAttributeDifferentFromType: - "The only accepted module attribute is `type`", + "The only accepted module attribute is `type`.", ModuleAttributeInvalidValue: - "Only string literals are allowed as module attribute values", + "Only string literals are allowed as module attribute values.", ModuleAttributesWithDuplicateKeys: - 'Duplicate key "%0" is not allowed in module attributes', + 'Duplicate key "%0" is not allowed in module attributes.', ModuleExportNameHasLoneSurrogate: - "An export name cannot include a lone surrogate, found '\\u%0'", - ModuleExportUndefined: "Export '%0' is not defined", - MultipleDefaultsInSwitch: "Multiple default clauses", - NewlineAfterThrow: "Illegal newline after throw", - NoCatchOrFinally: "Missing catch or finally clause", - NumberIdentifier: "Identifier directly after number", + "An export name cannot include a lone surrogate, found '\\u%0'.", + ModuleExportUndefined: "Export '%0' is not defined.", + MultipleDefaultsInSwitch: "Multiple default clauses.", + NewlineAfterThrow: "Illegal newline after throw.", + NoCatchOrFinally: "Missing catch or finally clause.", + NumberIdentifier: "Identifier directly after number.", NumericSeparatorInEscapeSequence: - "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences", + "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.", ObsoleteAwaitStar: - "await* has been removed from the async functions proposal. Use Promise.all() instead.", + "'await*' has been removed from the async functions proposal. Use Promise.all() instead.", OptionalChainingNoNew: - "constructors in/after an Optional Chain are not allowed", + "Constructors in/after an Optional Chain are not allowed.", OptionalChainingNoTemplate: - "Tagged Template Literals are not allowed in optionalChain", + "Tagged Template Literals are not allowed in optionalChain.", OverrideOnConstructor: "'override' modifier cannot appear on a constructor declaration.", - ParamDupe: "Argument name clash", - PatternHasAccessor: "Object pattern can't contain getter or setter", - PatternHasMethod: "Object pattern can't contain methods", + ParamDupe: "Argument name clash.", + PatternHasAccessor: "Object pattern can't contain getter or setter.", + PatternHasMethod: "Object pattern can't contain methods.", PipelineBodyNoArrow: - 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized', + 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.', PipelineBodySequenceExpression: - "Pipeline body may not be a comma-separated sequence expression", + "Pipeline body may not be a comma-separated sequence expression.", PipelineHeadSequenceExpression: - "Pipeline head should not be a comma-separated sequence expression", + "Pipeline head should not be a comma-separated sequence expression.", PipelineTopicUnused: - "Pipeline is in topic style but does not use topic reference", + "Pipeline is in topic style but does not use topic reference.", PrimaryTopicNotAllowed: - "Topic reference was used in a lexical context without topic binding", + "Topic reference was used in a lexical context without topic binding.", PrimaryTopicRequiresSmartPipeline: "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.", PrivateInExpectedIn: - "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)", - PrivateNameRedeclaration: "Duplicate private name #%0", + "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`).", + PrivateNameRedeclaration: "Duplicate private name #%0.", RecordExpressionBarIncorrectEndSyntaxType: - "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", + "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionBarIncorrectStartSyntaxType: - "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", + "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", RecordExpressionHashIncorrectStartSyntaxType: - "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'", - RecordNoProto: "'__proto__' is not allowed in Record expressions", - RestTrailingComma: "Unexpected trailing comma after rest element", + "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", + RecordNoProto: "'__proto__' is not allowed in Record expressions.", + RestTrailingComma: "Unexpected trailing comma after rest element.", SloppyFunction: - "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement", - StaticPrototype: "Classes may not have static property named prototype", - StrictDelete: "Deleting local variable in strict mode", - StrictEvalArguments: "Assigning to '%0' in strict mode", - StrictEvalArgumentsBinding: "Binding '%0' in strict mode", + "In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.", + StaticPrototype: "Classes may not have static property named prototype.", + StrictDelete: "Deleting local variable in strict mode.", + StrictEvalArguments: "Assigning to '%0' in strict mode.", + StrictEvalArgumentsBinding: "Binding '%0' in strict mode.", StrictFunction: - "In strict mode code, functions can only be declared at top level or inside a block", + "In strict mode code, functions can only be declared at top level or inside a block.", StrictNumericEscape: - "The only valid numeric escape in strict mode is '\\0'", - StrictOctalLiteral: "Legacy octal literals are not allowed in strict mode", - StrictWith: "'with' in strict mode", + "The only valid numeric escape in strict mode is '\\0'.", + 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", - TrailingDecorator: "Decorators must be attached to a class element", + "`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.", + 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'", + "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionBarIncorrectStartSyntaxType: - "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'", + "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.", TupleExpressionHashIncorrectStartSyntaxType: - "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'", - UnexpectedArgumentPlaceholder: "Unexpected argument placeholder", + "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.", + UnexpectedArgumentPlaceholder: "Unexpected argument placeholder.", UnexpectedAwaitAfterPipelineBody: - 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal', - UnexpectedDigitAfterHash: "Unexpected digit after hash token", + 'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.', + UnexpectedDigitAfterHash: "Unexpected digit after hash token.", UnexpectedImportExport: - "'import' and 'export' may only appear at the top level", - UnexpectedKeyword: "Unexpected keyword '%0'", + "'import' and 'export' may only appear at the top level.", + UnexpectedKeyword: "Unexpected keyword '%0'.", UnexpectedLeadingDecorator: - "Leading decorators must be attached to a class declaration", + "Leading decorators must be attached to a class declaration.", UnexpectedLexicalDeclaration: - "Lexical declaration cannot appear in a single-statement context", - UnexpectedNewTarget: "new.target can only be used in functions", + "Lexical declaration cannot appear in a single-statement context.", + UnexpectedNewTarget: "`new.target` can only be used in functions.", UnexpectedNumericSeparator: - "A numeric separator is only allowed between two digits", + "A numeric separator is only allowed between two digits.", UnexpectedPrivateField: "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).", - UnexpectedReservedWord: "Unexpected reserved word '%0'", - UnexpectedSuper: "super is only allowed in object methods and classes", - UnexpectedToken: "Unexpected token '%0'", + UnexpectedReservedWord: "Unexpected reserved word '%0'.", + UnexpectedSuper: "'super' is only allowed in object methods and classes.", + UnexpectedToken: "Unexpected token '%0'.", UnexpectedTokenUnaryExponentiation: "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.", UnsupportedBind: "Binding should be performed on object property.", UnsupportedDecoratorExport: - "A decorated export must export a class declaration", + "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", + UnsupportedImport: + "`import` can only be used in `import()` or `import.meta`.", + UnsupportedMetaProperty: "The only valid meta property for %0 is %0.%1.", UnsupportedParameterDecorator: - "Decorators cannot be used to decorate parameters", + "Decorators cannot be used to decorate parameters.", UnsupportedPropertyDecorator: - "Decorators cannot be used to decorate object literal properties", + "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", - UnterminatedRegExp: "Unterminated regular expression", - UnterminatedString: "Unterminated string constant", - UnterminatedTemplate: "Unterminated template", - VarRedeclaration: "Identifier '%0' has already been declared", + "'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.", + UnterminatedRegExp: "Unterminated regular expression.", + UnterminatedString: "Unterminated string constant.", + UnterminatedTemplate: "Unterminated template.", + VarRedeclaration: "Identifier '%0' has already been declared.", YieldBindingIdentifier: - "Can not use 'yield' as identifier inside a generator", - YieldInParameter: "Yield expression is not allowed in formal parameters", + "Can not use 'yield' as identifier inside a generator.", + YieldInParameter: "Yield expression is not allowed in formal parameters.", ZeroDigitNumericSeparator: - "Numeric separator can not be used after leading 0", + "Numeric separator can not be used after leading 0.", }, /* code */ ErrorCodes.SyntaxError, ); diff --git a/packages/babel-parser/src/plugins/flow/index.js b/packages/babel-parser/src/plugins/flow/index.js index b94cc482cb11..572613068c74 100644 --- a/packages/babel-parser/src/plugins/flow/index.js +++ b/packages/babel-parser/src/plugins/flow/index.js @@ -53,14 +53,14 @@ const FlowErrors = makeErrorTemplates( AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.", AmbiguousDeclareModuleKind: - "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module", - AssignReservedType: "Cannot overwrite reserved type %0", + "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.", + AssignReservedType: "Cannot overwrite reserved type %0.", DeclareClassElement: "The `declare` modifier can only appear on class fields.", DeclareClassFieldInitializer: "Initializers are not allowed in fields with the `declare` modifier.", DuplicateDeclareModuleExports: - "Duplicate `declare module.exports` statement", + "Duplicate `declare module.exports` statement.", EnumBooleanMemberNotInitialized: "Boolean enum members need to be initialized. Use either `%0 = true,` or `%0 = false,` in enum `%1`.", EnumDuplicateMemberName: @@ -85,23 +85,24 @@ const FlowErrors = makeErrorTemplates( "String enum members need to consistently either all use initializers, or use no initializers, in enum `%0`.", GetterMayNotHaveThisParam: "A getter cannot have a `this` parameter.", ImportTypeShorthandOnlyInPureImport: - "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements", + "The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.", InexactInsideExact: - "Explicit inexact syntax cannot appear inside an explicit exact object type", + "Explicit inexact syntax cannot appear inside an explicit exact object type.", InexactInsideNonObject: - "Explicit inexact syntax cannot appear in class or interface definitions", - InexactVariance: "Explicit inexact syntax cannot have variance", + "Explicit inexact syntax cannot appear in class or interface definitions.", + InexactVariance: "Explicit inexact syntax cannot have variance.", InvalidNonTypeImportInDeclareModule: - "Imports within a `declare module` body must always be `import type` or `import typeof`", + "Imports within a `declare module` body must always be `import type` or `import typeof`.", MissingTypeParamDefault: "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", NestedDeclareModule: - "`declare module` cannot be used inside another `declare module`", - NestedFlowComment: "Cannot have a flow comment inside another flow comment", + "`declare module` cannot be used inside another `declare module`.", + NestedFlowComment: + "Cannot have a flow comment inside another flow comment.", OptionalBindingPattern: "A binding pattern parameter cannot be optional in an implementation signature.", SetterMayNotHaveThisParam: "A setter cannot have a `this` parameter.", - SpreadVariance: "Spread properties cannot have variance", + SpreadVariance: "Spread properties cannot have variance.", ThisParamAnnotationRequired: "A type annotation is required for the `this` parameter.", ThisParamBannedInConstructor: @@ -111,29 +112,29 @@ const FlowErrors = makeErrorTemplates( "The `this` parameter must be the first function parameter.", ThisParamNoDefault: "The `this` parameter may not have a default value.", TypeBeforeInitializer: - "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", + "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeCastInPattern: - "The type cast expression is expected to be wrapped with parenthesis", + "The type cast expression is expected to be wrapped with parenthesis.", UnexpectedExplicitInexactInObject: - "Explicit inexact syntax must appear at the end of an inexact object", - UnexpectedReservedType: "Unexpected reserved type %0", + "Explicit inexact syntax must appear at the end of an inexact object.", + UnexpectedReservedType: "Unexpected reserved type %0.", UnexpectedReservedUnderscore: - "`_` is only allowed as a type argument to call or new", + "`_` is only allowed as a type argument to call or new.", UnexpectedSpaceBetweenModuloChecks: "Spaces between `%` and `checks` are not allowed here.", UnexpectedSpreadType: - "Spread operator cannot appear in class or interface definitions", + "Spread operator cannot appear in class or interface definitions.", UnexpectedSubtractionOperand: - 'Unexpected token, expected "number" or "bigint"', + 'Unexpected token, expected "number" or "bigint".', UnexpectedTokenAfterTypeParameter: - "Expected an arrow function after this type parameter declaration", + "Expected an arrow function after this type parameter declaration.", UnexpectedTypeParameterBeforeAsyncArrowFunction: - "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`", + "Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.", UnsupportedDeclareExportKind: - "`declare export %0` is not supported. Use `%1` instead", + "`declare export %0` is not supported. Use `%1` instead.", UnsupportedStatementInDeclareModule: - "Only declares and type imports are allowed inside declare module", - UnterminatedFlowComment: "Unterminated flow-comment", + "Only declares and type imports are allowed inside declare module.", + UnterminatedFlowComment: "Unterminated flow-comment.", }, /* code */ ErrorCodes.SyntaxError, ); diff --git a/packages/babel-parser/src/plugins/jsx/index.js b/packages/babel-parser/src/plugins/jsx/index.js index 1ee94e4bd802..45da3e7873a2 100644 --- a/packages/babel-parser/src/plugins/jsx/index.js +++ b/packages/babel-parser/src/plugins/jsx/index.js @@ -23,14 +23,15 @@ const DECIMAL_NUMBER = /^\d+$/; const JsxErrors = makeErrorTemplates( { AttributeIsEmpty: - "JSX attributes must only be assigned a non-empty expression", - MissingClosingTagElement: "Expected corresponding JSX closing tag for <%0>", - MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>", + "JSX attributes must only be assigned a non-empty expression.", + MissingClosingTagElement: + "Expected corresponding JSX closing tag for <%0>.", + MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.", UnexpectedSequenceExpression: "Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?", UnsupportedJsxValue: - "JSX value should be either an expression or a quoted JSX text", - UnterminatedJsxContent: "Unterminated JSX contents", + "JSX value should be either an expression or a quoted JSX text.", + UnterminatedJsxContent: "Unterminated JSX contents.", UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?", }, diff --git a/packages/babel-parser/src/plugins/placeholders.js b/packages/babel-parser/src/plugins/placeholders.js index 82f2acf974b7..fc03e77279b9 100644 --- a/packages/babel-parser/src/plugins/placeholders.js +++ b/packages/babel-parser/src/plugins/placeholders.js @@ -50,7 +50,7 @@ type MaybePlaceholder = NodeOf; // | Placeholder const PlaceHolderErrors = makeErrorTemplates( { - ClassNameIsRequired: "A class name is required", + ClassNameIsRequired: "A class name is required.", }, /* code */ ErrorCodes.SyntaxError, ); diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index b5eaef411bcb..4e684b6da0ab 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -70,8 +70,9 @@ const TSErrors = makeErrorTemplates( { AbstractMethodHasImplementation: "Method '%0' cannot have an implementation because it is marked abstract.", - ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier", - ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier", + ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", + ClassMethodHasReadonly: + "Class methods cannot have the 'readonly' modifier.", ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", DeclareAccessor: "'declare' is not allowed in %0ters.", @@ -80,24 +81,24 @@ const TSErrors = makeErrorTemplates( DeclareFunctionHasImplementation: "An implementation cannot be declared in ambient contexts.", DuplicateAccessibilityModifier: "Accessibility modifier already seen.", - DuplicateModifier: "Duplicate modifier: '%0'", + DuplicateModifier: "Duplicate modifier: '%0'.", EmptyHeritageClauseType: "'%0' list cannot be empty.", EmptyTypeArguments: "Type argument list cannot be empty.", EmptyTypeParameters: "Type parameter list cannot be empty.", ExpectedAmbientAfterExportDeclare: "'export declare' must be followed by an ambient declaration.", - ImportAliasHasImportType: "An import alias can not use 'import type'", + ImportAliasHasImportType: "An import alias can not use 'import type'.", IncompatibleModifiers: "'%0' modifier cannot be used with '%1' modifier.", IndexSignatureHasAbstract: - "Index signatures cannot have the 'abstract' modifier", + "Index signatures cannot have the 'abstract' modifier.", IndexSignatureHasAccessibility: - "Index signatures cannot have an accessibility modifier ('%0')", + "Index signatures cannot have an accessibility modifier ('%0').", IndexSignatureHasDeclare: - "Index signatures cannot have the 'declare' modifier", + "Index signatures cannot have the 'declare' modifier.", IndexSignatureHasOverride: "'override' modifier cannot appear on an index signature.", IndexSignatureHasStatic: - "Index signatures cannot have the 'static' modifier", + "Index signatures cannot have the 'static' modifier.", InvalidModifierOnTypeMember: "'%0' modifier cannot appear on a type member.", InvalidModifiersOrder: "'%0' modifier must precede '%1' modifier.", @@ -118,11 +119,11 @@ const TSErrors = makeErrorTemplates( PrivateElementHasAbstract: "Private elements cannot have the 'abstract' modifier.", PrivateElementHasAccessibility: - "Private elements cannot have an accessibility modifier ('%0')", + "Private elements cannot have an accessibility modifier ('%0').", ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", TypeAnnotationAfterAssign: - "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`", + "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", UnexpectedParameterModifier: @@ -133,11 +134,11 @@ const TSErrors = makeErrorTemplates( UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: - "Argument in a type import must be a string literal", + "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: - "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0", + "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got %0.", }, /* code */ ErrorCodes.SyntaxError, ); diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json index bed17cab3909..02bdc2650e92 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json @@ -1,66 +1,21 @@ { "type": "FunctionExpression", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "left": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "right": { "type": "StringLiteral", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "extra": { "rawValue": "default", "raw": "\"default\"" @@ -71,58 +26,25 @@ ], "body": { "type": "BlockStatement", - "start": 25, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":25,"end":40,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":40}}, "body": [], "directives": [ { "type": "Directive", - "start": 26, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}}, "value": { "type": "DirectiveLiteral", - "start": 26, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 38 - } - }, - "value": "use strict", + "start":26,"end":38,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":38}}, "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] }, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ] } \ No newline at end of file diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json index df12702dd8b4..3967ef060147 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json @@ -1,20 +1,8 @@ { "type": "Identifier", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "public" - }, + "start":1,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6},"identifierName":"public"}, "name": "public", "errors": [ - "SyntaxError: Unexpected reserved word 'public' (2:0)" + "SyntaxError: Unexpected reserved word 'public'. (2:0)" ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/output.json b/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/output.json index ed05439af755..ed0e627dedb5 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/for-missing-semicolons/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Missing semicolon (2:11)", - "SyntaxError: Missing semicolon (3:7)" + "SyntaxError: Missing semicolon. (2:11)", + "SyntaxError: Missing semicolon. (3:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json index 64125f64db72..b7ad65703869 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)" ], "program": { "type": "Program", @@ -20,6 +20,10 @@ "left": { "type": "AssignmentPattern", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "left": { "type": "Identifier", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, @@ -30,10 +34,6 @@ "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, "value": 1, "raw": "1" - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json index 340a0dcdbce9..513534989f87 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:2)" ], "program": { "type": "Program", @@ -24,6 +24,10 @@ { "type": "AssignmentPattern", "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, + "extra": { + "parenthesized": true, + "parenStart": 1 + }, "left": { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, @@ -34,10 +38,6 @@ "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "value": 1, "raw": "1" - }, - "extra": { - "parenthesized": true, - "parenStart": 1 } } ] diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json index 74aeb35dac49..3e163327771f 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:2)" ], "program": { "type": "Program", @@ -24,6 +24,10 @@ { "type": "ObjectPattern", "start":2,"end":15,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":15}}, + "extra": { + "parenthesized": true, + "parenStart": 1 + }, "properties": [ { "type": "Property", @@ -59,11 +63,7 @@ }, "kind": "init" } - ], - "extra": { - "parenthesized": true, - "parenStart": 1 - } + ] } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json index 7b5829535204..786558b49eab 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:7)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:7)" ], "program": { "type": "Program", @@ -43,6 +43,10 @@ { "type": "ArrayPattern", "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 6 + }, "elements": [ { "type": "AssignmentPattern", @@ -59,11 +63,7 @@ "raw": "1" } } - ], - "extra": { - "parenthesized": true, - "parenStart": 6 - } + ] } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json index 22e32af6ebf5..4c6ed5aea6cf 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:2)" ], "program": { "type": "Program", @@ -24,17 +24,17 @@ { "type": "ArrayPattern", "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, + "extra": { + "parenthesized": true, + "parenStart": 1 + }, "elements": [ { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" } - ], - "extra": { - "parenthesized": true, - "parenStart": 1 - } + ] } ] }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json index c2f51bff4fbd..5ecd04a930e0 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement (1:10)" + "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json index f39f3fcea78e..a87bb06aaf94 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement (1:20)" + "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/output.json index a71d68fda717..6fecbdcede03 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:6)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/output.json index 27220d222a07..4c4ed6a47890 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/output.json index 7f0500a929df..8c0d76ffc8d4 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/output.json index bec89d06786c..a56d7b975811 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:0)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/output.json index 49fc67ea3f47..422d9c193445 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:0)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/output.json index 3d1d9274415d..a88afdae4390 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:0)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:0)" ], "program": { "type": "Program", @@ -27,6 +27,9 @@ { "type": "ObjectProperty", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -39,9 +42,6 @@ "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"x"}, "name": "x" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/output.json index 342a51f0b192..b2ddd2332755 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Invalid left-hand side in parenthesized expression (1:1)" + "SyntaxError: Invalid left-hand side in parenthesized expression. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/output.json index 0bf2bd22b495..4ec692aec63b 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-pattern-in-rest-binding/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:5)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/output.json index a655ee4c1fcb..87f9c92ffe00 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json index 20ba00fd6d9c..f398774dccae 100644 --- a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Unexpected keyword 'break' (2:2)" + "SyntaxError: Unexpected keyword 'break'. (2:2)" ], "program": { "type": "Program", @@ -29,6 +29,9 @@ { "type": "ObjectProperty", "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -41,9 +44,6 @@ "type": "Identifier", "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"break"}, "name": "break" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json index 4450ba694b0f..7d3eaf581e77 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive-function/output.json @@ -2,12 +2,12 @@ "type": "File", "start":0,"end":182,"loc":{"start":{"line":1,"column":0},"end":{"line":21,"column":1}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (2:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (7:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (8:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (14:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (19:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (20:4)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (2:4)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (7:4)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (8:4)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (14:4)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (19:4)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (20:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json index 27f42a3a21dc..1d7dc7c69961 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/invalid-decimal-escape-strict-directive/output.json @@ -2,16 +2,16 @@ "type": "File", "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":22}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:10)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:18)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (3:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (8:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (9:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (11:2)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (11:10)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (11:18)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:2)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:10)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:18)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (3:2)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (4:2)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (8:2)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (9:2)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (11:2)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (11:10)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (11:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json index 2390fa033b11..4f5808019da2 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine-before-use-strict/output.json @@ -2,10 +2,10 @@ "type": "File", "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (2:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (2:9)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:9)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (2:4)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (2:9)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (4:4)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (4:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json index fad92eec30ff..57c9d57144e1 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/non-octal-eight-and-nine/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:4)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (4:9)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (4:4)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (4:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json index 2c6c0e03d277..6a534cbb800c 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-directive/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:69)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:69)" ], "program": { "type": "Program", @@ -47,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":52,"end":71,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":71}}, - "value": "octal directive\\1", "extra": { "raw": "\"octal directive\\1\"", "rawValue": "octal directive\\1" - } + }, + "value": "octal directive\\1" } } ] @@ -65,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json index 0491546b1a61..2be4810dff67 100644 --- a/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-string/numeric-escape-in-property-name/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:38)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:38)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, + "extra": { + "parenthesized": true, + "parenStart": 33 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +61,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 33 - } + ] } } ], @@ -72,11 +72,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json index 97c5ce5eb36d..3f6fb9cf33e7 100644 --- a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json index 98905e40ab03..665a9911c25a 100644 --- a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json index 86f191f9361c..fcc351cc30cc 100644 --- a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json +++ b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict-function/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (3: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. (3: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)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json index e184e7d7f892..081d0f0262c8 100644 --- a/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json +++ b/packages/babel-parser/test/fixtures/core/legacy-octal/legacy-octal-after-use-strict/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:14)", - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:18)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:14)", + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json b/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json index 67751ab07b1f..249b267a314b 100644 --- a/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json +++ b/packages/babel-parser/test/fixtures/core/object/invalid-setter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (1:3)" + "SyntaxError: A 'set' accesor must have exactly one formal parameter. (1:3)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -39,11 +43,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], 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 7cc466fa1ded..fb2337c9a480 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed 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/regression/octal-float-fail/output.json b/packages/babel-parser/test/fixtures/core/regression/octal-float-fail/output.json index 34bb9d34311a..287a2772eda6 100644 --- a/packages/babel-parser/test/fixtures/core/regression/octal-float-fail/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/octal-float-fail/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Missing semicolon (1:2)" + "SyntaxError: Missing semicolon. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json index bf01e24b493d..63d4f2f3191d 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (4:6)" + "SyntaxError: Identifier 'foo' has already been declared. (4:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json index dd515037db96..c4a23d855ed5 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (3:4)" + "SyntaxError: Identifier 'foo' has already been declared. (3:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json index 26e7aee9b70c..9ac124f737b3 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (4:6)" + "SyntaxError: Identifier 'foo' has already been declared. (4:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json index 9d5f3660774e..2cfe77db8d13 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (3:4)" + "SyntaxError: Identifier 'foo' has already been declared. (3:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json index 294f5fbc9c7f..0103e2c92211 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:15)" + "SyntaxError: Identifier 'foo' has already been declared. (2:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json index 532647600b3c..da4e7a24887e 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (1:35)" + "SyntaxError: Identifier 'foo' has already been declared. (1:35)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json index 680f5225864d..05f8573c0b91 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (3:11)" + "SyntaxError: Identifier 'foo' has already been declared. (3:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json index b1c8e29872ae..56f4696daebc 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (3:6)" + "SyntaxError: Identifier 'foo' has already been declared. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json index 01f965585c34..dc0e8dc69933 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:28)" + "SyntaxError: Identifier 'foo' has already been declared. (2:28)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json index 8f5d30047039..d05d9ee66ea5 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (3:6)" + "SyntaxError: Identifier 'foo' has already been declared. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json index df5372c2f51e..5cb36b70a896 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (3:6)" + "SyntaxError: Identifier 'foo' has already been declared. (3:6)" ], "program": { "type": "Program", @@ -29,6 +29,9 @@ { "type": "ObjectProperty", "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -41,9 +44,6 @@ "type": "Identifier", "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json index 9668ddd49b8c..6cad72d0cf5b 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:6)" + "SyntaxError: Identifier 'foo' has already been declared. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json index fcb6f91989b7..8be4d73a735d 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:6)" + "SyntaxError: Identifier 'foo' has already been declared. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json index 251519a88b9e..088a67b40440 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:9)" + "SyntaxError: Identifier 'foo' has already been declared. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json index 40ac7749d89c..20c014a634a2 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:4)" + "SyntaxError: Identifier 'foo' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json index 7e9448c87dd3..d7b2a329e459 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:4)" + "SyntaxError: Identifier 'foo' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json index c35c68c75903..bca583bff3fd 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (1:13)" + "SyntaxError: Identifier 'foo' has already been declared. (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json index ae3ed9341b75..bb6a26c02197 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Identifier 'f' has already been declared (1:28)" + "SyntaxError: Identifier 'f' has already been declared. (1:28)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json index 71081aa3160a..03257c4c43a9 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (1:29)" + "SyntaxError: Identifier 'foo' has already been declared. (1:29)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json index f4d8dbbf8917..ff3043e3aaae 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:9)" + "SyntaxError: Identifier 'foo' has already been declared. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json index 7840aedc9085..04f23e66bc94 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (3:6)" + "SyntaxError: Identifier 'foo' has already been declared. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json index 209a1e02c0b6..496583e47b99 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Identifier 'f' has already been declared (1:28)" + "SyntaxError: Identifier 'f' has already been declared. (1:28)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json index 942dccb6e671..12d2c84940c1 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (1:9)" + "SyntaxError: Identifier 'foo' has already been declared. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json index 047bfbf77f03..0c3762e742c7 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Identifier 'a' has already been declared (3:8)" + "SyntaxError: Identifier 'a' has already been declared. (3:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/for-var/output.json b/packages/babel-parser/test/fixtures/core/scope/for-var/output.json index eb373fff2969..9e701a8c553d 100644 --- a/packages/babel-parser/test/fixtures/core/scope/for-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/for-var/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Identifier 'i' has already been declared (2:8)" + "SyntaxError: Identifier 'i' has already been declared. (2:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json index 40f3335e7eb5..aae21d55786f 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Export 'encrypt' is not defined (1:9)" + "SyntaxError: Export 'encrypt' is not defined. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json index 120ad6bc705e..5a87b71d432e 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ - "SyntaxError: Export 'encrypt' is not defined (1:9)" + "SyntaxError: Export 'encrypt' is not defined. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json index cedcbba92a8b..dcc4930f993b 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "errors": [ - "SyntaxError: Export 'encrypt' is not defined (4:9)" + "SyntaxError: Export 'encrypt' is not defined. (4:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json index a40f509053a3..3406d58c0052 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Export 'Object' is not defined (1:9)" + "SyntaxError: Export 'Object' is not defined. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json index faad719a5d09..5d0388157887 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Export 'Object' is not defined (1:9)" + "SyntaxError: Export 'Object' is not defined. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json index 783a60a237c9..3fd90ba2c84d 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "errors": [ - "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block (2:10)", - "SyntaxError: Export 'encrypt' is not defined (1:9)" + "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block. (2:10)", + "SyntaxError: Export 'encrypt' is not defined. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json index d83b949cce1f..5bde1d321a44 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Export 'encrypt' is not defined (1:9)" + "SyntaxError: Export 'encrypt' is not defined. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json index 287f2a053320..2167c41e6005 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json @@ -2,11 +2,11 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid regular expression flag (1:17)", - "SyntaxError: Invalid regular expression flag (1:19)", - "SyntaxError: Invalid regular expression flag (1:20)", - "SyntaxError: Invalid regular expression flag (1:21)", - "SyntaxError: Invalid regular expression flag (1:22)" + "SyntaxError: Invalid regular expression flag. (1:17)", + "SyntaxError: Invalid regular expression flag. (1:19)", + "SyntaxError: Invalid regular expression flag. (1:20)", + "SyntaxError: Invalid regular expression flag. (1:21)", + "SyntaxError: Invalid regular expression flag. (1:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/347/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/347/options.json index ee18527964e7..8ca0a88b1023 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/347/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/347/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:2)" -} + "throws": "Identifier directly after number. (1:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/348/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/348/options.json index c70fa099de79..3c92b536acc2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/348/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/348/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:1)" -} + "throws": "Identifier directly after number. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json index 6afcaf3f5045..8aee6eeea338 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + "SyntaxError: Floating-point numbers require a valid exponent after the 'e'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json index 34027472096c..d8e610944944 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + "SyntaxError: Floating-point numbers require a valid exponent after the 'e'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json index 666fcca21213..77750f54019f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + "SyntaxError: Floating-point numbers require a valid exponent after the 'e'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/352/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/352/options.json index c70fa099de79..3c92b536acc2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/352/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/352/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:1)" -} + "throws": "Identifier directly after number. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/353/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/353/options.json index c70fa099de79..3c92b536acc2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/353/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/353/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:1)" -} + "throws": "Identifier directly after number. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json index 9a1a7ea60803..f67a53a3afb8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 16 (1:2)" + "SyntaxError: Expected number in radix 16. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/357/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/357/options.json index ee18527964e7..8ca0a88b1023 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/357/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/357/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:2)" -} + "throws": "Identifier directly after number. (1:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/358/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/358/options.json index c70fa099de79..3c92b536acc2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/358/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/358/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:1)" -} + "throws": "Identifier directly after number. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/359/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/359/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/359/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/359/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/360/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/360/options.json index d732a1630991..d55f05b989a4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/360/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/360/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated string constant (1:0)" -} + "throws": "Unterminated string constant. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json index 5dd7b5d3fcd6..5a42dc401165 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json index d9a89994f01f..c6a8c44431e7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:1)" + "SyntaxError: Invalid Unicode escape. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json index 32180fcde928..ab96020c3d57 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:1)" + "SyntaxError: Invalid Unicode escape. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/364/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/364/options.json index 66fb1cd63bc6..150f288739dd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/364/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/364/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:1)" -} + "throws": "Unterminated regular expression. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/365/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/365/options.json index 66fb1cd63bc6..150f288739dd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/365/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/365/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:1)" -} + "throws": "Unterminated regular expression. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json index d42d61f8a543..8d5a269745e0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Invalid regular expression flag (1:16)", - "SyntaxError: Invalid regular expression flag (1:18)" + "SyntaxError: Invalid regular expression flag. (1:16)", + "SyntaxError: Invalid regular expression flag. (1:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json index d4d2cf5dfe67..615e2fb6000b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json index edc325840380..fdcc499e4a82 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json index 46112c6c8828..66b1f9ca6353 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)", - "SyntaxError: Invalid left-hand side in assignment expression (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)", + "SyntaxError: Invalid left-hand side in assignment expression. (1:1)" ], "program": { "type": "Program", @@ -21,6 +21,10 @@ "left": { "type": "BinaryExpression", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "left": { "type": "NumericLiteral", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, @@ -39,10 +43,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json index 89b9c579fa1c..62473b4541d4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Invalid left-hand side in postfix operation (1:0)" + "SyntaxError: Invalid left-hand side in postfix operation. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json index b0387fd4ff59..d05ce3bd5416 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Invalid left-hand side in postfix operation (1:0)" + "SyntaxError: Invalid left-hand side in postfix operation. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json index e86e86ca2246..450e5859605f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Invalid left-hand side in prefix operation (1:2)" + "SyntaxError: Invalid left-hand side in prefix operation. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json index de49f7815bd2..6e320d221cce 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Invalid left-hand side in prefix operation (1:2)" + "SyntaxError: Invalid left-hand side in prefix operation. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json index 609aed8d6228..ce1ff12dc023 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:5)", - "SyntaxError: Invalid left-hand side in for-in statement (1:5)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:5)", + "SyntaxError: Invalid left-hand side in for-in statement. (1:5)" ], "program": { "type": "Program", @@ -17,6 +17,10 @@ "left": { "type": "BinaryExpression", "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, + "extra": { + "parenthesized": true, + "parenStart": 4 + }, "left": { "type": "NumericLiteral", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, @@ -35,10 +39,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesized": true, - "parenStart": 4 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/380/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/380/options.json index 2fd762cd6afd..3f39a2ac3b2b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/380/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/380/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:9)" -} + "throws": "Unterminated regular expression. (1:9)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/381/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/381/options.json index 9d0cd9237f5b..cceacaba73f9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/381/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/381/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated string constant (1:8)" -} + "throws": "Unterminated string constant. (1:8)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json index 71a10a5324e9..4bb04dbcffb2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Unexpected keyword 'if' (1:4)" + "SyntaxError: Unexpected keyword 'if'. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json index 62e99551071a..1891a2eec09f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json index ba27c1c609ba..6ba5a516e0b3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/388/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/388/output.json index ec9f3f126a1c..f9e98bbc6c37 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/388/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/388/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + "SyntaxError: Missing semicolon. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/389/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/389/output.json index eb17665ab7f3..b0e9ab8b217e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/389/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/389/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + "SyntaxError: Missing semicolon. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/396/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/396/options.json index 2e1b1cc3aa43..8c60527068a3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/396/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/396/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:18)" -} + "throws": "Rest element must be last element. (1:18)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json index e005c14c8e87..57f9d8906f96 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected keyword 'if' (1:11)" + "SyntaxError: Unexpected keyword 'if'. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json index 6ec5cbae6e42..251658dd9c3e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected keyword 'true' (1:11)" + "SyntaxError: Unexpected keyword 'true'. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json index 52f3a5538421..402230c0980d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Unexpected keyword 'false' (1:11)" + "SyntaxError: Unexpected keyword 'false'. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json index 501517e632d1..969cc7e9c9f4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected keyword 'null' (1:11)" + "SyntaxError: Unexpected keyword 'null'. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json index 9ac27929ac37..0b17df8ba85a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected keyword 'null' (1:9)" + "SyntaxError: Unexpected keyword 'null'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json index 4d6a82553f05..75d91eb7246d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected keyword 'true' (1:9)" + "SyntaxError: Unexpected keyword 'true'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json index 9939c1143924..4d3856142ae5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected keyword 'false' (1:9)" + "SyntaxError: Unexpected keyword 'false'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json index 18e0bcd2fc99..88f9207edddc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Unexpected keyword 'if' (1:9)" + "SyntaxError: Unexpected keyword 'if'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/405/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/405/output.json index 9f46d8a53e92..f26fb79a0e7e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/405/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/405/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Missing semicolon (1:1)" + "SyntaxError: Missing semicolon. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/408/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/408/options.json index 9f6ece53f3f5..36c0b439d60f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/408/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/408/options.json @@ -1,3 +1,3 @@ { - "throws": "A class name is required (1:7)" + "throws": "A class name is required. (1:7)" } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json index 8ce94b960543..c518595a41a0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Unsyntactic break (1:0)" + "SyntaxError: Unsyntactic break. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json index 6d89822f1568..811d70b316fe 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:0)" + "SyntaxError: Unsyntactic continue. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json index d3af5238b363..2d4dd7e24b0e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)" + "SyntaxError: Invalid left-hand side in for-in statement. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json index a68f97021f5d..8344401eaacc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)" + "SyntaxError: Invalid left-hand side in for-in statement. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json index a0bb1f5c08a4..f9808a0f84f6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Missing catch or finally clause (1:0)" + "SyntaxError: Missing catch or finally clause. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/426/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/426/options.json index 5eb566673135..764361b75201 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/426/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/426/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected character '‿' (1:0)" -} + "throws": "Unexpected character '‿'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json index 322359217c2d..2588843bac54 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Multiple default clauses (1:22)" + "SyntaxError: Multiple default clauses. (1:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/429/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/429/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/429/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/429/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/430/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/430/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/430/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/430/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/431/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/431/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/431/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/431/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/432/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/432/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/432/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/432/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/433/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/433/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/433/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/433/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/434/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/434/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/434/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/434/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/441/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/441/options.json index 66fb1cd63bc6..150f288739dd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/441/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/441/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:1)" -} + "throws": "Unterminated regular expression. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json index f0be819b2d86..9bdc5aca19d6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)", - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:1)", + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json index 6c34e22a0044..882d234cfa8c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Invalid Unicode escape. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json index cc7b3b44d69e..de59dbe06c49 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json index 3af7d55ae127..ab518a1a3a05 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Invalid Unicode escape. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/450/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/450/options.json index 94eb7376be93..098a6b65c6c4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/450/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/450/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected character '‌' (1:0)" -} + "throws": "Unexpected character '‌'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/451/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/451/options.json index c67d8bb8a955..f30bd6f5e9d8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/451/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/451/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected character '‍' (1:0)" -} + "throws": "Unexpected character '‍'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/452/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/452/options.json index d732a1630991..d55f05b989a4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/452/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/452/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated string constant (1:0)" -} + "throws": "Unterminated string constant. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/453/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/453/options.json index d732a1630991..d55f05b989a4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/453/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/453/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated string constant (1:0)" -} + "throws": "Unterminated string constant. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json index 5875cb58be47..06631762652e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: 'return' outside of function (1:0)" + "SyntaxError: 'return' outside of function. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json index 8ce94b960543..c518595a41a0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Unsyntactic break (1:0)" + "SyntaxError: Unsyntactic break. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json index 6d89822f1568..811d70b316fe 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:0)" + "SyntaxError: Unsyntactic continue. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json index 37451db0ed1b..195fb7644434 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:22)" + "SyntaxError: Unsyntactic continue. (1:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json index ae9cb401dddc..46f73d4c4efb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unsyntactic break (1:15)" + "SyntaxError: Unsyntactic break. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json index 39c5663443fe..e9e33c65236a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:15)" + "SyntaxError: Unsyntactic continue. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json index 3939133b3b8a..fa61b279c38b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unsyntactic break (1:33)" + "SyntaxError: Unsyntactic break. (1:33)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":43,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":43}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -50,10 +54,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json index d65c7f7da91a..4390beac20df 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:33)" + "SyntaxError: Unsyntactic continue. (1:33)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":46,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":46}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -50,10 +54,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json index 336add4fe32c..4a682d6c85fb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: Unsyntactic break (1:33)" + "SyntaxError: Unsyntactic break. (1:33)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -46,10 +50,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json index ac86039c659b..9321eacbd502 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:33)" + "SyntaxError: Unsyntactic continue. (1:33)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -46,10 +50,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json index 815a430cb2b7..b16e8da6eb9c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Label 'x' is already declared (1:18)" + "SyntaxError: Label 'x' is already declared. (1:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json index 392c525509d1..4eac4215e0c7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: Deleting local variable in strict mode (1:29)" + "SyntaxError: Deleting local variable in strict mode. (1:29)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -50,21 +54,17 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + "arguments": [] } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json index 62cf67d34e04..224e3d31eb66 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: 'with' in strict mode (1:29)" + "SyntaxError: 'with' in strict mode. (1:29)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -48,21 +52,17 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + "arguments": [] } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json index fcd0ab9858ca..067b73ce5338 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:36)" + "SyntaxError: Binding 'eval' in strict mode. (1:36)" ], "program": { "type": "Program", @@ -58,11 +58,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json index d557326e9973..2d7204637a91 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:36)" + "SyntaxError: Binding 'arguments' in strict mode. (1:36)" ], "program": { "type": "Program", @@ -58,11 +58,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json index 3040718fd546..44484811f90d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:47)" + "SyntaxError: Binding 'eval' in strict mode. (1:47)" ], "program": { "type": "Program", @@ -59,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json index 429d686ed48c..dca567981b26 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:47)" + "SyntaxError: Binding 'arguments' in strict mode. (1:47)" ], "program": { "type": "Program", @@ -59,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json index 79c71ebb542f..33380521385d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:32)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -56,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json index ec34fa9d5ce8..3d1c7d7ebeac 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -56,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json index 2ad942222305..5593bc5e195f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:34)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:34)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json index c85c53c215da..6b15ccd03e74 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:34)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:34)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json index 8635017ed5c5..35025e0c6063 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:34)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:34)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json index 0090b6011203..5bead73e7931 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:34)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:34)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json index 439436ef7e82..0b82488fd4cc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:32)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json index b68c731a58a7..9bbefb53c902 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:32)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json index 52dbdc3d5ca5..58d6e1332031 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json index 48c2df5468eb..0a859a25f4a0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json index 3c4ac7fd38dd..eacc05a4b0b4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)" + "SyntaxError: Binding 'eval' in strict mode. (1:41)" ], "program": { "type": "Program", @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json index e183294a232f..4fc4cfff5a58 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:41)" + "SyntaxError: Binding 'arguments' in strict mode. (1:41)" ], "program": { "type": "Program", @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json index c252adad5c36..fdc46d061db5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:9)" + "SyntaxError: Binding 'eval' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json index 2c691b4f70f1..7b1924caf1e3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:9)" + "SyntaxError: Binding 'arguments' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json index 9e3046fe279b..48f9179f3bc2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:42)" + "SyntaxError: Binding 'eval' in strict mode. (1:42)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "CallExpression", "start":33,"end":54,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":54}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "callee": { "type": "FunctionExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, @@ -49,11 +53,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "arguments": [] } } ], @@ -64,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json index 2502c52e184c..2d2f562d54e1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:42)" + "SyntaxError: Binding 'arguments' in strict mode. (1:42)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "CallExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "callee": { "type": "FunctionExpression", "start":33,"end":57,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":57}}, @@ -49,11 +53,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "arguments": [] } } ], @@ -64,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json index 887c41149531..3c81b4682241 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:10)" + "SyntaxError: Binding 'eval' in strict mode. (1:10)" ], "program": { "type": "Program", @@ -19,6 +19,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"eval"}, @@ -38,18 +42,14 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json index 250afef7d81d..8e6c5c894372 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:10)" + "SyntaxError: Binding 'arguments' in strict mode. (1:10)" ], "program": { "type": "Program", @@ -19,6 +19,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19},"identifierName":"arguments"}, @@ -38,18 +42,14 @@ "value": { "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json index 03985eff0b57..9229db313aea 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:47)" + "SyntaxError: Binding 'eval' in strict mode. (1:47)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -62,11 +66,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -77,11 +77,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json index 29ce013f0b8b..c5b887768304 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:10)" + "SyntaxError: Binding 'package' in strict mode. (1:10)" ], "program": { "type": "Program", @@ -19,6 +19,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"package"}, @@ -38,18 +42,14 @@ "value": { "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json index 60d4df26f9f4..47a65a4a935c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:48)" + "SyntaxError: Binding 'eval' in strict mode. (1:48)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -81,11 +85,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -96,11 +96,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json index 4ee83b14028e..6f387fb20104 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)" + "SyntaxError: Binding 'eval' in strict mode. (1:41)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectMethod", @@ -60,11 +64,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -75,11 +75,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json index 0c8905156ab1..68a903fb4f30 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:49)" + "SyntaxError: Binding 'eval' in strict mode. (1:49)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -68,11 +72,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -83,11 +83,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json index 3ccaace1b183..830edc82be15 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json index dc142e76101d..232a3d361295 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:15)" + "SyntaxError: Binding 'arguments' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json index d887db53f5e6..9b32d2b4485e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:48)" + "SyntaxError: Binding 'eval' in strict mode. (1:48)" ], "program": { "type": "Program", @@ -57,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json index ded181413784..7395b0a56ad5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:48)" + "SyntaxError: Binding 'arguments' in strict mode. (1:48)" ], "program": { "type": "Program", @@ -57,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 f4096149d8ed..dab347309794 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:33)" ], "program": { "type": "Program", @@ -46,11 +46,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 8caf22da60fa..7e92eeb15f63 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:36)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":34,"end":45,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":45}}, + "extra": { + "parenthesized": true, + "parenStart": 33 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +61,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 33 - } + ] } } ], @@ -72,11 +72,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json index a3eee1ca1117..917c3e5a9e8c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Unexpected reserved word 'implements' (1:37)" + "SyntaxError: Unexpected reserved word 'implements'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json index cffcb241d435..98446531faa1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:37)" + "SyntaxError: Unexpected reserved word 'interface'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json index 3d7bd0ac8ee4..4e1da8899d7b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unexpected reserved word 'package' (1:37)" + "SyntaxError: Unexpected reserved word 'package'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json index 4c1f2d2844f0..52b9164d1a75 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unexpected reserved word 'private' (1:37)" + "SyntaxError: Unexpected reserved word 'private'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json index dcf994402ae1..f7dbc7b74c4c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Unexpected reserved word 'protected' (1:37)" + "SyntaxError: Unexpected reserved word 'protected'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json index c7306ecdb68b..5e4ded19fd38 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:37)" + "SyntaxError: Unexpected reserved word 'public'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json index 41fd57994528..70f7e9670e08 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:37)" + "SyntaxError: Unexpected reserved word 'static'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json index 160544579047..fda02a2a3f9e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: Binding 'static' in strict mode (1:15)" + "SyntaxError: Binding 'static' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json index b184d5881724..7f3b58f78afc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Binding 'static' in strict mode (1:9)" + "SyntaxError: Binding 'static' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json index 07cfc9324623..7feccdb1152c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:23)" + "SyntaxError: Unexpected reserved word 'static'. (1:23)" ], "program": { "type": "Program", @@ -36,11 +36,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json index 3b77c9170b54..3fba35b99ded 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Argument name clash (1:14)" + "SyntaxError: Argument name clash. (1:14)" ], "program": { "type": "Program", @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json index 0581517d990a..55829c2b075b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:11)" + "SyntaxError: Binding 'eval' in strict mode. (1:11)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json index aafa09421ccc..b82f2cea47a9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:11)" + "SyntaxError: Binding 'package' in strict mode. (1:11)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json index df3094e728a8..8cf993f5136e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "errors": [ - "SyntaxError: Argument name clash (1:43)" + "SyntaxError: Argument name clash. (1:43)" ], "program": { "type": "Program", @@ -66,11 +66,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json index bcaf874206cd..8f987f709891 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Argument name clash (1:15)" + "SyntaxError: Argument name clash. (1:15)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -46,18 +50,14 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json index 65f5a908f019..688a01f58639 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ - "SyntaxError: Argument name clash (1:44)" + "SyntaxError: Argument name clash. (1:44)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, + "extra": { + "parenthesized": true, + "parenStart": 29 + }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"b"}, @@ -55,10 +59,6 @@ "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 29 } } } @@ -70,11 +70,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json index a1ab8b4653ea..911fe15b7606 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:12)" + "SyntaxError: Binding 'eval' in strict mode. (1:12)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -41,18 +45,14 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json index 7caed97929d9..44b440b91f7b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:12)" + "SyntaxError: Binding 'package' in strict mode. (1:12)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -41,18 +45,14 @@ "value": { "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } 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 a53f5cb5d29e..f55a1a9f981e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:65)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:65)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":28,"end":40,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":40}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] @@ -94,11 +94,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json index 98b811bf5fd6..31f281be9ce3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Unexpected keyword 'this' (1:4)" + "SyntaxError: Unexpected keyword 'this'. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json index 4323a83f4c23..0651431d13d3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}}, "errors": [ - "SyntaxError: Illegal newline after throw (1:5)" + "SyntaxError: Illegal newline after throw. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/536/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/536/output.json index 603923e34e5d..6c2e7b4aa6ca 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/536/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/536/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:7)" + "SyntaxError: 'Const declarations' require an initialization value. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json index 87e0021bd4bb..6200ad3f141f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (2:8)" + "SyntaxError: Unexpected reserved word 'public'. (2:8)" ], "program": { "type": "Program", @@ -24,6 +24,9 @@ { "type": "ObjectProperty", "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +39,6 @@ "type": "Identifier", "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"public"}, "name": "public" - }, - "extra": { - "shorthand": true } } ] @@ -65,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json index d0a88458d8f9..7227f3e8750e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:8)" + "SyntaxError: Unexpected reserved word 'public'. (1:8)" ], "program": { "type": "Program", @@ -24,6 +24,9 @@ { "type": "ObjectProperty", "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +39,6 @@ "type": "Identifier", "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"public"}, "name": "public" - }, - "extra": { - "shorthand": true } } ] 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 e73c9a97f508..81e80a03d40f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (2:10)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (2:10)" ], "program": { "type": "Program", @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 765b5e13a1e5..f6c6e7c58b4c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (2:10)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (2:10)" ], "program": { "type": "Program", @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/555/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/555/options.json index c1c6450ba3c0..2f22ade906d2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/555/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/555/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (3:13)" -} + "throws": "Rest element must be last element. (3:13)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json index 2770669d1421..4f972454241c 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected trailing comma after rest element (1:5)" + "SyntaxError: Unexpected trailing comma after rest element. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json index e854b9c5e72e..d10c3b2cb20c 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected trailing comma after rest element (1:10)" + "SyntaxError: Unexpected trailing comma after rest element. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json index 9d70fca940ae..1a764a9ed422 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Unexpected trailing comma after rest element (1:6)" + "SyntaxError: Unexpected trailing comma after rest element. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/invalid-location/options.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/invalid-location/options.json index 0dac59b7a808..032c2a5069b2 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/invalid-location/options.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/invalid-location/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:1)" -} + "throws": "Rest element must be last element. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json index 09d15bfd29ff..4e59252097e0 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:5)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json index 9f5e348e9980..cc46874cf758 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:5)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json index 5283e2a52a8b..23c45add4478 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:3)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json index c2220d23a6d6..8d6e26697acc 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-array-pattern/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:3)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json index e211f20e7d7f..89f11f8853c3 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern-member/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding member expression (1:7)" + "SyntaxError: Binding member expression. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json index 0749c0ba9234..a33f06e0607c 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens-object-pattern/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:7)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json index 07989bd92794..afde07cd6819 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/inner-parens/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:12)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/invalid-rest-in-params/options.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/invalid-rest-in-params/options.json index c1c6450ba3c0..2f22ade906d2 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/invalid-rest-in-params/options.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/invalid-rest-in-params/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (3:13)" -} + "throws": "Rest element must be last element. (3:13)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json index a7fb3e572421..58fbf48dccb2 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "errors": [ - "SyntaxError: super is only allowed in object methods and classes (4:13)" + "SyntaxError: 'super' is only allowed in object methods and classes. (4:13)" ], "program": { "type": "Program", @@ -24,12 +24,12 @@ "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"Object"}, "name": "Object" }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13},"identifierName":"create"}, "name": "create" - }, - "computed": false + } }, "arguments": [ { @@ -88,12 +88,12 @@ "type": "Super", "start":63,"end":68,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":18}} }, + "computed": false, "property": { "type": "Identifier", "start":69,"end":72,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":22},"identifierName":"foo"}, "name": "foo" - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json index 8813fbf71961..6ee5b3f9fe0c 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (2:8)" + "SyntaxError: `super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (2:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json index 4fa31326d388..f2406d3d015e 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Argument name clash (2:11)" + "SyntaxError: Argument name clash. (2:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json index d5de1e2c20d6..1b0004a14d2c 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Classes may not have static property named prototype (2:10)" + "SyntaxError: Classes may not have static property named prototype. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json index c4d1636033ce..3a780d8815ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Classes may not have static property named prototype (2:9)" + "SyntaxError: Classes may not have static property named prototype. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json index a135021f7ae8..6a9ce511405f 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: getter must not have any formal parameters (2:2)" + "SyntaxError: A 'get' accesor must not have any formal parameters. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json index 8fa6cbb49774..df68680499da 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:4)" + "SyntaxError: 'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]). (3:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json index 5b9c55e234a8..49c4af0699f0 100644 --- a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":7}}, "errors": [ - "SyntaxError: 'with' in strict mode (2:2)" + "SyntaxError: 'with' in strict mode. (2:2)" ], "program": { "type": "Program", @@ -21,6 +21,10 @@ "superClass": { "type": "CallExpression", "start":17,"end":60,"loc":{"start":{"line":1,"column":17},"end":{"line":4,"column":3}}, + "extra": { + "parenthesized": true, + "parenStart": 16 + }, "callee": { "type": "FunctionExpression", "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":4,"column":1}}, @@ -62,11 +66,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 16 - } + "arguments": [] }, "body": { "type": "ClassBody", diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json index 66f3fdbdeedf..aedf837aba37 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-module/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:8)" + "SyntaxError: Binding 'arguments' in strict mode. (1:8)" ], "program": { "type": "Program", @@ -24,6 +24,9 @@ { "type": "ObjectProperty", "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +39,6 @@ "type": "Identifier", "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17},"identifierName":"arguments"}, "name": "arguments" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json index 4fb224686603..8f8fa354dc2d 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-arguments-strict/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (2:8)" + "SyntaxError: Binding 'arguments' in strict mode. (2:8)" ], "program": { "type": "Program", @@ -24,6 +24,9 @@ { "type": "ObjectProperty", "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +39,6 @@ "type": "Identifier", "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17},"identifierName":"arguments"}, "name": "arguments" - }, - "extra": { - "shorthand": true } } ] @@ -65,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json index 9688161107e5..03fdbd51b4de 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-eval/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:16)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:16)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -24,6 +28,9 @@ { "type": "ObjectProperty", "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -45,9 +52,6 @@ "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31},"identifierName":"defValue"}, "name": "defValue" } - }, - "extra": { - "shorthand": true } } ] @@ -56,10 +60,6 @@ "type": "Identifier", "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38},"identifierName":"obj"}, "name": "obj" - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -71,11 +71,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json index 0c6596304a0d..f30023ae8aab 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected keyword 'this' (1:6)" + "SyntaxError: Unexpected keyword 'this'. (1:6)" ], "program": { "type": "Program", @@ -24,6 +24,9 @@ { "type": "ObjectProperty", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +39,6 @@ "type": "Identifier", "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"this"}, "name": "this" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json index f0bbee72ab6c..666f689539f4 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)" ], "program": { "type": "Program", @@ -20,17 +20,17 @@ "left": { "type": "ArrayPattern", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "elements": [ { "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json index 2519d3595ff6..42ff27041108 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)" ], "program": { "type": "Program", @@ -20,10 +20,17 @@ "left": { "type": "ObjectPattern", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,16 +43,9 @@ "type": "Identifier", "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json b/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json index 41eade104e2b..532daf7a1fcb 100644 --- a/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:24)" + "SyntaxError: Redefinition of __proto__ property. (1:24)" ], "program": { "type": "Program", @@ -59,12 +59,12 @@ } ] }, + "computed": false, "property": { "type": "Identifier", "start":43,"end":52,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":52},"identifierName":"__proto__"}, "name": "__proto__" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json index 838c1aea7fd3..2e5f623fb15e 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ - "SyntaxError: Invalid left-hand side in for-loop (2:5)" + "SyntaxError: Invalid left-hand side in for-loop. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json index 4e70874d2735..b5ab86130bfc 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-in' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json index c3c20c0a10f3..312dcca15de7 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-in' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json index 26b3ee955998..1aed30595579 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ - "SyntaxError: for-in loop variable declaration may not have an initializer (2:5)" + "SyntaxError: 'for-in' loop variable declaration may not have an initializer. (2:5)" ], "program": { "type": "Program", @@ -56,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json index 32755b31ea17..40ce6d680516 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-in' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json index 9bde6c44ee0c..9cd2f3bc4135 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-in' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", @@ -27,6 +27,9 @@ { "type": "ObjectProperty", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -39,9 +42,6 @@ "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json index 40500649a6b4..3e918e9a6880 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ - "SyntaxError: Invalid left-hand side in for-loop (2:5)" + "SyntaxError: Invalid left-hand side in for-loop. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/output.json index 5b248b94f2a2..4e3f6e9cac7a 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Missing semicolon (1:6)", - "SyntaxError: Missing semicolon (1:14)" + "SyntaxError: Missing semicolon. (1:6)", + "SyntaxError: Missing semicolon. (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json index f6604179cee6..66942ac3debd 100644 --- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json +++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:16)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:16)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":29,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":29}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": null, "generator": true, "async": false, @@ -35,10 +39,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json index 27beba5b2e65..9f1d6d3e1bf5 100644 --- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json +++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Generators can only be declared at the top level or inside a block (1:16)" + "SyntaxError: Generators can only be declared at the top level or inside a block. (1:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json index 425fd47bc027..12bf9e1467ca 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "errors": [ - "SyntaxError: Unexpected keyword 'const' (1:4)", - "SyntaxError: Escape sequence in keyword const (1:4)", - "SyntaxError: Escape sequence in keyword const (3:0)" + "SyntaxError: Unexpected keyword 'const'. (1:4)", + "SyntaxError: Escape sequence in keyword const. (1:4)", + "SyntaxError: Escape sequence in keyword const. (3:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json index 9aa7fd43bbb8..40465eb55353 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "errors": [ - "SyntaxError: Unexpected keyword 'export' (1:4)", - "SyntaxError: Escape sequence in keyword export (1:4)", - "SyntaxError: Escape sequence in keyword export (4:0)" + "SyntaxError: Unexpected keyword 'export'. (1:4)", + "SyntaxError: Escape sequence in keyword export. (1:4)", + "SyntaxError: Escape sequence in keyword export. (4:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json index a9fc063b1be8..4a33bb63039e 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Escape sequence in keyword if (1:0)" + "SyntaxError: Escape sequence in keyword if. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json index 0533a2a4de2a..01969cf25b5d 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":41}}, "errors": [ - "SyntaxError: Unexpected keyword 'import' (1:4)", - "SyntaxError: Escape sequence in keyword import (1:4)", - "SyntaxError: Escape sequence in keyword import (3:0)" + "SyntaxError: Unexpected keyword 'import'. (1:4)", + "SyntaxError: Escape sequence in keyword import. (1:4)", + "SyntaxError: Escape sequence in keyword import. (3:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json index 1205de6403ef..f72c9e56ba10 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Escape sequence in keyword null (1:0)" + "SyntaxError: Escape sequence in keyword null. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json index 13d4895854d3..83c027b97042 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Escape sequence in keyword true (1:0)" + "SyntaxError: Escape sequence in keyword true. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/output.json b/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/output.json index 481ab58d62c4..aa5f6b4580f8 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Missing semicolon (1:8)" + "SyntaxError: Missing semicolon. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json index c45edc3f9592..0f894576526e 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "errors": [ - "SyntaxError: Unexpected reserved word 'let' (2:0)" + "SyntaxError: Unexpected reserved word 'let'. (2:0)" ], "program": { "type": "Program", @@ -41,11 +41,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json index eee1bada9870..8708bc00f8ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: new.target can only be used in functions (2:2)" + "SyntaxError: `new.target` can only be used in functions. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json index 525e9f0ba047..e18fe0daccca 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: The only valid meta property for new is new.target (2:6)" + "SyntaxError: The only valid meta property for new is new.target. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json index 95fcf34a01ab..d420876050cc 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Escape sequence in keyword new (1:15)" + "SyntaxError: Escape sequence in keyword new. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json index 6524f1e405ef..3c5fee42f10b 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: The only valid meta property for new is new.target (1:19)" + "SyntaxError: The only valid meta property for new is new.target. (1:19)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json index eac0709d91ee..0b1babd1f983 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: new.target can only be used in functions (1:0)" + "SyntaxError: `new.target` can only be used in functions. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json index c2f48e113192..e77da15e74d7 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json @@ -3,7 +3,7 @@ "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":26}}, "errors": [ "SyntaxError: Only one default export allowed per module. (2:9)", - "SyntaxError: Export 'foo' is not defined (2:9)" + "SyntaxError: Export 'foo' is not defined. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json index 119ea1be6c04..ea729da4b266 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":34}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:20)", + "SyntaxError: Identifier 'foo' has already been declared. (2:20)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:20)" ], "program": { @@ -77,6 +77,9 @@ { "type": "ObjectProperty", "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -89,9 +92,6 @@ "type": "Identifier", "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json index 933af6bc6d6d..bccacaba390c 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":69}}, "errors": [ - "SyntaxError: Identifier 'foo4' has already been declared (2:50)", + "SyntaxError: Identifier 'foo4' has already been declared. (2:50)", "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:50)" ], "program": { @@ -81,6 +81,9 @@ { "type": "ObjectProperty", "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -93,9 +96,6 @@ "type": "Identifier", "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json index c5c74319fb0f..78efba09f151 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":67}}, "errors": [ - "SyntaxError: Identifier 'foo4' has already been declared (2:49)", + "SyntaxError: Identifier 'foo4' has already been declared. (2:49)", "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:49)" ], "program": { @@ -77,6 +77,9 @@ { "type": "ObjectProperty", "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -89,9 +92,6 @@ "type": "Identifier", "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json index 2e17d443f69c..c17efc04423b 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":76}}, "errors": [ - "SyntaxError: Identifier 'foo4' has already been declared (2:58)", + "SyntaxError: Identifier 'foo4' has already been declared. (2:58)", "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:58)" ], "program": { @@ -99,6 +99,9 @@ { "type": "ObjectProperty", "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -111,9 +114,6 @@ "type": "Identifier", "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36},"identifierName":"b"}, "name": "b" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json index c0baf34cf9a6..81bb6e08e760 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:21)", + "SyntaxError: Identifier 'foo' has already been declared. (2:21)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:21)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json index 3d24d4832079..2126b29b74c8 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ - "SyntaxError: Identifier 'foo2' has already been declared (2:13)", + "SyntaxError: Identifier 'foo2' has already been declared. (2:13)", "SyntaxError: `foo2` has already been exported. Exported identifiers must be unique. (2:13)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json index 02547f2eee7d..bf712aed7aec 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:22)", + "SyntaxError: Identifier 'foo' has already been declared. (2:22)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:22)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json index df81eb4ac1a5..90e47bf358ba 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ - "SyntaxError: Identifier 'bar' has already been declared (2:13)", + "SyntaxError: Identifier 'bar' has already been declared. (2:13)", "SyntaxError: `bar` has already been exported. Exported identifiers must be unique. (2:13)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json index 23ff7e9f4422..08d6bfd425e2 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":40}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:28)", + "SyntaxError: Identifier 'foo' has already been declared. (2:28)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:28)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json index 2c99a1b1d6ae..12a1755c4693 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":42}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:29)", + "SyntaxError: Identifier 'foo' has already been declared. (2:29)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:29)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json index 4673f3337235..f3bb5a3a5f23 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:15)", + "SyntaxError: Identifier 'foo' has already been declared. (2:15)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)" ], "program": { @@ -58,6 +58,9 @@ { "type": "ObjectProperty", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -70,9 +73,6 @@ "type": "Identifier", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json index 300af91efc82..0107e6652a62 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:16)", + "SyntaxError: Identifier 'foo' has already been declared. (2:16)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)" ], "program": { @@ -30,6 +30,9 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -42,9 +45,6 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json index 54ca454dbed6..40b0f42a74e7 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:14)", + "SyntaxError: Identifier 'foo' has already been declared. (2:14)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:14)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json index f8265d2b7780..c2fa39fd94e8 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:16)", + "SyntaxError: Identifier 'foo' has already been declared. (2:16)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json index 74dc3d4b6e5f..1bf3a89cb8c4 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":26}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:14)", + "SyntaxError: Identifier 'foo' has already been declared. (2:14)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:14)" ], "program": { @@ -30,6 +30,9 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -42,9 +45,6 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json index 90a9d8e8df78..7c2161e9e08b 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:15)", + "SyntaxError: Identifier 'foo' has already been declared. (2:15)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)" ], "program": { @@ -63,6 +63,9 @@ { "type": "ObjectProperty", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -75,9 +78,6 @@ "type": "Identifier", "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json index b09cb52efb83..4a3aa5c69186 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ - "SyntaxError: Identifier 'Foo' has already been declared (2:15)", + "SyntaxError: Identifier 'Foo' has already been declared. (2:15)", "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:15)" ], "program": { @@ -55,6 +55,9 @@ { "type": "ObjectProperty", "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -67,9 +70,6 @@ "type": "Identifier", "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"Foo"}, "name": "Foo" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json index db65b77d4d43..574141b68fda 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Identifier 'Foo' has already been declared (2:14)", + "SyntaxError: Identifier 'Foo' has already been declared. (2:14)", "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:14)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json index 86c07bcfa5b0..4773efea9e7d 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json @@ -3,8 +3,8 @@ "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:9)", - "SyntaxError: Export 'foo' is not defined (1:9)", - "SyntaxError: Export 'bar' is not defined (2:9)" + "SyntaxError: Export 'foo' is not defined. (1:9)", + "SyntaxError: Export 'bar' is not defined. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json index ab2ca9601162..26729bca5542 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:9)" + "SyntaxError: Unexpected keyword 'default'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json index d4df45baefea..0e72d3d25953 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Unexpected keyword 'typeof' (1:9)" + "SyntaxError: Unexpected keyword 'typeof'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json index 95070d9dab76..9312facd235c 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Unexpected keyword 'typeof' (1:9)" + "SyntaxError: Unexpected keyword 'typeof'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json index a627dce5e719..a0a71da528cd 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: Unexpected keyword 'debugger' (1:9)" + "SyntaxError: Unexpected keyword 'debugger'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json index 2d66299daa51..7846ec071dad 100644 --- a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json +++ b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Argument name clash (2:11)" + "SyntaxError: Argument name clash. (2:11)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":1}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -50,11 +54,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json b/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json index 09cc367ae97a..69d716154077 100644 --- a/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/object/invalid-accessor-generator/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "errors": [ - "SyntaxError: A getter cannot be a generator (2:9)", - "SyntaxError: A setter cannot be a generator (3:9)" + "SyntaxError: A getter cannot be a generator. (2:9)", + "SyntaxError: A setter cannot be a generator. (3:9)" ], "program": { "type": "Program", @@ -17,6 +17,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":57,"loc":{"start":{"line":1,"column":1},"end":{"line":4,"column":1}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -68,14 +72,10 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json index 397423695084..39c82d98cfa1 100644 --- a/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json +++ b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Duplicate regular expression flag (1:6)" + "SyntaxError: Duplicate regular expression flag. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json index 4549edcbc96a..832339a218b2 100644 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word-strict/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":45}}, "errors": [ - "SyntaxError: Unexpected reserved word 'implements' (2:11)", - "SyntaxError: Unexpected reserved word 'interface' (2:23)", - "SyntaxError: Unexpected reserved word 'package' (2:34)" + "SyntaxError: Unexpected reserved word 'implements'. (2:11)", + "SyntaxError: Unexpected reserved word 'interface'. (2:23)", + "SyntaxError: Unexpected reserved word 'package'. (2:34)" ], "program": { "type": "Program", @@ -27,10 +27,17 @@ "init": { "type": "ObjectExpression", "start":23,"end":57,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":43}}, + "extra": { + "parenthesized": true, + "parenStart": 22 + }, "properties": [ { "type": "ObjectProperty", "start":25,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":21}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -43,14 +50,14 @@ "type": "Identifier", "start":25,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":21},"identifierName":"implements"}, "name": "implements" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":37,"end":46,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":32}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -63,14 +70,14 @@ "type": "Identifier", "start":37,"end":46,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":32},"identifierName":"interface"}, "name": "interface" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":48,"end":55,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":41}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -83,16 +90,9 @@ "type": "Identifier", "start":48,"end":55,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":41},"identifierName":"package"}, "name": "package" - }, - "extra": { - "shorthand": true } } - ], - "extra": { - "parenthesized": true, - "parenStart": 22 - } + ] } } ], @@ -106,11 +106,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json index 752251aa9b35..a1f45dbc7b53 100644 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/reserved-word/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Unexpected keyword 'const' (1:11)", - "SyntaxError: Unexpected keyword 'if' (1:18)", - "SyntaxError: Unexpected keyword 'this' (1:22)" + "SyntaxError: Unexpected keyword 'const'. (1:11)", + "SyntaxError: Unexpected keyword 'if'. (1:18)", + "SyntaxError: Unexpected keyword 'this'. (1:22)" ], "program": { "type": "Program", @@ -27,10 +27,17 @@ "init": { "type": "ObjectExpression", "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, + "extra": { + "parenthesized": true, + "parenStart": 8 + }, "properties": [ { "type": "ObjectProperty", "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -43,14 +50,14 @@ "type": "Identifier", "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"const"}, "name": "const" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -63,14 +70,14 @@ "type": "Identifier", "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20},"identifierName":"if"}, "name": "if" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -83,16 +90,9 @@ "type": "Identifier", "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26},"identifierName":"this"}, "name": "this" - }, - "extra": { - "shorthand": true } } - ], - "extra": { - "parenthesized": true, - "parenStart": 8 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json index 4c65f3b1133e..3bd4bb788664 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:5)" + "SyntaxError: Lexical declaration cannot appear in a single-statement context. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json index 4ceffd86de0f..1d34010dffd9 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Async functions can only be declared at the top level or inside a block (1:5)" + "SyntaxError: Async functions can only be declared at the top level or inside a block. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json index f71d506d0042..539e9018042f 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Generators can only be declared at the top level or inside a block (1:13)" + "SyntaxError: Generators can only be declared at the top level or inside a block. (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json index 47915b8c2b34..3be26026c097 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block (1:35)" + "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block. (1:35)" ], "program": { "type": "Program", @@ -60,11 +60,11 @@ "value": { "type": "DirectiveLiteral", "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-let/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-let/output.json index f9826760ea5a..2f0524fc05cb 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-let/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Missing semicolon (1:8)" + "SyntaxError: Missing semicolon. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json index a3d47c9c212e..ee7e50105ab6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-of' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json index 9bf15e6a3a03..17191c0d4ea9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "errors": [ - "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:40)" + "SyntaxError: `super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:40)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ClassExpression", "start":15,"end":50,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":50}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "id": { "type": "Identifier", "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"A"}, @@ -63,10 +67,6 @@ } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -78,11 +78,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json index 2d6cbfab112a..86a7ac7ada06 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Duplicate constructor in the same class (1:27)" + "SyntaxError: Duplicate constructor in the same class. (1:27)" ], "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 ccd3aa3f3e7c..d3dd61e5ec31 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Class constructor may not be an accessor (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/127/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json index 8650fd6a5dc4..bb873cc1b758 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Constructor can't be a generator (1:11)" + "SyntaxError: Constructor can't be a generator. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json index e1a64571a1b8..513548b108f2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Argument name clash (1:16)" + "SyntaxError: Argument name clash. (1:16)" ], "program": { "type": "Program", @@ -33,6 +33,9 @@ { "type": "ObjectProperty", "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -45,9 +48,6 @@ "type": "Identifier", "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json index a880531bce85..e3f4428bc981 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + "SyntaxError: Expected number in radix 8. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/199/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/199/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/199/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/199/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json index 42696d4924d6..fb1d13c95256 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + "SyntaxError: Expected number in radix 8. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json index 9ed93409bc00..4bccf581bfba 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:3)" + "SyntaxError: Expected number in radix 8. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json index 91dec1a23074..17d44bb73415 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + "SyntaxError: Expected number in radix 8. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/203/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/203/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/203/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/203/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json index 2fbc3ece3140..91c34234171d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + "SyntaxError: Expected number in radix 8. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json index 4978bcf4e51b..dd1203515e23 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:3)" + "SyntaxError: Expected number in radix 8. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json index bd3bd49916b3..fe15b2f041dd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/207/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/207/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/207/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/207/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json index fabbead51492..47c0f4397ab2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json index c90afe1734e6..68c905933acb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + "SyntaxError: Expected number in radix 2. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json index 2b8e4f22be33..4f60e9e38bda 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + "SyntaxError: Expected number in radix 2. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json index 6cfde9edb3b5..b750712f4f89 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/212/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/212/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/212/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/212/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json index 6e3728ace39b..31d92ec36023 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json index d5ba308d5906..a909b5c95b75 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + "SyntaxError: Expected number in radix 2. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json index af38f05f89fa..4e1c02681908 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + "SyntaxError: Expected number in radix 2. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json index 8169a2831084..0a7ba19e8c3c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:4)" + "SyntaxError: Bad character escape sequence. (1:4)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "value": "\\u{}", "extra": { "raw": "\"\\u{}\"", "rawValue": "\\u{}" - } + }, + "value": "\\u{}" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json index a5b7bb95f356..38e1cffe179b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:4)" + "SyntaxError: Bad character escape sequence. (1:4)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, - "value": "\\u{FFFF", "extra": { "raw": "\"\\u{FFFF\"", "rawValue": "\\u{FFFF" - } + }, + "value": "\\u{FFFF" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json index 5c0123d27a42..1bb3874a6394 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:4)" + "SyntaxError: Bad character escape sequence. (1:4)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, - "value": "\\u{FFZ}", "extra": { "raw": "\"\\u{FFZ}\"", "rawValue": "\\u{FFZ}" - } + }, + "value": "\\u{FFZ}" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json index 146edec02ca3..0815c316c04b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json index 6e2bf85797f6..f89243f58838 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Invalid left-hand side in array destructuring pattern (1:1)" + "SyntaxError: Invalid left-hand side in array destructuring pattern. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json index c220984197b1..3f041c90f952 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)" + "SyntaxError: Invalid left-hand side in object destructuring pattern. (1:7)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -52,10 +56,6 @@ "raw": "42" }, "value": 42 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json index 475564c6683c..6248583c3f51 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Object pattern can't contain getter or setter (1:7)" + "SyntaxError: Object pattern can't contain getter or setter. (1:7)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -53,10 +57,6 @@ "raw": "0" }, "value": 0 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/224/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/224/output.json index 5596ed9f7855..2f8ee49512da 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/224/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/224/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "errors": [ - "SyntaxError: Missing semicolon (2:3)" + "SyntaxError: Missing semicolon. (2:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/225/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/225/output.json index 4cd6d09cff99..c9593ef3ffd9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/225/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/225/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "errors": [ - "SyntaxError: Missing semicolon (2:5)" + "SyntaxError: Missing semicolon. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json index dfaa426cebd5..58ebd7f229c8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:9)" + "SyntaxError: Unexpected keyword 'default'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json index ddf1b38b6ab3..bbd27877b4a3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:44)" + "SyntaxError: Binding 'eval' in strict mode. (1:44)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":55,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":55}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -81,11 +85,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -96,11 +96,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json index 54c485732104..d32adee02740 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Argument name clash (1:37)" + "SyntaxError: Argument name clash. (1:37)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}}, + "extra": { + "parenthesized": true, + "parenStart": 29 + }, "properties": [ { "type": "ObjectMethod", @@ -65,11 +69,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 29 - } + ] } } ], @@ -80,11 +80,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json index d30f2d17c2b5..4cb58cb39761 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Unexpected keyword 'super' (1:4)" + "SyntaxError: Unexpected keyword 'super'. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json index 1a676c59c021..f1f5faa51f14 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:4)" + "SyntaxError: Unexpected keyword 'default'. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json index 0e0111a35a2f..b292f4565e82 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:4)" + "SyntaxError: Unexpected keyword 'default'. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json index 154ac5251e77..39504b4828f2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:6)" + "SyntaxError: Unexpected keyword 'default'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json index 115652eea1e5..45702dde61e0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:20)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:20)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":32,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":32}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -44,10 +48,6 @@ "type": "Identifier", "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"obj"}, "name": "obj" - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -59,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json index 5521e0e9a34f..b09ddd2ba82d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:20)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:20)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":37,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":37}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -44,10 +48,6 @@ "type": "Identifier", "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37},"identifierName":"obj"}, "name": "obj" - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -59,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json index ae24a82b749c..b9bedf73e74d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-in' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json index 70e5c2df0d16..9f2f81644472 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-of' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json index cca401d0d14b..2c169917e778 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:15)", - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:15)", + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -59,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json index 8e8d8419af7a..39a48ce2798d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:14)" + "SyntaxError: Binding 'eval' in strict mode. (1:14)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json index 5a18ea14d881..35d22ba742a9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:14)" + "SyntaxError: Binding 'arguments' in strict mode. (1:14)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json index c5a150d343ad..d0530400d01e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json index 402704e9deb8..60534b000284 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:15)" + "SyntaxError: Binding 'arguments' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json index db4f4a90fe06..00536f42839b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -63,11 +63,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json index e552560189df..cba6699ec17a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Argument name clash (1:18)" + "SyntaxError: Argument name clash. (1:18)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 70812a59cc6a..8f898cf7a24e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:21)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:21)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json index 6b624a3ee404..2fdc8e15fec4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json index 06d87dffa42f..a6277b918ccd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)", - "SyntaxError: Binding invalid left-hand side in function parameter list (1:5)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:1)", + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/263/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/263/options.json index 2b34d4c1e133..70e37125f540 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/263/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/263/options.json @@ -1,3 +1,3 @@ { - "throws": "A class name is required (1:6)" -} + "throws": "A class name is required. (1:6)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/264/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/264/options.json index 5162185002ad..bbcc148f2a9c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/264/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/264/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated template (1:1)" -} + "throws": "Unterminated template. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/277/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/277/options.json index 2e1b1cc3aa43..8c60527068a3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/277/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/277/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:18)" -} + "throws": "Rest element must be last element. (1:18)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json index bdb28643723e..459d69dd1c2c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Argument name clash (1:30)" + "SyntaxError: Argument name clash. (1:30)" ], "program": { "type": "Program", @@ -33,6 +33,9 @@ { "type": "ObjectProperty", "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -45,9 +48,6 @@ "type": "Identifier", "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -68,11 +68,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json index f2543aba9796..202c66fd718e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ - "SyntaxError: Argument name clash (1:47)" + "SyntaxError: Argument name clash. (1:47)" ], "program": { "type": "Program", @@ -43,6 +43,9 @@ { "type": "ObjectProperty", "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -55,9 +58,6 @@ "type": "Identifier", "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -91,6 +91,9 @@ { "type": "ObjectProperty", "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -103,9 +106,6 @@ "type": "Identifier", "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -131,11 +131,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/283/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/283/options.json index daa827f45cc4..391497d6bd30 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/283/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/283/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:5)" -} + "throws": "Rest element must be last element. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json index dba83d09de2a..0ff35d7ffd50 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in array destructuring pattern (1:3)" + "SyntaxError: Binding invalid left-hand side in array destructuring pattern. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json index 38f67c246355..fd19040ec7fe 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:5)" + "SyntaxError: Binding 'eval' in strict mode. (1:5)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":30,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":30}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -49,21 +53,17 @@ "value": { "type": "DirectiveLiteral", "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json index 2eb965567548..576ab926a31d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:23)" + "SyntaxError: Invalid escape sequence in template. (1:23)" ], "program": { "type": "Program", @@ -53,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json index c87a88a757b7..7adba9d695e4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: 'import' and 'export' may only appear at the top level (1:7)", + "SyntaxError: 'import' and 'export' may only appear at the top level. (1:7)", "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:7)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json index 8515329a04e1..657451b675f7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json index 16f6411a562b..242bb03d55f1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:1)" + "SyntaxError: Binding 'eval' in strict mode. (1:1)" ], "program": { "type": "Program", @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json index 86c9ce21554e..8fed881cf7ae 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Object pattern can't contain getter or setter (1:7)" + "SyntaxError: Object pattern can't contain getter or setter. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json index 95055f68cba7..11ec4c55d669 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Complex binding patterns require an initialization value (1:7)" + "SyntaxError: 'Complex binding patterns' require an initialization value. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json index 357a7e282e79..a0786140dea4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Complex binding patterns require an initialization value (1:7)" + "SyntaxError: 'Complex binding patterns' require an initialization value. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/326/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/326/options.json index 1c52234e7300..ea2bbc40d551 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/326/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/326/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected character '𖫵' (1:5)" -} + "throws": "Unexpected character '𖫵'. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/327/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/327/options.json index d7f3878c90ad..9ed1109e6bfc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/327/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/327/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected character '𫠞' (1:4)" -} + "throws": "Unexpected character '𫠞'. (1:4)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/328/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/328/output.json index 71a9cb4c6532..bdbad128f1b5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/328/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/328/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Missing semicolon (1:10)" + "SyntaxError: Missing semicolon. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json index 7e613e65e9f4..7b2b380b0457 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:9)" + "SyntaxError: Lexical declaration cannot appear in a single-statement context. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json index c604d5892ae5..f174e1971588 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:18)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:18)" ], "program": { "type": "Program", @@ -47,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json index 56ed13d09fb8..563333c577a8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:4)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json index 0f3359c66524..217b5aadf919 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json index 7cde5ed76296..655bd6b7daad 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: super is only allowed in object methods and classes (1:0)", - "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (1:0)" + "SyntaxError: 'super' is only allowed in object methods and classes. (1:0)", + "SyntaxError: 'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]). (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json index 875ae6923bec..640b9ec9428e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (1:10)" + "SyntaxError: A 'set' accesor must have exactly one formal parameter. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json index e976347b716a..16b020830ecd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:17)" + "SyntaxError: Redefinition of __proto__ property. (1:17)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":31,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":31}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -59,11 +63,7 @@ "value": 2 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json index f3676a82d6ff..822c188c2857 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:19)" + "SyntaxError: Redefinition of __proto__ property. (1:19)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -63,11 +67,7 @@ "value": 2 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json index ba52d9ef6dd4..1d06dc3c2087 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:0)" + "SyntaxError: Unexpected reserved word 'await'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json index a178730ecfdb..dcc0372387b4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:6)" + "SyntaxError: Unexpected reserved word 'await'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json index f36b09894784..38cb64a14328 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:8)" + "SyntaxError: Unexpected reserved word 'await'. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json index 0c3cf49c0481..33eb4cdaeb15 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:15)" + "SyntaxError: Unexpected reserved word 'await'. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json index 23b41eb517f9..22732ae45a83 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:9)" + "SyntaxError: Unexpected reserved word 'await'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json index 5473a1cc88a4..8395dc8c7dd3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:6)" + "SyntaxError: Unexpected reserved word 'await'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json index 600dd2bbb964..f3fe7929ce9a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:0)" + "SyntaxError: Unexpected reserved word 'enum'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json index 5dcad3446852..72d795836275 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:0)" + "SyntaxError: Unexpected reserved word 'enum'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json index 58ec7c24759d..72b30659a54c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Binding member expression (1:2)" + "SyntaxError: Binding member expression. (1:2)" ], "program": { "type": "Program", @@ -32,12 +32,12 @@ "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } } ] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json index d702eecd622a..b02c959fc124 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)" + "SyntaxError: Unexpected reserved word 'enum'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json index 4333b93e5890..6237ee1e9867 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)" + "SyntaxError: Unexpected reserved word 'enum'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json index 6521ee477c9a..61c6bc52d5be 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:8)" + "SyntaxError: Unexpected reserved word 'enum'. (1:8)" ], "program": { "type": "Program", @@ -24,6 +24,9 @@ { "type": "ObjectProperty", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +39,6 @@ "type": "Identifier", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json index dfeea9b4cd37..c62b02696f84 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:8)" + "SyntaxError: Unexpected reserved word 'enum'. (1:8)" ], "program": { "type": "Program", @@ -24,6 +24,9 @@ { "type": "ObjectProperty", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,9 +39,6 @@ "type": "Identifier", "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json index 19654730cb8b..4dfbf4c880ce 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:15)" + "SyntaxError: Unexpected reserved word 'enum'. (1:15)" ], "program": { "type": "Program", @@ -28,6 +28,9 @@ { "type": "ObjectProperty", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -40,9 +43,6 @@ "type": "Identifier", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json index f01eb7211de7..2a8a6c47c5a6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:15)" + "SyntaxError: Unexpected reserved word 'enum'. (1:15)" ], "program": { "type": "Program", @@ -28,6 +28,9 @@ { "type": "ObjectProperty", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -40,9 +43,6 @@ "type": "Identifier", "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" - }, - "extra": { - "shorthand": true } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json index 322f8bc8c738..c8f0ca3f04de 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:9)" + "SyntaxError: Unexpected reserved word 'enum'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json index 4b207d606d1a..e4d4bb0fbe73 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:9)" + "SyntaxError: Unexpected reserved word 'enum'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json index c7c70afe77b1..f95440b91bc2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)" + "SyntaxError: Unexpected reserved word 'enum'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json index 168f8d9cc006..5add414fc0b1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)" + "SyntaxError: Unexpected reserved word 'enum'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json index 58ec7c24759d..72b30659a54c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Binding member expression (1:2)" + "SyntaxError: Binding member expression. (1:2)" ], "program": { "type": "Program", @@ -32,12 +32,12 @@ "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" - }, - "computed": false + } } ] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json index ced2dbfb6771..10d76f56d8bd 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (2:11)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (2:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json index 0026ac0e9383..1f7662c71174 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:11)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json index 8b8e3b1ff8ae..fd3cfcac388e 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'yield' in strict mode (1:9)" + "SyntaxError: Binding 'yield' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json index bd1a0267017c..42b9092c1a12 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (2:9)" + "SyntaxError: Unexpected reserved word 'yield'. (2:9)" ], "program": { "type": "Program", @@ -36,11 +36,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-global-scope/output.json b/packages/babel-parser/test/fixtures/es2015/yield/in-global-scope/output.json index 2a5530c8fc99..7ae9d38804d5 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/in-global-scope/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/in-global-scope/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + "SyntaxError: Missing semicolon. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json b/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json index 45281e703a8d..fb03bb79b201 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/in-plain-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Missing semicolon (1:20)" + "SyntaxError: Missing semicolon. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json index 77197bbbb687..62e3c4be4cb9 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:7)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json index b6212ca370e7..53b076d984d1 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:15)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json index 92abf570fec1..7fa1c684e927 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:7)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json index a9f7f41d1765..a012426f5dea 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:17)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json index 8b2983892bd4..8bb05b378453 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:8)", - "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:8)", + "SyntaxError: Binding invalid left-hand side in function parameter list. (2:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json index 8c51b841eecd..9dfb9b4ea9f8 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:8)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json index 098f7106d0b2..a1df12479be0 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:15)" + "SyntaxError: Yield expression is not allowed in formal parameters. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json index bc481c3d0271..c53038266922 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:17)" + "SyntaxError: Yield expression is not allowed in formal parameters. (1:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json index edd07f81cc72..c80b95aa82ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (2:16)" + "SyntaxError: Unexpected reserved word 'yield'. (2:16)" ], "program": { "type": "Program", @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json index f84aed5d2e6d..1e8a17759196 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:3)", - "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:3)", + "SyntaxError: Binding invalid left-hand side in function parameter list. (2:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json index 0599a5ca99f6..92ea4d52a99c 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:3)", - "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:3)", + "SyntaxError: Binding invalid left-hand side in function parameter list. (2:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json index 9487db4a5868..d5289ad2ff3b 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (2:9)", - "SyntaxError: Binding invalid left-hand side in function parameter list (2:9)" + "SyntaxError: Yield expression is not allowed in formal parameters. (2:9)", + "SyntaxError: Binding invalid left-hand side in function parameter list. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json index 94529c93e1bf..dbd2ad8bb6e7 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:11)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:11)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -45,11 +49,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json index e26adaef5ce4..1b93417cb3ed 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:13)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json index a5d721d8ece0..e62c0c6f3044 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'yield' in strict mode (1:12)" + "SyntaxError: Binding 'yield' in strict mode. (1:12)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json index e6116f716d19..9c8fcbc47682 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (2:12)" + "SyntaxError: Unexpected reserved word 'yield'. (2:12)" ], "program": { "type": "Program", @@ -42,11 +42,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json index 180112bb930e..36f203d04e61 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:17)", - "SyntaxError: Yield expression is not allowed in formal parameters (1:24)" + "SyntaxError: Yield expression is not allowed in formal parameters. (1:17)", + "SyntaxError: Yield expression is not allowed in formal parameters. (1:24)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json index d034afbc9b42..6a5e1e7dc3bb 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ], "program": { "type": "Program", @@ -58,11 +58,11 @@ "value": { "type": "DirectiveLiteral", "start":42,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json index 35fd2a0adb9e..4c980e3e7d6d 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ], "program": { "type": "Program", @@ -49,11 +49,11 @@ "value": { "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json index e10dbf8aa28a..267844b65050 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:8)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:8)" ], "program": { "type": "Program", @@ -55,11 +55,11 @@ "value": { "type": "DirectiveLiteral", "start":30,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json index 2b90608b4c2a..0b4fa77f298d 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:8)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:8)" ], "program": { "type": "Program", @@ -55,11 +55,11 @@ "value": { "type": "DirectiveLiteral", "start":36,"end":48,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json index 7e82b95fea8c..30e5e501a737 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ], "program": { "type": "Program", @@ -47,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":35,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json index f07a72ed5d2f..b9fe0aeb2529 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ], "program": { "type": "Program", @@ -47,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":29,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json index a75e2062efad..6664283642e2 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ], "program": { "type": "Program", @@ -47,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":30,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json index 2838eba94dbe..bd122e3c980b 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (2:5)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (2:5)" ], "program": { "type": "Program", @@ -67,11 +67,11 @@ "value": { "type": "DirectiveLiteral", "start":38,"end":50,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json index 496683da2364..ddd14f6955a5 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (2:3)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (2:3)" ], "program": { "type": "Program", @@ -67,11 +67,11 @@ "value": { "type": "DirectiveLiteral", "start":36,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json index ce4565e35ae4..44c366ac4dd8 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ], "program": { "type": "Program", @@ -31,6 +31,9 @@ { "type": "ObjectProperty", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -43,14 +46,14 @@ "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -63,9 +66,6 @@ "type": "Identifier", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" - }, - "extra": { - "shorthand": true } } ] @@ -88,11 +88,11 @@ "value": { "type": "DirectiveLiteral", "start":42,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json index c51370c9d607..5e2c92a1add0 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ], "program": { "type": "Program", @@ -28,6 +28,9 @@ { "type": "ObjectProperty", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -40,14 +43,14 @@ "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -60,9 +63,6 @@ "type": "Identifier", "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" - }, - "extra": { - "shorthand": true } } ] @@ -79,11 +79,11 @@ "value": { "type": "DirectiveLiteral", "start":37,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json index 6287e339526c..fad417168b04 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" + "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list. (1:0)" ], "program": { "type": "Program", @@ -42,11 +42,11 @@ "value": { "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json index 690e665a2c86..2128d0bb7082 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:9)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json index e2758e5bab29..45e050fa0700 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-array-pattern-nested/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:11)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json index 984ab4dbde4c..cda35a9ea07d 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-identifier/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:18)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json index 9afdf9f5fa55..3619f0e23dd6 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-member-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: Binding member expression (1:9)" + "SyntaxError: Binding member expression. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json index 2113ddb5a8da..5b69a068d2dd 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-binding-pattern/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:19)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:19)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json index 0d501cde269f..753ce2f874bb 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-array/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:22)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json index 66f60ce4f6af..e7bb475db2f1 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-arrow/parenthesized-rest-object/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:22)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json index 78391ab5a0e9..1119a9c3cf41 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: await* has been removed from the async functions proposal. Use Promise.all() instead. (2:2)" + "SyntaxError: 'await*' has been removed from the async functions proposal. Use Promise.all() instead. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/9/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/9/output.json index 27d691134ed7..f6547d7dd2bb 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/9/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/9/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (1:24)" + "SyntaxError: 'await' is only allowed within async functions. (1:24)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function-throw/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function-throw/output.json index 8f13d165a4be..53172c32feb4 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function-throw/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function-throw/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (2:9)" + "SyntaxError: 'await' is only allowed within async functions. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json index 09b554179dcb..c5e8a96d160a 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:6)" + "SyntaxError: Can not use 'await' as identifier inside an async function. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json index db893c17265e..1db7ecbfb996 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:16)" + "SyntaxError: Can not use 'await' as identifier inside an async function. (1:16)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"await"}, @@ -29,10 +33,6 @@ "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json index eda5cd44dbcc..4dee66c3f30d 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:14)" + "SyntaxError: Can not use 'await' as identifier inside an async function. (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json index 1f579129c72b..5292cb4420c7 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (2:11)" + "SyntaxError: Can not use 'await' as identifier inside an async function. (2:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json index 9f22c79e0538..7f8ae424e182 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: await is not allowed in async function parameters (2:23)" + "SyntaxError: 'await' is not allowed in async function parameters. (2:23)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-expression-disallowed/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-expression-disallowed/output.json index 506ce33b909e..bef671389491 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-expression-disallowed/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-expression-disallowed/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (1:8)" + "SyntaxError: 'await' is only allowed within async functions. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/output.json index 287f8eae4418..c770316cbe7b 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-async-arrow-function/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (1:11)", - "SyntaxError: await is not allowed in async function parameters (1:11)" + "SyntaxError: 'await' is only allowed within async functions. (1:11)", + "SyntaxError: 'await' is not allowed in async function parameters. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json index 9f925a342f48..7a891987aa17 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: await is not allowed in async function parameters (2:7)" + "SyntaxError: 'await' is not allowed in async function parameters. (2:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json index e24dce562a95..7b67988770d2 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: await is not allowed in async function parameters (2:13)" + "SyntaxError: 'await' is not allowed in async function parameters. (2:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-function/output.json index 444930868eef..88e1bc9f5479 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-function/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (2:19)", - "SyntaxError: await is not allowed in async function parameters (2:19)" + "SyntaxError: 'await' is only allowed within async functions. (2:19)", + "SyntaxError: 'await' is not allowed in async function parameters. (2:19)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json index fcf89fb5daef..d53424d1d79c 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: await is not allowed in async function parameters (1:22)" + "SyntaxError: 'await' is not allowed in async function parameters. (1:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json index cd71c7cea376..cd729a260b5f 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-await-with-object-exp-in-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (2:2)" + "SyntaxError: 'await' is only allowed within async functions. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json index 7a8990917905..21b6c7bcf5e8 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:20)", - "SyntaxError: Missing semicolon (1:30)" + "SyntaxError: Can not use 'await' as identifier inside an async function. (1:20)", + "SyntaxError: Missing semicolon. (1:30)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/output.json index 93d68bf0ca6a..00903880bc9e 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Missing semicolon (1:25)", - "SyntaxError: 'await' is only allowed within async functions (1:41)" + "SyntaxError: Missing semicolon. (1:25)", + "SyntaxError: 'await' is only allowed within async functions. (1:41)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/output.json index 66a170b05abf..54158dd70d73 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Missing semicolon (1:10)", - "SyntaxError: 'await' is only allowed within async functions (1:18)" + "SyntaxError: Missing semicolon. (1:10)", + "SyntaxError: 'await' is only allowed within async functions. (1:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json index 139be62a2f65..9183f133d617 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Async functions can only be declared at the top level or inside a block (1:10)" + "SyntaxError: Async functions can only be declared at the top level or inside a block. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json index 456b35386a38..06982744a5c7 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + "SyntaxError: Missing semicolon. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json index a110b8160114..2a05490d1335 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/multiple-await-in-async-arrow-params/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:15)", - "SyntaxError: Can not use 'await' as identifier inside an async function (1:30)" + "SyntaxError: Can not use 'await' as identifier inside an async function. (1:15)", + "SyntaxError: Can not use 'await' as identifier inside an async function. (1:30)" ], "program": { "type": "Program", @@ -124,4 +124,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/newline-before-arrow/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/newline-before-arrow/output.json index 19ade021f45f..9a441fbf4d19 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/newline-before-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/newline-before-arrow/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "errors": [ - "SyntaxError: No line break is allowed before '=>' (2:2)" + "SyntaxError: No line break is allowed before '=>'. (2:2)" ], "program": { "type": "Program", @@ -36,4 +36,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json index abbe3abb2682..9e82c1df4bfe 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Constructor can't be an async function (2:8)" + "SyntaxError: Constructor can't be an async function. (2:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json index 630b3e12ebc1..dcda7efa36e3 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected trailing comma after rest element (1:11)" + "SyntaxError: Unexpected trailing comma after rest element. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json index 8b4d3abd36f3..a9717bd23e01 100644 --- a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json +++ b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/5/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Unexpected token ',' (1:5)" + "SyntaxError: Unexpected token ','. (1:5)" ], "program": { "type": "Program", @@ -16,14 +16,14 @@ "expression": { "type": "CallExpression", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, + "extra": { + "trailingComma": 4 + }, "callee": { "type": "Identifier", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"log"}, "name": "log" }, - "extra": { - "trailingComma": 4 - }, "arguments": [ null ] diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json index 9107e6623d36..0d9f06020dff 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:23)", + "SyntaxError: Identifier 'foo' has already been declared. (2:23)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:23)" ], "program": { @@ -61,6 +61,9 @@ { "type": "ObjectProperty", "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -73,9 +76,6 @@ "type": "Identifier", "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"bar"}, "name": "bar" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json index ff6a186270d8..cc18e282401b 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ - "SyntaxError: Identifier 'bar' has already been declared (2:13)", + "SyntaxError: Identifier 'bar' has already been declared. (2:13)", "SyntaxError: `bar` has already been exported. Exported identifiers must be unique. (2:13)" ], "program": { @@ -30,6 +30,9 @@ { "type": "ObjectProperty", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -42,9 +45,6 @@ "type": "Identifier", "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json index 4488d18649b4..122a80e43758 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":44}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:30)", + "SyntaxError: Identifier 'foo' has already been declared. (2:30)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:30)" ], "program": { @@ -76,6 +76,9 @@ { "type": "ObjectProperty", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -88,9 +91,6 @@ "type": "Identifier", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json index e3429dd5577b..922118de7a3e 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":42}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:29)", + "SyntaxError: Identifier 'foo' has already been declared. (2:29)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:29)" ], "program": { @@ -70,6 +70,9 @@ { "type": "ObjectProperty", "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -82,9 +85,6 @@ "type": "Identifier", "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"baz"}, "name": "baz" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json index ebce9c22593d..2d3704afc977 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":44}}, "errors": [ - "SyntaxError: Identifier 'foo' has already been declared (2:30)", + "SyntaxError: Identifier 'foo' has already been declared. (2:30)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:30)" ], "program": { @@ -74,6 +74,9 @@ { "type": "ObjectProperty", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -86,9 +89,6 @@ "type": "Identifier", "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" - }, - "extra": { - "shorthand": true } }, { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json index 5f904177a72c..008f56a84bcc 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid rest operator's argument (1:5)" + "SyntaxError: Invalid rest operator's argument. (1:5)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -36,10 +40,6 @@ "type": "ObjectExpression", "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json index 53d79afbca84..014745238619 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Invalid rest operator's argument (1:5)" + "SyntaxError: Invalid rest operator's argument. (1:5)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -49,10 +53,6 @@ "type": "ObjectExpression", "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json index 95a5979a014e..a6c57e547a33 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid rest operator's argument (1:5)" + "SyntaxError: Invalid rest operator's argument. (1:5)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -36,10 +40,6 @@ "type": "ObjectExpression", "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/7/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/7/options.json index b86f80dc4a72..d2abaaa1d24c 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/7/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/7/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:10)" -} + "throws": "Rest element must be last element. (1:10)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json index 507c8b34b2b7..2643b6ca98ee 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Unexpected trailing comma after rest element (1:16)" + "SyntaxError: Unexpected trailing comma after rest element. (1:16)" ], "program": { "type": "Program", @@ -20,10 +20,16 @@ "id": { "type": "ObjectPattern", "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, + "extra": { + "trailingComma": 16 + }, "properties": [ { "type": "ObjectProperty", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -36,14 +42,14 @@ "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" - }, - "extra": { - "shorthand": true } }, { "type": "ObjectProperty", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -56,9 +62,6 @@ "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" - }, - "extra": { - "shorthand": true } }, { @@ -70,10 +73,7 @@ "name": "z" } } - ], - "extra": { - "trailingComma": 16 - } + ] }, "init": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/9/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/9/options.json index e9effa60cb30..7d618d0fb27e 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/9/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/9/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:13)" -} + "throws": "Rest element must be last element. (1:13)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-rest/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-rest/options.json index 935d087d7ee5..dfc19ace341a 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-rest/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-rest/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:6)" -} + "throws": "Rest element must be last element. (1:6)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json index b86f80dc4a72..d2abaaa1d24c 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:10)" -} + "throws": "Rest element must be last element. (1:10)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json index 935d087d7ee5..dfc19ace341a 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:6)" -} + "throws": "Rest element must be last element. (1:6)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/expression-rest-not-last-invalid/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/expression-rest-not-last-invalid/options.json index b708967fd223..7153dafad063 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/expression-rest-not-last-invalid/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/expression-rest-not-last-invalid/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:2)" -} + "throws": "Rest element must be last element. (1:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal/output.json index 65fe5c762cc1..d17ec09be3b8 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid BigIntLiteral (1:0)" + "SyntaxError: Invalid BigIntLiteral. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/output.json index ece9adc5b936..5fc72c71fb6d 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid BigIntLiteral (1:0)" + "SyntaxError: Invalid BigIntLiteral. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/output.json index c7ff73f0e76a..0adf4cbfbae5 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid BigIntLiteral (1:0)" + "SyntaxError: Invalid BigIntLiteral. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/output.json index 8f1e2836cd40..e64846e6c745 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid BigIntLiteral (1:0)" + "SyntaxError: Invalid BigIntLiteral. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json index 2a5318f72b14..674300a4af42 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: The only valid meta property for import is import.meta (2:16)" + "SyntaxError: The only valid meta property for import is import.meta. (2:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json index 11c9e8f7db62..f9875e9533b5 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: ... is not allowed in import() (1:7)" + "SyntaxError: `...` is not allowed in `import()`. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json index 246d3d373cb5..f36c653dc6a4 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Cannot use new with import(...) (1:4)" + "SyntaxError: Cannot use new with import(...). (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json index 6e5fa8365696..1f818955c220 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Trailing comma is disallowed inside import(...) arguments (1:12)" + "SyntaxError: Trailing comma is disallowed inside import(...) arguments. (1:12)" ], "program": { "type": "Program", @@ -16,13 +16,13 @@ "expression": { "type": "CallExpression", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, + "extra": { + "trailingComma": 12 + }, "callee": { "type": "Import", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}} }, - "extra": { - "trailingComma": 12 - }, "arguments": [ { "type": "StringLiteral", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json index 0c67a4f67b22..547e594400c1 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: import() requires exactly one argument (1:0)" + "SyntaxError: `import()` requires exactly one argument. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json index fe2978c702f4..3455666fb962 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: import() requires exactly one argument (1:0)" + "SyntaxError: `import()` requires exactly one argument. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/import-meta/no-other-prop-names/output.json b/packages/babel-parser/test/fixtures/es2020/import-meta/no-other-prop-names/output.json index c03b9e7046c7..d768827ed024 100644 --- a/packages/babel-parser/test/fixtures/es2020/import-meta/no-other-prop-names/output.json +++ b/packages/babel-parser/test/fixtures/es2020/import-meta/no-other-prop-names/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: The only valid meta property for import is import.meta (1:7)" + "SyntaxError: The only valid meta property for import is import.meta. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/import-meta/not-assignable/output.json b/packages/babel-parser/test/fixtures/es2020/import-meta/not-assignable/output.json index 5e1510e58fe0..784ab2d1b421 100644 --- a/packages/babel-parser/test/fixtures/es2020/import-meta/not-assignable/output.json +++ b/packages/babel-parser/test/fixtures/es2020/import-meta/not-assignable/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/options.json index 8b9f24dff59d..f41119306e7f 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/options.json @@ -1,4 +1,6 @@ { - "plugins": ["estree"], - "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:7)" -} + "plugins": [ + "estree" + ], + "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators. (1:7)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/options.json index 75afb6e1feec..0e2b52f72d81 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/options.json @@ -1,3 +1,3 @@ { - "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:7)" -} + "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators. (1:7)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/options.json index 9fed7e79262b..0a3e47191210 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/options.json @@ -1,3 +1,3 @@ { - "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:12)" -} + "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators. (1:12)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/options.json index 8b9f24dff59d..f41119306e7f 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/options.json @@ -1,4 +1,6 @@ { - "plugins": ["estree"], - "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:7)" -} + "plugins": [ + "estree" + ], + "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators. (1:7)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json index c5497bf4eb8d..661de509183e 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: constructors in/after an Optional Chain are not allowed (1:10)" + "SyntaxError: Constructors in/after an Optional Chain are not allowed. (1:10)" ], "program": { "type": "Program", @@ -27,20 +27,20 @@ "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"C"}, "name": "C" }, + "computed": false, "property": { "type": "Identifier", "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true }, + "computed": false, "property": { "type": "Identifier", "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"d"}, "name": "d" }, - "computed": false, "optional": false }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json index 5039bd06d927..8417ccf0b434 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: constructors in/after an Optional Chain are not allowed (1:7)" + "SyntaxError: Constructors in/after an Optional Chain are not allowed. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json index dc31af9de392..721b905ba729 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:15)" + "SyntaxError: 'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]). (3:15)" ], "program": { "type": "Program", @@ -52,12 +52,12 @@ "type": "Super", "start":33,"end":38,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, + "computed": false, "property": { "type": "Identifier", "start":40,"end":41,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":23},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json index 393e2fd7451f..f7df43f0a54b 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:15)" + "SyntaxError: 'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]). (3:15)" ], "program": { "type": "Program", @@ -55,12 +55,12 @@ "type": "Super", "start":36,"end":41,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, + "computed": false, "property": { "type": "Identifier", "start":43,"end":44,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":23},"identifierName":"c"}, "name": "c" }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json index 344f3d26b695..618740e1fe33 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Tagged Template Literals are not allowed in optionalChain (1:0)" + "SyntaxError: Tagged Template Literals are not allowed in optionalChain. (1:0)" ], "program": { "type": "Program", @@ -24,12 +24,12 @@ "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, + "computed": false, "property": { "type": "Identifier", "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" }, - "computed": false, "optional": true }, "quasi": { diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-0/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-0/output.json index f71e62cf63d4..1b3de6fd78e7 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-0/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-0/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:1)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-1/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-1/output.json index a685b94be015..366cedac443b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-1/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-10/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-10/output.json index c32319f375dd..181f4495024c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-10/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-10/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-100/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-100/output.json index 7ee60b71ca15..ffd351eb05d6 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-100/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-100/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-101/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-101/output.json index 242847410a0f..eba452df48b1 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-101/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-101/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-102/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-102/output.json index aedcced6b5b5..787c07876257 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-102/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-102/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-103/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-103/output.json index 6fc9be0b380a..643bf659309c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-103/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-103/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-104/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-104/output.json index fa1525dea3eb..12cd05d58c3f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-104/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-104/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-105/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-105/output.json index 8c94785d66b3..73318e366c46 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-105/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-105/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-106/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-106/output.json index 83b95a090610..6a05a7e365a2 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-106/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-106/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-107/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-107/output.json index fcf5f8cc4e08..71052b871a5f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-107/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-107/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-108/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-108/output.json index fac7984d5639..12f9f73bdd5e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-108/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-108/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-109/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-109/output.json index 245a9416a843..c2985d1aea4d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-109/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-109/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-11/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-11/output.json index 3ce69cd5a8b1..83d469853745 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-11/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-11/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-110/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-110/output.json index 1694c85af975..f700f4bfdccd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-110/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-110/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-111/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-111/output.json index e033ff3657a7..513e074fcb12 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-111/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-111/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-112/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-112/output.json index 5aebc0f50b72..9f5df9003955 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-112/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-112/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-113/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-113/output.json index e8db639c568a..b1018ffb9e0a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-113/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-113/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-114/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-114/output.json index 9d692b713f67..4e074641234e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-114/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-114/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-115/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-115/output.json index 0b12f49112ee..ea39218d6cff 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-115/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-115/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-116/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-116/output.json index 2629abd0deed..82113efbf560 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-116/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-116/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-117/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-117/output.json index f6817e0b226a..c13983600eb1 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-117/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-117/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-118/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-118/output.json index 1a2378d0b09f..721494c6008c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-118/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-118/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-119/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-119/output.json index fce3fc757812..28c0cb432917 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-119/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-119/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-12/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-12/output.json index 6900ec7205d8..249938fd8aea 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-12/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-12/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-120/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-120/output.json index 987d9624eb59..c28ea6da472a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-120/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-120/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-121/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-121/output.json index 6fd12b2edcec..cb48d13ec97f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-121/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-121/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-122/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-122/output.json index 004e40f97bb0..0954b1fe924b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-122/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-122/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-123/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-123/output.json index 2fcbd10c8038..f3fcc312375e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-123/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-123/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-124/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-124/output.json index cd4cd6ffeb61..89e230aef17d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-124/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-124/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-125/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-125/output.json index a6ea0dbbc145..c1a4c0e47ab1 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-125/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-125/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-126/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-126/output.json index 4e0a0023c3b5..edcc73de4d07 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-126/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-126/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-127/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-127/output.json index 01995ddd7541..5c99ba7837fc 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-127/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-127/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-128/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-128/output.json index 58bb3e5decf4..3797d39fe54d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-128/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-128/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-129/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-129/output.json index 54d3a1050e08..0f3a0c41c7a1 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-129/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-129/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-13/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-13/output.json index ded88989d1ad..47a225c02bcd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-13/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-13/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-130/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-130/output.json index 6eb72f741765..7f31e5ef9b01 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-130/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-130/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-131/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-131/output.json index f97788382071..3b024f7a152e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-131/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-131/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-132/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-132/output.json index bf350c9fd06a..c560f30f2365 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-132/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-132/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-133/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-133/output.json index e06df9501114..94374d82c60e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-133/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-133/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-134/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-134/output.json index bb0df5540a94..f81829ac7460 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-134/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-134/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-135/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-135/output.json index 4484f2592a62..90a55a002d9e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-135/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-135/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-136/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-136/output.json index 5b86c977671a..8435224ca417 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-136/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-136/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-137/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-137/output.json index 0a7efd31a5f0..acefe9a9073d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-137/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-137/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-138/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-138/output.json index 7e5e1b87de3d..0ab97999687e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-138/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-138/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-139/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-139/output.json index a904876ecc6b..7ef3c8ccfe86 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-139/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-139/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-14/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-14/output.json index 9b87ecd61c19..b56f4eb4959f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-14/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-14/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-140/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-140/output.json index 09eda4f99df0..9feecbfaf364 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-140/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-140/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-141/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-141/output.json index 1fa9b9b565c7..386fcb8901cf 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-141/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-141/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-142/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-142/output.json index ab2be9d065cc..816844e59bc0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-142/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-142/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-143/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-143/output.json index 2f01f1cdfce4..545403bf4fb5 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-143/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-143/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-144/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-144/output.json index 19996c619dbd..eb3d8572e4a7 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-144/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-144/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-145/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-145/output.json index 73d0352df20d..bc5a8f326381 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-145/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-145/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-146/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-146/output.json index 26e13a153248..b3077e9a9d4e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-146/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-146/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-147/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-147/output.json index 21d200a0d6d5..d8ac9dce81e9 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-147/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-147/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-15/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-15/output.json index c0679de758a8..300712206179 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-15/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-15/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-16/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-16/output.json index 67f7f4463321..13ae7cbab703 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-16/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-16/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-17/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-17/output.json index e641715002d1..6075127bf29c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-17/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-17/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-18/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-18/output.json index c9862c7c7459..a849e9fa2a46 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-18/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-18/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-19/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-19/output.json index 59ef8dcfe7df..b1a6ed21cd8e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-19/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-19/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-2/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-2/output.json index 259a3f3a14a0..acb1c5f50109 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-2/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-20/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-20/output.json index f83fa6ea3e6d..fafb53f0f3b5 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-20/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-20/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-21/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-21/output.json index 7390d0e73cb8..c17b666457c2 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-21/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-21/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-22/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-22/output.json index f3aadce6c706..1fc7013eb2d4 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-22/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-22/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-23/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-23/output.json index 482160a3f26d..d0b3f7e56dbd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-23/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-23/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-25/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-25/output.json index ea8fc8c204fb..db33e48043e5 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-25/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-25/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: Expected number in radix 8 (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: Expected number in radix 8. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-26/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-26/output.json index 9a263fd785be..067e49837def 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-26/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-26/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-27/options.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-27/options.json index ee18527964e7..8ca0a88b1023 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-27/options.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-27/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:2)" -} + "throws": "Identifier directly after number. (1:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-28/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-28/output.json index 4fa0a1810fd5..8eb9a3bc0a40 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-28/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-28/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:1)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-29/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-29/output.json index 0d67691d81ba..77cb93b11735 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-29/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-29/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-3/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-3/output.json index 872895190ff4..419c2cca2616 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-3/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-3/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:1)", - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:1)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-30/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-30/output.json index 1743eab00fbd..95f875d5f335 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-30/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-30/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-31/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-31/output.json index 836a76bd99c4..ef46a0ca059b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-31/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-31/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:1)", - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:1)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-32/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-32/output.json index e9cfbc456cb3..982dd6b1436c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-32/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-32/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-33/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-33/output.json index 0e74e29feaae..ee708019ba17 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-33/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-33/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-34/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-34/output.json index 269b48e7fb28..1d285af39447 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-34/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-34/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-35/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-35/output.json index d9086f100064..46018a8e167a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-35/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-35/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-36/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-36/output.json index 12858208a0d3..050bff84cbc0 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-36/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-36/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-37/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-37/output.json index 2128458509f4..e24d687c8b44 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-37/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-37/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-38/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-38/output.json index 195c69a6e0d1..bc55cd031d27 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-38/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-38/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-39/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-39/output.json index 98b20b22a343..814e9411040b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-39/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-39/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-4/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-4/output.json index 96e6972816cb..3b6ce34b2d64 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-4/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-40/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-40/output.json index bae33528af8b..20833f1547d5 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-40/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-40/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-41/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-41/output.json index e08b97681236..f6f272194fcd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-41/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-41/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-42/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-42/output.json index 17b25f9fb301..8bbcb7524730 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-42/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-42/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-43/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-43/output.json index 37fb1b9d9006..5305b1b455fd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-43/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-43/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-44/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-44/output.json index 0c576d51f4f7..e7c362896a7c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-44/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-44/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-45/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-45/output.json index f26f8dd544e9..25169cec7c1f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-45/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-45/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-46/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-46/output.json index c721e170501c..3016f43e8c4e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-46/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-46/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-47/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-47/output.json index 32b05f9776a4..dcac1aefde5f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-47/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-47/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-48/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-48/output.json index 370cad5f22d0..086e43c26f11 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-48/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-48/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-49/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-49/output.json index 7302b58872fe..7804c3bb86be 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-49/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-49/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-5/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-5/output.json index 104bab8bfb71..2af98f935d3d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-5/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-5/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-50/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-50/output.json index 1696b7203671..1ac5469534bd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-50/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-50/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-51/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-51/output.json index 4a170306f9d8..192e6de6cdb8 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-51/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-51/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-52/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-52/output.json index ef36209f39e2..b5bf59d077bd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-52/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-52/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:1)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-53/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-53/output.json index b59406105388..258a23a01472 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-53/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-53/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-54/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-54/output.json index a240786ccdd3..c9a11f07802e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-54/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-54/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-55/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-55/output.json index 327ca0646199..8bf821246d08 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-55/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-55/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:1)", - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:1)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-56/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-56/output.json index a1f3a2f79773..fa801a52f5bf 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-56/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-56/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-57/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-57/output.json index 5be8427a63dc..d41453e1d7fb 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-57/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-57/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-58/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-58/output.json index be530847849d..b86388367673 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-58/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-58/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-59/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-59/output.json index 8946a1d3dfa7..1f512d5350ba 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-59/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-59/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-6/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-6/output.json index 47194a33cc24..8f23341a71b6 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-6/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-6/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-60/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-60/output.json index 2fcf0f2e7170..ddc30d3f9a6c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-60/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-60/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-61/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-61/output.json index 7b94176ac8a8..c6e5c897b61c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-61/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-61/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-62/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-62/output.json index 9ccb458bc25c..67db4354849d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-62/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-62/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-63/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-63/output.json index 270a3c6f1257..d36a0ed62652 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-63/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-63/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-64/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-64/output.json index f11b9f23a562..afbb9273bb4b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-64/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-64/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-65/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-65/output.json index b115442a128e..7b3166d458fd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-65/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-65/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-66/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-66/output.json index 8460ef9ed922..446375db7cda 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-66/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-66/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-67/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-67/output.json index af0c11230973..ee2a94900ab3 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-67/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-67/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-68/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-68/output.json index b4baab71f704..7570c57e65d1 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-68/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-68/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-69/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-69/output.json index 67b40a81583e..d31613b5cf8b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-69/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-69/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-7/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-7/output.json index d332a8378d0b..27775ba14e1f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-7/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-7/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-70/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-70/output.json index 7e2e98b195ab..319404c81e4e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-70/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-70/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-71/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-71/output.json index 1e722211301b..046080cd4cda 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-71/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-71/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-72/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-72/output.json index b6fc5e3e25ec..846aacc84a5f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-72/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-72/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-73/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-73/output.json index 87cbb9e74aaf..513d584b27bb 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-73/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-73/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-74/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-74/output.json index e13589825cfd..8746c680e3d4 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-74/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-74/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-75/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-75/output.json index 99aaeee03660..b17c1efe92ad 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-75/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-75/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-76/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-76/output.json index 6a5210632fdb..73b3161c610e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-76/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-76/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-77/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-77/output.json index 3daf76e31921..3aa9011fe98c 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-77/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-77/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-78/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-78/output.json index 945775d56e14..b5cf5c21d3f9 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-78/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-78/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-79/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-79/output.json index 961a9442c741..7de5fac89b52 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-79/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-79/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:2)", - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:2)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-8/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-8/output.json index ac19c3b8fef1..4382d4ff81c4 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-8/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-8/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-80/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-80/output.json index 5ac02a810421..906cd599348d 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-80/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-80/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:4)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-81/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-81/output.json index f85156325dbc..eafd2ee027b2 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-81/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-81/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:5)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-82/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-82/output.json index 63db3421d887..60afde81c885 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-82/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-82/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-83/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-83/output.json index 34de6f803594..26cf0d1e78b7 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-83/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-83/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-84/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-84/output.json index bd892f5bef65..c0fba49fac3e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-84/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-84/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-85/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-85/output.json index 4ed7d8e9c017..a48816422ea1 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-85/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-85/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-86/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-86/output.json index 2038ff8d78f1..dd846e3ce27e 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-86/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-86/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-87/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-87/output.json index 593809dbd35d..6fcc8f5d8afb 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-87/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-87/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-88/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-88/output.json index 67a557a8d3eb..6006ae433be2 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-88/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-88/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-89/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-89/output.json index 8a9f3fe0cf90..c7cb0259cef9 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-89/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-89/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:4)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:4)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-9/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-9/output.json index 28cdddee6c6e..730f2f9872cd 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-9/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-9/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-90/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-90/output.json index a46838420e3c..761d0322dca9 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-90/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-90/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:5)", - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:5)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-91/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-91/output.json index a4f7ce2d86b8..e7c8a717003b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-91/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-91/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-92/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-92/output.json index 238b8d7eb92f..1a9cf669724f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-92/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-92/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-93/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-93/output.json index aca4cb9eaa84..2402a2f3cd77 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-93/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-93/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-94/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-94/output.json index 0f6ee969f91e..e1375d29458a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-94/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-94/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-95/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-95/output.json index ebeef35878ea..d06248901d2b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-95/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-95/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-96/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-96/output.json index 90ccb24c1270..b2964641ba61 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-96/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-96/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:8)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-97/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-97/output.json index d354fd52d7e1..a9a7a91c27b4 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-97/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-97/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-98/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-98/output.json index fb6a3801249c..c7a18e569e5b 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-98/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-98/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:6)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-99/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-99/output.json index a54bd3bbf50a..f6fa7430ba63 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-99/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-99/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: A numeric separator is only allowed between two digits (1:3)", - "SyntaxError: A numeric separator is only allowed between two digits (1:7)" + "SyntaxError: A numeric separator is only allowed between two digits. (1:3)", + "SyntaxError: A numeric separator is only allowed between two digits. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json index e0ca2b4b003e..36528253f571 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-hex/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:4)" + "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences. (1:4)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, - "value": "\\x1_0", "extra": { "raw": "\"\\x1_0\"", "rawValue": "\\x1_0" - } + }, + "value": "\\x1_0" } } ] diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-leading-zero/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-leading-zero/output.json index 1d2d8a1aa2ae..749dcece1953 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-leading-zero/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-leading-zero/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Numeric separator can not be used after leading 0 (1:1)" + "SyntaxError: Numeric separator can not be used after leading 0. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-legacy-octal-literal/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-legacy-octal-literal/output.json index 2571dfafd4f8..a2d15c5d7459 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-legacy-octal-literal/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-legacy-octal-literal/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Numeric separator can not be used after leading 0 (1:2)" + "SyntaxError: Numeric separator can not be used after leading 0. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int/output.json index 1c28d1ead346..2d12c448fa6f 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-non-octal-decimal-int/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Numeric separator can not be used after leading 0 (1:2)", - "SyntaxError: Invalid BigIntLiteral (1:0)" + "SyntaxError: Numeric separator can not be used after leading 0. (1:2)", + "SyntaxError: Invalid BigIntLiteral. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json index 8dbcd31afd33..e0f00b491946 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:5)" + "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences. (1:5)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, - "value": "\\u12_34", "extra": { "raw": "\"\\u12_34\"", "rawValue": "\\u12_34" - } + }, + "value": "\\u12_34" } } ] diff --git a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json index f7497689fd8d..c6b449b5b92a 100644 --- a/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json +++ b/packages/babel-parser/test/fixtures/es2021/numeric-separator/invalid-unicode/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:6)" + "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences. (1:6)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "\\u{1F_639}", "extra": { "raw": "\"\\u{1F_639}\"", "rawValue": "\\u{1F_639}" - } + }, + "value": "\\u{1F_639}" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json index 94ce8601abd3..55dc0237010e 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Argument name clash (1:14)" + "SyntaxError: Argument name clash. (1:14)" ], "program": { "type": "Program", @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json index cd41333b8b6a..c6c5f5c790f8 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Argument name clash (1:11)" + "SyntaxError: Argument name clash. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json index 2bcffbf3a427..39f993b2dadc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "errors": [ - "SyntaxError: Argument name clash (2:14)" + "SyntaxError: Argument name clash. (2:14)" ], "program": { "type": "Program", @@ -53,11 +53,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json index cc0e0ad645c9..8fbcd6303c34 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "errors": [ - "SyntaxError: Argument name clash (2:17)" + "SyntaxError: Argument name clash. (2:17)" ], "program": { "type": "Program", @@ -57,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json index 22f0d1704663..cadb9472d423 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ - "SyntaxError: Argument name clash (2:19)" + "SyntaxError: Argument name clash. (2:19)" ], "program": { "type": "Program", @@ -32,6 +32,9 @@ { "type": "ObjectProperty", "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, + "extra": { + "shorthand": true + }, "method": false, "key": { "type": "Identifier", @@ -44,9 +47,6 @@ "type": "Identifier", "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"a"}, "name": "a" - }, - "extra": { - "shorthand": true } } ] @@ -78,11 +78,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/options.json index daa827f45cc4..391497d6bd30 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/options.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-rest/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:5)" -} + "throws": "Rest element must be last element. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json index dfab13123cb4..b7579d117619 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Argument name clash (1:7)" + "SyntaxError: Argument name clash. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json index 54a0b8dc4637..29647d15f17b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Argument name clash (1:4)" + "SyntaxError: Argument name clash. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json index 3dcc69133bee..f1b868fe3538 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:0)" + "SyntaxError: Binding 'eval' in strict mode. (1:0)" ], "program": { "type": "Program", @@ -37,11 +37,11 @@ "value": { "type": "DirectiveLiteral", "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json index 9fb39c9ca6ef..61a859de8720 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-arrow/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json index 7aefdb8c93dc..f3ce571366a7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/non-arrow-param-followed-by-rest/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:2)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json index 2bdcc96c2d26..e2f132b0a071 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Binding member expression (1:4)" + "SyntaxError: Binding member expression. (1:4)" ], "program": { "type": "Program", @@ -43,6 +43,7 @@ "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" }, + "computed": true, "property": { "type": "NumericLiteral", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, @@ -51,8 +52,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json index 55af5740543d..3097e7bc80f0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Object pattern can't contain getter or setter (1:6)" + "SyntaxError: Object pattern can't contain getter or setter. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json index cb2922c87ca7..4daae96c370b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ - "SyntaxError: Binding member expression (1:24)" + "SyntaxError: Binding member expression. (1:24)" ], "program": { "type": "Program", @@ -123,6 +123,7 @@ "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"b"}, "name": "b" }, + "computed": true, "property": { "type": "NumericLiteral", "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27}}, @@ -131,8 +132,7 @@ "raw": "0" }, "value": 0 - }, - "computed": true + } } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json index 41ad542d8b26..a5a6d9c2b5f2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)" + "SyntaxError: Invalid left-hand side in object destructuring pattern. (1:4)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -47,10 +51,6 @@ "raw": "0" }, "value": 0 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json index 7c1957004b43..b820b5c7e5e7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:5)" + "SyntaxError: Invalid left-hand side in object destructuring pattern. (1:5)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -47,10 +51,6 @@ "raw": "0" }, "value": 0 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json index 9ad5276de4e3..9fa150c0e06e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Object pattern can't contain methods (1:2)" + "SyntaxError: Object pattern can't contain methods. (1:2)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "operator": "=", "left": { "type": "ObjectPattern", @@ -53,10 +57,6 @@ "raw": "0" }, "value": 0 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json index 7f8cd55c22f0..67f4e66edcd1 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)", - "SyntaxError: Invalid left-hand side in assignment expression (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)", + "SyntaxError: Invalid left-hand side in assignment expression. (1:1)" ], "program": { "type": "Program", @@ -21,6 +21,10 @@ "left": { "type": "SequenceExpression", "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "expressions": [ { "type": "Identifier", @@ -32,15 +36,15 @@ "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "SequenceExpression", "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, + "extra": { + "parenthesized": true, + "parenStart": 6 + }, "expressions": [ { "type": "Identifier", @@ -52,11 +56,7 @@ "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"d"}, "name": "d" } - ], - "extra": { - "parenthesized": true, - "parenStart": 6 - } + ] } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json index 8d53b1d88989..5338a543ddab 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Unexpected keyword 'default' (1:8)", - "SyntaxError: Export 'default' is not defined (1:8)" + "SyntaxError: Unexpected keyword 'default'. (1:8)", + "SyntaxError: Export 'default' is not defined. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json index 6ddebf209368..0765f2b7ae2c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-of' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json index a98d3e9a56df..6f666f89b92c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-of' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json index e48c18d4d102..125594960f65 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Invalid left-hand side in for-of statement (1:5)" + "SyntaxError: Invalid left-hand side in for-of statement. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json index 9c90d03acc48..5c69faee5e3c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-of' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/unexpected-number/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/unexpected-number/output.json index 5259253cdffb..3442f388c9a6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/unexpected-number/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/unexpected-number/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:13)", - "SyntaxError: Missing semicolon (1:13)", - "SyntaxError: Missing semicolon (1:16)" + "SyntaxError: 'Const declarations' require an initialization value. (1:13)", + "SyntaxError: Missing semicolon. (1:13)", + "SyntaxError: Missing semicolon. (1:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json index c59f2314f4c6..e5fd058f9408 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:4)", - "SyntaxError: Invalid Unicode escape (1:10)" + "SyntaxError: Invalid Unicode escape. (1:4)", + "SyntaxError: Invalid Unicode escape. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_id_smp/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_id_smp/options.json index 0e85210242d9..e740f24364b8 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_id_smp/options.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_id_smp/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected character '🀒' (1:4)" -} + "throws": "Unexpected character '🀒'. (1:4)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json index a6a8254f883c..40695b16996f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Complex binding patterns require an initialization value (1:6)" + "SyntaxError: 'Complex binding patterns' require an initialization value. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json index 8ed4dab050de..1e568eec1021 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-in' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json index 4602d099aa90..e3a03d778135 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" + "SyntaxError: 'for-in' loop variable declaration may not have an initializer. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json index d5f6e644d765..a0f82167368b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: new.target can only be used in functions (1:8)" + "SyntaxError: `new.target` can only be used in functions. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json index 61fc62e13aca..0e8a7f7da1af 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "errors": [ - "SyntaxError: The only valid meta property for new is new.target (1:25)" + "SyntaxError: The only valid meta property for new is new.target. (1:25)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json index ff24f919512d..49be2b39f7e6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:39)" + "SyntaxError: Redefinition of __proto__ property. (1:39)" ], "program": { "type": "Program", @@ -16,6 +16,11 @@ "expression": { "type": "ObjectExpression", "start":1,"end":57,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":57}}, + "extra": { + "trailingComma": 54, + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -75,12 +80,7 @@ "start":50,"end":54,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":54}} } } - ], - "extra": { - "trailingComma": 54, - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json index 036a85e2ef45..eb0b2a900beb 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:20)" + "SyntaxError: Redefinition of __proto__ property. (1:20)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -53,11 +57,7 @@ "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json index cea3f4803586..74a2ebce685e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:20)" + "SyntaxError: Redefinition of __proto__ property. (1:20)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":37,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":37}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -49,11 +53,7 @@ "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}} } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json index f8a8b6f0e06f..6a38c3c602ac 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:22)" + "SyntaxError: Redefinition of __proto__ property. (1:22)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -53,11 +57,7 @@ "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json index 6c50c95aa2f0..bae64cb26b78 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:22)" + "SyntaxError: Redefinition of __proto__ property. (1:22)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":41,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":41}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +61,7 @@ "start":35,"end":39,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":39}} } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json index 9ee4dd7e6aab..6518a6c68924 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:42)" + "SyntaxError: Redefinition of __proto__ property. (1:42)" ], "program": { "type": "Program", @@ -16,6 +16,11 @@ "expression": { "type": "ObjectExpression", "start":1,"end":60,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":60}}, + "extra": { + "trailingComma": 57, + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "ObjectMethod", @@ -81,12 +86,7 @@ "start":53,"end":57,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":57}} } } - ], - "extra": { - "trailingComma": 57, - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json index 581568e109df..e706256b963d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:8)" + "SyntaxError: `super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json index 6218e2b71584..a07fd83ef24e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/unclosed/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/unclosed/options.json index 5162185002ad..bbcc148f2a9c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/unclosed/options.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/unclosed/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated template (1:1)" -} + "throws": "Unterminated template. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json index 4ec3bf958e39..d4f4f1ea17bb 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Missing semicolon (1:19)" + "SyntaxError: Missing semicolon. (1:19)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json index 4a49e72e639c..11dc7ee67787 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:21)" + "SyntaxError: Yield expression is not allowed in formal parameters. (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json index 15805a597743..b19ea0f1adb2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:16)", - "SyntaxError: Binding invalid left-hand side in function parameter list (1:16)" + "SyntaxError: Yield expression is not allowed in formal parameters. (1:16)", + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json index 0b7873711fdc..150d943c5dbb 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:25)", - "SyntaxError: Binding invalid left-hand side in function parameter list (1:25)" + "SyntaxError: Yield expression is not allowed in formal parameters. (1:25)", + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:25)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json index 02857ebe4be5..0615f2e86ba8 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:30)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:30)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json index bbdafe45b1f9..adbe1a1ffe11 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:26)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:26)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json index 03ac7846dcdc..2759bf495c48 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:25)" + "SyntaxError: Unexpected reserved word 'yield'. (1:25)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json index 4824a8b5211c..040d236d2bfc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:10)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:10)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, @@ -29,10 +33,6 @@ "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json index 4ace3553e7e6..045b95268d4b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:12)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:12)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": null, "generator": true, "async": false, @@ -31,10 +35,6 @@ "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json index 2f778cc2fe3b..44d7dfc5a217 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:18)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:18)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": null, "generator": true, "async": false, @@ -40,10 +44,6 @@ "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json index 81b4ea1bb52c..2f7c84fe6e84 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:25)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:25)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json index 7f30d1206584..95b38e445d65 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:20)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json index 5746a0c95c79..d8c5bd86558d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:12)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json index aabcbd49fd0c..bec0eaf24b09 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:24)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:24)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json index 6e1c91ec0ff4..9ab8f21d7ece 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:46)" + "SyntaxError: Unexpected reserved word 'yield'. (1:46)" ], "program": { "type": "Program", @@ -71,11 +71,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json index 84e6c9206347..3d1a5f1dda46 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:47)" + "SyntaxError: Unexpected reserved word 'yield'. (1:47)" ], "program": { "type": "Program", @@ -73,11 +73,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json index 0dd81b4d0dad..4c94c63bee99 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Can not use 'yield' as identifier inside a generator (1:20)" + "SyntaxError: Can not use 'yield' as identifier inside a generator. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json index a662f4e01bbc..8e11926634a4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:16)" + "SyntaxError: Unexpected reserved word 'yield'. (1:16)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "AssignmentExpression", "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, + "extra": { + "parenthesized": true, + "parenStart": 14 + }, "operator": "=", "left": { "type": "ArrayPattern", @@ -32,10 +36,6 @@ "type": "Identifier", "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"x"}, "name": "x" - }, - "extra": { - "parenthesized": true, - "parenStart": 14 } } } @@ -47,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json index c6814edc8a57..019abccf9b2b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:19)" + "SyntaxError: Unexpected reserved word 'yield'. (1:19)" ], "program": { "type": "Program", @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json index bf2fe8474748..8203838cbec8 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:15)" + "SyntaxError: Unexpected reserved word 'yield'. (1:15)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json index c1253768e7a1..255f77939b02 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:23)" + "SyntaxError: Unexpected reserved word 'yield'. (1:23)" ], "program": { "type": "Program", @@ -57,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json index dda9f41982b5..948d656013b6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:28)" + "SyntaxError: Unexpected reserved word 'yield'. (1:28)" ], "program": { "type": "Program", @@ -44,11 +44,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json index 0d2aafc8542d..871b74efce3d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:25)" + "SyntaxError: Unexpected reserved word 'yield'. (1:25)" ], "program": { "type": "Program", @@ -42,11 +42,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json index 5f2d921752e9..ce1d3d4be99a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Binding 'yield' in strict mode (1:9)" + "SyntaxError: Binding 'yield' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json index f9eae4038a76..13185713052e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Binding 'yield' in strict mode (1:10)" + "SyntaxError: Binding 'yield' in strict mode. (1:10)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":34,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":34}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, @@ -35,18 +39,14 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json index 6ea37fe80964..1affee427350 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:29)" + "SyntaxError: Unexpected reserved word 'yield'. (1:29)" ], "program": { "type": "Program", @@ -46,11 +46,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json index 9a8eac94acf9..847e155c21bd 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:18)" + "SyntaxError: Unexpected reserved word 'yield'. (1:18)" ], "program": { "type": "Program", @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json index 2aaef66deac6..54fc9d195973 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:28)" + "SyntaxError: Unexpected reserved word 'yield'. (1:28)" ], "program": { "type": "Program", @@ -46,11 +46,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json index 5554975e11c5..71870094cf5f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:18)" + "SyntaxError: Unexpected reserved word 'yield'. (1:18)" ], "program": { "type": "Program", @@ -35,11 +35,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json index d74d0a848b05..257003df3004 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Yield expression is not allowed in formal parameters (1:21)" + "SyntaxError: Yield expression is not allowed in formal parameters. (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json index ba8f74f4e0f4..a2fee76573e4 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:12)" + "SyntaxError: Invalid Unicode escape. (1:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json index 88942a742b03..72cd5ec5d538 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, - "value": "\\x", "extra": { "raw": "\"\\x\"", "rawValue": "\\x" - } + }, + "value": "\\x" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json index f306e9f02374..7f928cd1dd7c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, - "value": "\\x0", "extra": { "raw": "\"\\x0\"", "rawValue": "\\x0" - } + }, + "value": "\\x0" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json index c25ed8c8341b..2f085bc4efef 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, - "value": "\\xx", "extra": { "raw": "\"\\xx\"", "rawValue": "\\xx" - } + }, + "value": "\\xx" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json index a9e327e586d0..fbc7576fdf2a 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, - "value": "\\u", "extra": { "raw": "\"\\u\"", "rawValue": "\\u" - } + }, + "value": "\\u" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json index 93cf7ff8ffba..ba29620802c9 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, - "value": "\\u0", "extra": { "raw": "\"\\u0\"", "rawValue": "\\u0" - } + }, + "value": "\\u0" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json index 0964301530d5..8bec3a48c646 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, - "value": "\\ux", "extra": { "raw": "\"\\ux\"", "rawValue": "\\ux" - } + }, + "value": "\\ux" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json index 9d296488f002..ca6e0068be7f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, - "value": "\\u00", "extra": { "raw": "\"\\u00\"", "rawValue": "\\u00" - } + }, + "value": "\\u00" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json index 667e2055d9f2..ea6cf6a8b30c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", @@ -17,11 +17,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, - "value": "\\u000", "extra": { "raw": "\"\\u000\"", "rawValue": "\\u000" - } + }, + "value": "\\u000" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json index ee18527964e7..8ca0a88b1023 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0002/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:2)" -} + "throws": "Identifier directly after number. (1:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0003/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0003/options.json index c70fa099de79..3c92b536acc2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0003/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0003/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:1)" -} + "throws": "Identifier directly after number. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json index 6afcaf3f5045..8aee6eeea338 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + "SyntaxError: Floating-point numbers require a valid exponent after the 'e'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json index 34027472096c..d8e610944944 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + "SyntaxError: Floating-point numbers require a valid exponent after the 'e'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json index 666fcca21213..77750f54019f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Floating-point numbers require a valid exponent after the 'e' (1:0)" + "SyntaxError: Floating-point numbers require a valid exponent after the 'e'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0007/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0007/options.json index c70fa099de79..3c92b536acc2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0007/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0007/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:1)" -} + "throws": "Identifier directly after number. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0008/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0008/options.json index c70fa099de79..3c92b536acc2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0008/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0008/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:1)" -} + "throws": "Identifier directly after number. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json index 9a1a7ea60803..f67a53a3afb8 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 16 (1:2)" + "SyntaxError: Expected number in radix 16. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0010/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0010/options.json index ee18527964e7..8ca0a88b1023 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0010/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0010/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:2)" -} + "throws": "Identifier directly after number. (1:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0011/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0011/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0011/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0011/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json index a880531bce85..e3f4428bc981 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + "SyntaxError: Expected number in radix 8. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json index 91dec1a23074..17d44bb73415 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + "SyntaxError: Expected number in radix 8. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json index 42696d4924d6..fb1d13c95256 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + "SyntaxError: Expected number in radix 8. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json index 9ed93409bc00..4bccf581bfba 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:3)" + "SyntaxError: Expected number in radix 8. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0016/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0016/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0016/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0016/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json index bd3bd49916b3..fe15b2f041dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0018/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0018/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0018/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0018/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json index fabbead51492..47c0f4397ab2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json index c90afe1734e6..68c905933acb 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + "SyntaxError: Expected number in radix 2. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json index 2b8e4f22be33..4f60e9e38bda 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + "SyntaxError: Expected number in radix 2. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json index 6cfde9edb3b5..b750712f4f89 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0023/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0023/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0023/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0023/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json index 6e3728ace39b..31d92ec36023 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:2)" + "SyntaxError: Expected number in radix 2. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json index d5ba308d5906..a909b5c95b75 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + "SyntaxError: Expected number in radix 2. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json index af38f05f89fa..4e1c02681908 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 2 (1:3)" + "SyntaxError: Expected number in radix 2. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json index 2fbc3ece3140..91c34234171d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:2)" + "SyntaxError: Expected number in radix 8. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json index 4978bcf4e51b..dd1203515e23 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Expected number in radix 8 (1:3)" + "SyntaxError: Expected number in radix 8. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0029/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0029/options.json index c70fa099de79..3c92b536acc2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0029/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0029/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:1)" -} + "throws": "Identifier directly after number. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0030/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0030/options.json index dd7623505983..ff93a899338e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0030/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0030/options.json @@ -1,3 +1,3 @@ { - "throws": "Identifier directly after number (1:3)" -} + "throws": "Identifier directly after number. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0031/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0031/options.json index d732a1630991..d55f05b989a4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0031/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0031/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated string constant (1:0)" -} + "throws": "Unterminated string constant. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json index 5dd7b5d3fcd6..5a42dc401165 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json index d9a89994f01f..c6a8c44431e7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:1)" + "SyntaxError: Invalid Unicode escape. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json index 32180fcde928..ab96020c3d57 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:1)" + "SyntaxError: Invalid Unicode escape. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json index f676471df15f..6ba16219582d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json index 8bc86d6bda14..def31c0a4779 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:2)" + "SyntaxError: Bad character escape sequence. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0038/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0038/options.json index 66fb1cd63bc6..150f288739dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0038/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0038/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:1)" -} + "throws": "Unterminated regular expression. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0039/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0039/options.json index 66fb1cd63bc6..150f288739dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0039/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0039/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:1)" -} + "throws": "Unterminated regular expression. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0040/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0040/options.json index 66fb1cd63bc6..150f288739dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0040/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0040/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:1)" -} + "throws": "Unterminated regular expression. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json index d42d61f8a543..8d5a269745e0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Invalid regular expression flag (1:16)", - "SyntaxError: Invalid regular expression flag (1:18)" + "SyntaxError: Invalid regular expression flag. (1:16)", + "SyntaxError: Invalid regular expression flag. (1:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json index 1e07f7e127f8..929074b9a1c1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Invalid regular expression flag (1:18)", - "SyntaxError: Invalid regular expression flag (1:20)" + "SyntaxError: Invalid regular expression flag. (1:18)", + "SyntaxError: Invalid regular expression flag. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json index 471a965aa78c..cfaa6c0a7190 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Invalid regular expression flag (1:16)", - "SyntaxError: Invalid regular expression flag (1:17)", - "SyntaxError: Invalid regular expression flag (1:19)" + "SyntaxError: Invalid regular expression flag. (1:16)", + "SyntaxError: Invalid regular expression flag. (1:17)", + "SyntaxError: Invalid regular expression flag. (1:19)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json index c783115307d9..a1aa83417028 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json @@ -2,12 +2,12 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid regular expression flag (1:17)", - "SyntaxError: Invalid regular expression flag (1:18)", - "SyntaxError: Invalid regular expression flag (1:20)", - "SyntaxError: Invalid regular expression flag (1:21)", - "SyntaxError: Invalid regular expression flag (1:22)", - "SyntaxError: Invalid regular expression flag (1:23)" + "SyntaxError: Invalid regular expression flag. (1:17)", + "SyntaxError: Invalid regular expression flag. (1:18)", + "SyntaxError: Invalid regular expression flag. (1:20)", + "SyntaxError: Invalid regular expression flag. (1:21)", + "SyntaxError: Invalid regular expression flag. (1:22)", + "SyntaxError: Invalid regular expression flag. (1:23)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json index d4d2cf5dfe67..615e2fb6000b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json index edc325840380..fdcc499e4a82 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json index 46112c6c8828..66b1f9ca6353 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:1)", - "SyntaxError: Invalid left-hand side in assignment expression (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:1)", + "SyntaxError: Invalid left-hand side in assignment expression. (1:1)" ], "program": { "type": "Program", @@ -21,6 +21,10 @@ "left": { "type": "BinaryExpression", "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "left": { "type": "NumericLiteral", "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, @@ -39,10 +43,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json index 53070d6b82ec..d35030ba83c3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json index b43e07489eca..dc4475a6dcf0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json index ff97ec8233c7..4d49b38158ac 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)" + "SyntaxError: Bad character escape sequence. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json index 89b9c579fa1c..62473b4541d4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Invalid left-hand side in postfix operation (1:0)" + "SyntaxError: Invalid left-hand side in postfix operation. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json index b0387fd4ff59..d05ce3bd5416 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Invalid left-hand side in postfix operation (1:0)" + "SyntaxError: Invalid left-hand side in postfix operation. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json index e86e86ca2246..450e5859605f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Invalid left-hand side in prefix operation (1:2)" + "SyntaxError: Invalid left-hand side in prefix operation. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json index de49f7815bd2..6e320d221cce 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "errors": [ - "SyntaxError: Invalid left-hand side in prefix operation (1:2)" + "SyntaxError: Invalid left-hand side in prefix operation. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json index 609aed8d6228..ce1ff12dc023 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:5)", - "SyntaxError: Invalid left-hand side in for-in statement (1:5)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:5)", + "SyntaxError: Invalid left-hand side in for-in statement. (1:5)" ], "program": { "type": "Program", @@ -17,6 +17,10 @@ "left": { "type": "BinaryExpression", "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, + "extra": { + "parenthesized": true, + "parenStart": 4 + }, "left": { "type": "NumericLiteral", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}}, @@ -35,10 +39,6 @@ "raw": "1" }, "value": 1 - }, - "extra": { - "parenthesized": true, - "parenStart": 4 } }, "right": { diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0062/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0062/options.json index 2fd762cd6afd..3f39a2ac3b2b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0062/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0062/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:9)" -} + "throws": "Unterminated regular expression. (1:9)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0063/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0063/options.json index 9d0cd9237f5b..cceacaba73f9 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0063/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0063/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated string constant (1:8)" -} + "throws": "Unterminated string constant. (1:8)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json index 71a10a5324e9..4bb04dbcffb2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Unexpected keyword 'if' (1:4)" + "SyntaxError: Unexpected keyword 'if'. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json index 62e99551071a..1891a2eec09f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json index ba27c1c609ba..6ba5a516e0b3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0071/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0071/output.json index ec9f3f126a1c..f9e98bbc6c37 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0071/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0071/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + "SyntaxError: Missing semicolon. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0072/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0072/output.json index eb17665ab7f3..b0e9ab8b217e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0072/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0072/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: Missing semicolon (1:5)" + "SyntaxError: Missing semicolon. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json index d704a0cb48a6..bbaa5f85171f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (1:3)" + "SyntaxError: A 'set' accesor must have exactly one formal parameter. (1:3)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ObjectExpression", "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "properties": [ { "type": "Property", @@ -44,11 +48,7 @@ }, "shorthand": false } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json index cca401d0d14b..2c169917e778 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:15)", - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:15)", + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -59,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json index 8e8d8419af7a..39a48ce2798d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:14)" + "SyntaxError: Binding 'eval' in strict mode. (1:14)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json index 5a18ea14d881..35d22ba742a9 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:14)" + "SyntaxError: Binding 'arguments' in strict mode. (1:14)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json index c5a150d343ad..d0530400d01e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json index 402704e9deb8..60534b000284 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:15)" + "SyntaxError: Binding 'arguments' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json index 4cfc4cd77e70..96b5bc510c62 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Argument name clash (1:4)" + "SyntaxError: Argument name clash. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json index e552560189df..cba6699ec17a 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Argument name clash (1:18)" + "SyntaxError: Argument name clash. (1:18)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 70812a59cc6a..8f898cf7a24e 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:21)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:21)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json index 6b624a3ee404..2fdc8e15fec4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json index 06d87dffa42f..a6277b918ccd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)", - "SyntaxError: Binding invalid left-hand side in function parameter list (1:5)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:1)", + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json index 8515329a04e1..657451b675f7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -45,11 +45,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json index 16f6411a562b..242bb03d55f1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:1)" + "SyntaxError: Binding 'eval' in strict mode. (1:1)" ], "program": { "type": "Program", @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0112/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0112/output.json index 9f46d8a53e92..f26fb79a0e7e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0112/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0112/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Missing semicolon (1:1)" + "SyntaxError: Missing semicolon. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0115/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0115/output.json index 3b44c2aa68d6..8ab2c6aeee68 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0115/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0115/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Missing semicolon (1:1)", - "SyntaxError: Unexpected reserved word 'enum' (1:2)" + "SyntaxError: Missing semicolon. (1:1)", + "SyntaxError: Unexpected reserved word 'enum'. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json index 8ce94b960543..c518595a41a0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Unsyntactic break (1:0)" + "SyntaxError: Unsyntactic break. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json index 6d89822f1568..811d70b316fe 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:0)" + "SyntaxError: Unsyntactic continue. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json index d3af5238b363..2d4dd7e24b0e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)" + "SyntaxError: Invalid left-hand side in for-in statement. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json index a68f97021f5d..8344401eaacc 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)" + "SyntaxError: Invalid left-hand side in for-in statement. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json index a0bb1f5c08a4..f9808a0f84f6 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Missing catch or finally clause (1:0)" + "SyntaxError: Missing catch or finally clause. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json index 8515bc8f1fb0..16fda0d06846 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Invalid Unicode escape. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0138/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0138/output.json index fdf1d3c3fc9b..720ebefb9d3f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0138/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0138/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:15)" + "SyntaxError: 'Const declarations' require an initialization value. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0139/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0139/output.json index e19f992ee2bb..2a863afacb3d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0139/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0139/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:7)" + "SyntaxError: 'Const declarations' require an initialization value. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0140/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0140/output.json index 1ed957df3a9b..f2a024e81c1f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0140/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0140/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Const declarations require an initialization value (1:7)" + "SyntaxError: 'Const declarations' require an initialization value. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0141/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0141/output.json index 607bb08d2cea..6708beed7898 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0141/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0141/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Missing semicolon (1:12)" + "SyntaxError: Missing semicolon. (1:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json index 65a76ea528d1..ca54ca20a5ca 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:9)" + "SyntaxError: Lexical declaration cannot appear in a single-statement context. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json index 322359217c2d..2588843bac54 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Multiple default clauses (1:22)" + "SyntaxError: Multiple default clauses. (1:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0145/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0145/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0145/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0145/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0146/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0146/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0146/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0146/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0147/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0147/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0147/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0147/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0148/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0148/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0148/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0148/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0149/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0149/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0149/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0149/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0150/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0150/options.json index eb40f4f05235..b25c10705ddf 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0150/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0150/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated comment (1:0)" -} + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0157/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0157/options.json index 66fb1cd63bc6..150f288739dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0157/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0157/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated regular expression (1:1)" -} + "throws": "Unterminated regular expression. (1:1)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json index 4e21f3ee7b93..fb33b618beb7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json index 6c34e22a0044..882d234cfa8c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Invalid Unicode escape. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json index cc7b3b44d69e..de59dbe06c49 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json index 3af7d55ae127..ab518a1a3a05 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Invalid Unicode escape. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json index b79101954c7c..a918705d9885 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Invalid Unicode escape. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json index 88eefa8ba7ab..dc3bf6a8192d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Invalid Unicode escape. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0168/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0168/options.json index d732a1630991..d55f05b989a4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0168/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0168/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated string constant (1:0)" -} + "throws": "Unterminated string constant. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/options.json index d732a1630991..d55f05b989a4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/options.json @@ -1,3 +1,3 @@ { - "throws": "Unterminated string constant (1:0)" -} + "throws": "Unterminated string constant. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json index 5875cb58be47..06631762652e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: 'return' outside of function (1:0)" + "SyntaxError: 'return' outside of function. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json index 8ce94b960543..c518595a41a0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Unsyntactic break (1:0)" + "SyntaxError: Unsyntactic break. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json index 6d89822f1568..811d70b316fe 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:0)" + "SyntaxError: Unsyntactic continue. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json index 37451db0ed1b..195fb7644434 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:22)" + "SyntaxError: Unsyntactic continue. (1:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json index ae9cb401dddc..46f73d4c4efb 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unsyntactic break (1:15)" + "SyntaxError: Unsyntactic break. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json index 39c5663443fe..e9e33c65236a 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:15)" + "SyntaxError: Unsyntactic continue. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json index 3939133b3b8a..fa61b279c38b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unsyntactic break (1:33)" + "SyntaxError: Unsyntactic break. (1:33)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":43,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":43}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -50,10 +54,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json index d65c7f7da91a..4390beac20df 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:33)" + "SyntaxError: Unsyntactic continue. (1:33)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":46,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":46}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -50,10 +54,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json index 336add4fe32c..4a682d6c85fb 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: Unsyntactic break (1:33)" + "SyntaxError: Unsyntactic break. (1:33)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -46,10 +50,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json index ac86039c659b..9321eacbd502 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ - "SyntaxError: Unsyntactic continue (1:33)" + "SyntaxError: Unsyntactic continue. (1:33)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, + "extra": { + "parenthesized": true, + "parenStart": 18 + }, "id": null, "generator": false, "async": false, @@ -46,10 +50,6 @@ } ], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 18 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json index 815a430cb2b7..b16e8da6eb9c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Label 'x' is already declared (1:18)" + "SyntaxError: Label 'x' is already declared. (1:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json index 392c525509d1..4eac4215e0c7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: Deleting local variable in strict mode (1:29)" + "SyntaxError: Deleting local variable in strict mode. (1:29)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -50,21 +54,17 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + "arguments": [] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json index 62cf67d34e04..224e3d31eb66 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: 'with' in strict mode (1:29)" + "SyntaxError: 'with' in strict mode. (1:29)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "CallExpression", "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "callee": { "type": "FunctionExpression", "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, @@ -48,21 +52,17 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + "arguments": [] } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json index fcd0ab9858ca..067b73ce5338 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:36)" + "SyntaxError: Binding 'eval' in strict mode. (1:36)" ], "program": { "type": "Program", @@ -58,11 +58,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json index d557326e9973..2d7204637a91 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:36)" + "SyntaxError: Binding 'arguments' in strict mode. (1:36)" ], "program": { "type": "Program", @@ -58,11 +58,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json index 3040718fd546..44484811f90d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:47)" + "SyntaxError: Binding 'eval' in strict mode. (1:47)" ], "program": { "type": "Program", @@ -59,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json index 429d686ed48c..dca567981b26 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:47)" + "SyntaxError: Binding 'arguments' in strict mode. (1:47)" ], "program": { "type": "Program", @@ -59,11 +59,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json index 79c71ebb542f..33380521385d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:32)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -56,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json index ec34fa9d5ce8..3d1c7d7ebeac 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -56,11 +56,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json index 2ad942222305..5593bc5e195f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:34)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:34)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json index c85c53c215da..6b15ccd03e74 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:34)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:34)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json index 8635017ed5c5..35025e0c6063 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:34)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:34)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json index 0090b6011203..5bead73e7931 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:34)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:34)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json index 439436ef7e82..0b82488fd4cc 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:32)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json index b68c731a58a7..9bbefb53c902 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:32)" + "SyntaxError: Assigning to 'eval' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json index 52dbdc3d5ca5..58d6e1332031 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json index 48c2df5468eb..0a859a25f4a0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" + "SyntaxError: Assigning to 'arguments' in strict mode. (1:32)" ], "program": { "type": "Program", @@ -48,11 +48,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json index 3c4ac7fd38dd..eacc05a4b0b4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)" + "SyntaxError: Binding 'eval' in strict mode. (1:41)" ], "program": { "type": "Program", @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json index e183294a232f..4fc4cfff5a58 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:41)" + "SyntaxError: Binding 'arguments' in strict mode. (1:41)" ], "program": { "type": "Program", @@ -51,11 +51,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json index c252adad5c36..fdc46d061db5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:9)" + "SyntaxError: Binding 'eval' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json index 2c691b4f70f1..7b1924caf1e3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:9)" + "SyntaxError: Binding 'arguments' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json index 9e3046fe279b..48f9179f3bc2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:42)" + "SyntaxError: Binding 'eval' in strict mode. (1:42)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "CallExpression", "start":33,"end":54,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":54}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "callee": { "type": "FunctionExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, @@ -49,11 +53,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "arguments": [] } } ], @@ -64,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json index 2502c52e184c..2d2f562d54e1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:42)" + "SyntaxError: Binding 'arguments' in strict mode. (1:42)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "CallExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "callee": { "type": "FunctionExpression", "start":33,"end":57,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":57}}, @@ -49,11 +53,7 @@ "directives": [] } }, - "arguments": [], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "arguments": [] } } ], @@ -64,11 +64,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json index 887c41149531..3c81b4682241 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:10)" + "SyntaxError: Binding 'eval' in strict mode. (1:10)" ], "program": { "type": "Program", @@ -19,6 +19,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"eval"}, @@ -38,18 +42,14 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json index 250afef7d81d..8e6c5c894372 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:10)" + "SyntaxError: Binding 'arguments' in strict mode. (1:10)" ], "program": { "type": "Program", @@ -19,6 +19,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19},"identifierName":"arguments"}, @@ -38,18 +42,14 @@ "value": { "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json index 03985eff0b57..9229db313aea 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:47)" + "SyntaxError: Binding 'eval' in strict mode. (1:47)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -62,11 +66,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -77,11 +77,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json index 29ce013f0b8b..c5b887768304 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:10)" + "SyntaxError: Binding 'package' in strict mode. (1:10)" ], "program": { "type": "Program", @@ -19,6 +19,10 @@ "callee": { "type": "FunctionExpression", "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"package"}, @@ -38,18 +42,14 @@ "value": { "type": "DirectiveLiteral", "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json index 60d4df26f9f4..47a65a4a935c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:48)" + "SyntaxError: Binding 'eval' in strict mode. (1:48)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -81,11 +85,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -96,11 +96,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json index 4ee83b14028e..6f387fb20104 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)" + "SyntaxError: Binding 'eval' in strict mode. (1:41)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectMethod", @@ -60,11 +64,7 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -75,11 +75,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json index 0c8905156ab1..68a903fb4f30 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:49)" + "SyntaxError: Binding 'eval' in strict mode. (1:49)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, "properties": [ { "type": "ObjectProperty", @@ -68,11 +72,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 32 - } + ] } } ], @@ -83,11 +83,11 @@ "value": { "type": "DirectiveLiteral", "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json index 3ccaace1b183..830edc82be15 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:15)" + "SyntaxError: Binding 'eval' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json index dc142e76101d..232a3d361295 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:15)" + "SyntaxError: Binding 'arguments' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json index d887db53f5e6..9b32d2b4485e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:48)" + "SyntaxError: Binding 'eval' in strict mode. (1:48)" ], "program": { "type": "Program", @@ -57,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json index ded181413784..7395b0a56ad5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:48)" + "SyntaxError: Binding 'arguments' in strict mode. (1:48)" ], "program": { "type": "Program", @@ -57,11 +57,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 fa26c140fe1d..ba29c1ca0fdf 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:2)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (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 66906dba7f5c..268b23194b40 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:35)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:35)" ], "program": { "type": "Program", 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 f4096149d8ed..dab347309794 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:33)" ], "program": { "type": "Program", @@ -46,11 +46,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 0491546b1a61..2be4810dff67 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:38)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:38)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, + "extra": { + "parenthesized": true, + "parenStart": 33 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +61,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 33 - } + ] } } ], @@ -72,11 +72,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 8caf22da60fa..7e92eeb15f63 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (1:36)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "ObjectExpression", "start":34,"end":45,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":45}}, + "extra": { + "parenthesized": true, + "parenStart": 33 + }, "properties": [ { "type": "ObjectProperty", @@ -57,11 +61,7 @@ "value": 42 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 33 - } + ] } } ], @@ -72,11 +72,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "'use strict'", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] 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 d0760f1b380e..810a2fe1c2f5 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:36)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (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 2ed529ae45ad..d454991b1968 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 @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:36)", - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:57)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:36)", + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (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 2c6c0e03d277..6a534cbb800c 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ - "SyntaxError: The only valid numeric escape in strict mode is '\\0' (1:69)" + "SyntaxError: The only valid numeric escape in strict mode is '\\0'. (1:69)" ], "program": { "type": "Program", @@ -47,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":52,"end":71,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":71}}, - "value": "octal directive\\1", "extra": { "raw": "\"octal directive\\1\"", "rawValue": "octal directive\\1" - } + }, + "value": "octal directive\\1" } } ] @@ -65,11 +65,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json index a3eee1ca1117..917c3e5a9e8c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Unexpected reserved word 'implements' (1:37)" + "SyntaxError: Unexpected reserved word 'implements'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json index cffcb241d435..98446531faa1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:37)" + "SyntaxError: Unexpected reserved word 'interface'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json index 3d7bd0ac8ee4..4e1da8899d7b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unexpected reserved word 'package' (1:37)" + "SyntaxError: Unexpected reserved word 'package'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json index 4c1f2d2844f0..52b9164d1a75 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ - "SyntaxError: Unexpected reserved word 'private' (1:37)" + "SyntaxError: Unexpected reserved word 'private'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json index dcf994402ae1..f7dbc7b74c4c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Unexpected reserved word 'protected' (1:37)" + "SyntaxError: Unexpected reserved word 'protected'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json index c7306ecdb68b..5e4ded19fd38 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:37)" + "SyntaxError: Unexpected reserved word 'public'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json index 41fd57994528..70f7e9670e08 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:37)" + "SyntaxError: Unexpected reserved word 'static'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json index 52018c7cba22..48dc58ff96d4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:37)" + "SyntaxError: Unexpected reserved word 'yield'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json index d714b3e28e2e..a6dab52e930c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: Unexpected reserved word 'let' (1:37)" + "SyntaxError: Unexpected reserved word 'let'. (1:37)" ], "program": { "type": "Program", @@ -50,11 +50,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json index 160544579047..fda02a2a3f9e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: Binding 'static' in strict mode (1:15)" + "SyntaxError: Binding 'static' in strict mode. (1:15)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json index b184d5881724..7f3b58f78afc 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Binding 'static' in strict mode (1:9)" + "SyntaxError: Binding 'static' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -32,11 +32,11 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json index 5704449178a7..8689725c8958 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:9)" + "SyntaxError: Binding 'eval' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json index 4f8e8d897e7d..7d2be8d5781d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:9)" + "SyntaxError: Binding 'arguments' in strict mode. (1:9)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":24,"end":36,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":36}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json index 07cfc9324623..7feccdb1152c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:23)" + "SyntaxError: Unexpected reserved word 'static'. (1:23)" ], "program": { "type": "Program", @@ -36,11 +36,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json index 3b77c9170b54..3fba35b99ded 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Argument name clash (1:14)" + "SyntaxError: Argument name clash. (1:14)" ], "program": { "type": "Program", @@ -43,11 +43,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json index 0581517d990a..55829c2b075b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:11)" + "SyntaxError: Binding 'eval' in strict mode. (1:11)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json index aafa09421ccc..b82f2cea47a9 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:11)" + "SyntaxError: Binding 'package' in strict mode. (1:11)" ], "program": { "type": "Program", @@ -38,11 +38,11 @@ "value": { "type": "DirectiveLiteral", "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json index df3094e728a8..8cf993f5136e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "errors": [ - "SyntaxError: Argument name clash (1:43)" + "SyntaxError: Argument name clash. (1:43)" ], "program": { "type": "Program", @@ -66,11 +66,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json index bcaf874206cd..8f987f709891 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Argument name clash (1:15)" + "SyntaxError: Argument name clash. (1:15)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -46,18 +50,14 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json index 65f5a908f019..688a01f58639 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ - "SyntaxError: Argument name clash (1:44)" + "SyntaxError: Argument name clash. (1:44)" ], "program": { "type": "Program", @@ -31,6 +31,10 @@ "expression": { "type": "FunctionExpression", "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, + "extra": { + "parenthesized": true, + "parenStart": 29 + }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"b"}, @@ -55,10 +59,6 @@ "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] - }, - "extra": { - "parenthesized": true, - "parenStart": 29 } } } @@ -70,11 +70,11 @@ "value": { "type": "DirectiveLiteral", "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json index a1ab8b4653ea..911fe15b7606 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:12)" + "SyntaxError: Binding 'eval' in strict mode. (1:12)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -41,18 +45,14 @@ "value": { "type": "DirectiveLiteral", "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json index 7caed97929d9..44b440b91f7b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Binding 'package' in strict mode (1:12)" + "SyntaxError: Binding 'package' in strict mode. (1:12)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "FunctionExpression", "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "id": { "type": "Identifier", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, @@ -41,18 +45,14 @@ "value": { "type": "DirectiveLiteral", "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] - }, - "extra": { - "parenthesized": true, - "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json index df42b7ac7db9..c2cdc9410209 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Label '__proto__' is already declared (1:11)" + "SyntaxError: Label '__proto__' is already declared. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json index 27c0fb2e3a31..db0d9cecc305 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ - "SyntaxError: Argument name clash (1:36)" + "SyntaxError: Argument name clash. (1:36)" ], "program": { "type": "Program", @@ -47,11 +47,11 @@ "value": { "type": "DirectiveLiteral", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, - "value": "use strict", "extra": { "raw": "\"use strict\"", "rawValue": "use strict" - } + }, + "value": "use strict" } } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json index 5b2a545950f5..3feb9d644485 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Redefinition of __proto__ property (1:21)" + "SyntaxError: Redefinition of __proto__ property. (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json index 1e257d6d4e55..69e2395bdd69 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0257/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Missing semicolon (1:15)", - "SyntaxError: Unexpected reserved word 'package' (1:16)" + "SyntaxError: Missing semicolon. (1:15)", + "SyntaxError: Unexpected reserved word 'package'. (1:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0258/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0258/options.json index 2e1b1cc3aa43..8c60527068a3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0258/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0258/options.json @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:18)" -} + "throws": "Rest element must be last element. (1:18)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json index ffd3a3ed2689..85aa6e98c2e1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0261/options.json @@ -1,3 +1,3 @@ { - "throws": "A class name is required (1:5)" -} + "throws": "A class name is required. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json index ffd3a3ed2689..85aa6e98c2e1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0262/options.json @@ -1,3 +1,3 @@ { - "throws": "A class name is required (1:5)" -} + "throws": "A class name is required. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json index ffd3a3ed2689..85aa6e98c2e1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0263/options.json @@ -1,3 +1,3 @@ { - "throws": "A class name is required (1:5)" -} + "throws": "A class name is required. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json index cedce7bc2cc8..ad006272c60b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Classes may not have static property named prototype (1:16)" + "SyntaxError: Classes may not have static property named prototype. (1:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json index 5d43814f1619..bdba81ac68eb 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Classes may not have static property named prototype (1:16)" + "SyntaxError: Classes may not have static property named prototype. (1:16)" ], "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 ab3b4e1d0f4b..c4183d20d423 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Class constructor may not be an accessor (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 937104c770ac..c2ed8c94a6ec 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Class constructor may not be an accessor (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_0274/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json index ed124fb20e3e..dadbac8f238b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ - "SyntaxError: Duplicate constructor in the same class (1:25)" + "SyntaxError: Duplicate constructor in the same class. (1:25)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json index fbd817014273..d3fb225998f4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:11)" + "SyntaxError: Unexpected reserved word 'enum'. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json index d1c541915d19..a7e182c36a5a 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:17)" + "SyntaxError: Unexpected reserved word 'static'. (1:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json index b36068b690ed..f402a16f0e1c 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: setter function argument must not be a rest parameter (1:6)" + "SyntaxError: A 'set' accesor function argument must not be a rest parameter. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json index 03c94d829aa7..0d4a94d65f2e 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json index f88db15c7fd9..353591d6e66a 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json index 389c8a589fb8..58cbc5cfd11e 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json index 389c8a589fb8..58cbc5cfd11e 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" + "SyntaxError: Expecting Unicode escape sequence \\uXXXX. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json index 0763ff948104..f2bc5ede10b0 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Complex binding patterns require an initialization value (1:6)" + "SyntaxError: 'Complex binding patterns' require an initialization value. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json b/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json index 98c7c647bf60..3a51c1e9b785 100644 --- a/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json +++ b/packages/babel-parser/test/fixtures/estree/object-method/invalid-setter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (1:3)" + "SyntaxError: A 'set' accesor must have exactly one formal parameter. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json b/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json index 284b2c96b440..d1d64c9ddb22 100644 --- a/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json +++ b/packages/babel-parser/test/fixtures/estree/typescript/getter-setter/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (3:3)", - "SyntaxError: getter must not have any formal parameters (4:3)" + "SyntaxError: A 'set' accesor must have exactly one formal parameter. (3:3)", + "SyntaxError: A 'get' accesor must not have any formal parameters. (4:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json index b1975e9de194..a0b8922b744d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Classes may not have a private field named '#constructor' (2:2)" + "SyntaxError: Classes may not have a private field named '#constructor'. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json index 365b9b97a943..af6eb7d2c51b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json index dbd141f36516..8dce1b38bc14 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json index 860696f144c4..b5862a6b8146 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json index fc48d9672da0..fc6048287240 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json index 6bdc11432ece..6371085f100a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json index 78af3bf7c711..18306486f988 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json index 4d7e2c8824b2..04004e559883 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json index 1267a637ac79..7a8bc1a7c152 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json index 326584989c7f..ca2586e44fd1 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json index d1d6acb5f0d5..84443e5cf0c2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json index 995f7b083808..4abed739c40a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json index 35d9b789e28e..800e063a7471 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json index cb4da3ca4552..eaa0136db42b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json index af9987434013..4d5164056924 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json index 42d1371ce7dd..0001d2c4547c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json index 122a0e829f30..8aa9ca183d5e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json index 9c3051a38021..b3aae8227d14 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json index 9e05934745d3..d22a6f3547ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json index 792fec48d7ce..f2c66c8dc90b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json index 91b3df114cef..d438c0b744a2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json index 9ee1d22c1b87..d17e0528701c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json index 17a3f7593137..928b9c09e360 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json index f7d4c6d3a12f..ea7346f0a15a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json index f0e607109c92..2a05ac112df1 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json index 816bb3ac1410..93fbce6552b0 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json index 6fe3015ccf76..44d027de37bd 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json index 7c3c0b0a5e41..5fe8a5e63ea8 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json index ee2325e1bddb..b3f7dcb8e04b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json index fe58593dfba5..7ad07d14363e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json index e029e983ee76..54b64e355c8d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json index cf003ba438c6..03f017ec7c5e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json index d0f7aa76dbc7..f3c0d841ff7c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json index b740b3d3bd61..1678907e09cf 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json index d4337b4f6ddf..840a1bf6dbdc 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json index 4e1bc28f2660..faa8169fb638 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json index 82cf9bd9f557..a30c50be62c4 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json index baad4ea0cde9..2d24e647ce85 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json index 53103a600f1d..54b6269e86c5 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json index 752fd3b1a71c..76caf4c4294d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json index 35b89e838974..cd3bd92dac4f 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json index c826d1bd510f..3b91893b0ad2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json index e337e3d268c3..4f4e4e0da34d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json index 1039c1e056e4..beda39cd6916 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json index 6e37550db85e..fcc69c94f945 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json index 98629c2614f1..cff045c9cf58 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json index ebc7cc92dc53..8c8bdac35c76 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json index e8403e51a8ee..b0da1b65c8cb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json index 254811183570..c1505e97d7b3 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json index 0e28cc4938ff..6b0a3ba46fec 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json index 4abec1e40b1c..205ca13bb432 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json index 967cd567b4a4..16540374061b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json index 3b74b77a4b3a..ae805a454a90 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json index b611d45935c7..01887d7bffab 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json index bbbd7d10bec0..159cc7f879a3 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json index 0b33c76ec3b3..5774437e43d5 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json index 3d2ee186456a..3f134b2f8410 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:2)" + "SyntaxError: Duplicate private name #x. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json index 241a017c8eb0..656b97402340 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:6)" + "SyntaxError: Duplicate private name #x. (3:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json index ae3787b17496..77fe62df3d1c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json index 6df9c23ccf95..aab46033b1cb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:9)" + "SyntaxError: Duplicate private name #x. (3:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json index dff968e97984..7652f98bc53c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Duplicate private name #x (3:13)" + "SyntaxError: Duplicate private name #x. (3:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json index c616eec20ec0..a01ec110823f 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Deleting a private field is not allowed (4:4)" + "SyntaxError: Deleting a private field is not allowed. (4:4)" ], "program": { "type": "Program", @@ -72,6 +72,7 @@ "type": "ThisExpression", "start":47,"end":51,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}} }, + "computed": false, "property": { "type": "PrivateName", "start":53,"end":55,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":19}}, @@ -81,7 +82,6 @@ "name": "x" } }, - "computed": false, "optional": true } } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json index edd09ae38e67..ed23f9c62a8e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Deleting a private field is not allowed (4:4)" + "SyntaxError: Deleting a private field is not allowed. (4:4)" ], "program": { "type": "Program", @@ -72,6 +72,7 @@ "type": "ThisExpression", "start":47,"end":51,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}} }, + "computed": false, "property": { "type": "PrivateName", "start":52,"end":54,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":18}}, @@ -80,8 +81,7 @@ "start":53,"end":54,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":18},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json index 56f268a84707..cbc752f26790 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Classes may not have a private field named '#constructor' (2:2)" + "SyntaxError: Classes may not have a private field named '#constructor'. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json index 2ba960820f02..57e6697b16d2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json @@ -1,4 +1,6 @@ { - "throws": "Unexpected digit after hash token (2:2)", - "plugins": ["classPrivateProperties"] -} + "plugins": [ + "classPrivateProperties" + ], + "throws": "Unexpected digit after hash token. (2:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/options.json index 2ba960820f02..57e6697b16d2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/options.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/options.json @@ -1,4 +1,6 @@ { - "throws": "Unexpected digit after hash token (2:2)", - "plugins": ["classPrivateProperties"] -} + "plugins": [ + "classPrivateProperties" + ], + "throws": "Unexpected digit after hash token. (2:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json index 8010b9a5b411..f487856e8e9b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":95,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:13)" + "SyntaxError: `super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json index e1645e9fd57e..c501bd6487fb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Private fields can't be accessed on super (5:4)" + "SyntaxError: Private fields can't be accessed on super. (5:4)" ], "program": { "type": "Program", @@ -71,6 +71,7 @@ "type": "Super", "start":44,"end":49,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":9}} }, + "computed": false, "property": { "type": "PrivateName", "start":50,"end":52,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":12}}, @@ -79,8 +80,7 @@ "start":51,"end":52,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":12},"identifierName":"x"}, "name": "x" } - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json index 72c04ef4fff9..95734dd97d67 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private name #priv is not defined (4:19)" + "SyntaxError: Private name #priv is not defined. (4:19)" ], "program": { "type": "Program", @@ -77,6 +77,7 @@ "start":42,"end":45,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":18},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "PrivateName", "start":46,"end":51,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":24}}, @@ -85,8 +86,7 @@ "start":47,"end":51,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":24},"identifierName":"priv"}, "name": "priv" } - }, - "computed": false + } } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json index 6cc1bce62569..5688387ca692 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Private name #priv is not defined (1:15)" + "SyntaxError: Private name #priv is not defined. (1:15)" ], "program": { "type": "Program", @@ -30,6 +30,7 @@ "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, + "computed": false, "property": { "type": "PrivateName", "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, @@ -38,8 +39,7 @@ "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"priv"}, "name": "priv" } - }, - "computed": false + } } } ], 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 e4fcbae89abd..9e1f3d4cb957 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 only allowed in functions and class methods (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 a6645c3bef45..9cf33d0715eb 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 only allowed in functions and class methods (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 48d889e597ff..1b13199f02be 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 only allowed in functions and class methods (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-properties/await-in-computed-property-in-params-of-async-arrow/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json index b2b40d6638b8..9cb65937fe60 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside an async function (1:20)" + "SyntaxError: Can not use 'await' as identifier inside an async function. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json index 166fd813daca..cea178645416 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: new.target can only be used in functions or class properties (1:8)" + "SyntaxError: `new.target` can only be used in functions. or class properties (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json index 9d09ab7b33e5..2d8225d9563e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Classes may not have a field named 'constructor' (2:2)" + "SyntaxError: Classes may not have a field named 'constructor'. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json index 67687aa331a8..97fea08fdeb9 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Classes may not have a field named 'constructor' (2:2)" + "SyntaxError: Classes may not have a field named 'constructor'. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json index 2850861ad8fc..e89879777cb0 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Classes may not have static property named prototype (2:9)" + "SyntaxError: Classes may not have static property named prototype. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json index 2e1a73e9731d..7dc42678844a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Classes may not have static property named prototype (2:9)" + "SyntaxError: Classes may not have static property named prototype. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json index 789ddb0c28e4..ac7c55167733 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Classes may not have a field named 'constructor' (2:11)" + "SyntaxError: Classes may not have a field named 'constructor'. (2:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json index e93888eeb6f2..06b7a38120c7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:12)" + "SyntaxError: `super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json index c69a435a1046..6b7dea14cff7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/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: super is only allowed in object methods and classes (3:4)" + "SyntaxError: 'super' is only allowed in object methods and classes. (3:4)" ], "program": { "type": "Program", @@ -61,12 +61,12 @@ "type": "Super", "start":38,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}} }, + "computed": false, "property": { "type": "Identifier", "start":44,"end":45,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json index c50fc16839fe..2e1ffaf6cded 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":100,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (4:8)" + "SyntaxError: Unexpected reserved word 'yield'. (4:8)" ], "program": { "type": "Program", @@ -41,6 +41,13 @@ { "type": "ClassProperty", "start":79,"end":94,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":19}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " here yield is an identifier reference", + "start":34,"end":74,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} + } + ], "static": false, "key": { "type": "Identifier", @@ -66,14 +73,7 @@ }, "value": 42 } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " here yield is an identifier reference", - "start":34,"end":74,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} - } - ] + } } ] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json index c3fb984ad5a4..122d4136db03 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/await-binding-in-static-block/output.json @@ -2,19 +2,19 @@ "type": "File", "start":0,"end":568,"loc":{"start":{"line":1,"column":0},"end":{"line":27,"column":34}}, "errors": [ - "SyntaxError: Can not use 'await' as identifier inside a static block (3:21)", - "SyntaxError: Can not use 'await' as identifier inside a static block (5:27)", - "SyntaxError: Can not use 'await' as identifier inside a static block (7:22)", - "SyntaxError: Can not use 'await' as identifier inside a static block (9:22)", - "SyntaxError: Can not use 'await' as identifier inside a static block (11:28)", - "SyntaxError: Can not use 'await' as identifier inside a static block (13:28)", - "SyntaxError: Can not use 'await' as identifier inside a static block (15:25)", - "SyntaxError: Can not use 'await' as identifier inside a static block (17:25)", - "SyntaxError: Can not use 'await' as identifier inside a static block (19:31)", - "SyntaxError: Can not use 'await' as identifier inside a static block (21:31)", - "SyntaxError: Can not use 'await' as identifier inside a static block (23:28)", - "SyntaxError: Can not use 'await' as identifier inside a static block (25:30)", - "SyntaxError: Can not use 'await' as identifier inside a static block (27:21)" + "SyntaxError: Can not use 'await' as identifier inside a static block. (3:21)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (5:27)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (7:22)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (9:22)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (11:28)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (13:28)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (15:25)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (17:25)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (19:31)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (21:31)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (23:28)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (25:30)", + "SyntaxError: Can not use 'await' as identifier inside a static block. (27:21)" ], "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 3dd4e8af7079..048195a80215 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 only allowed in functions and class methods (3:15)" + "SyntaxError: 'arguments' is only allowed in functions and class methods. (3:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-await/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-await/output.json index a5c0a305f294..d0835ad4eb01 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-await/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-await/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":95,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (5:6)" + "SyntaxError: 'await' is only allowed within async functions. (5:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-break/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-break/output.json index 945a53080c99..042851fc0631 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-break/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-break/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":111,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "errors": [ - "SyntaxError: Unsyntactic break (6:8)" + "SyntaxError: Unsyntactic break. (6:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json index e427962f49ba..3d13ff8490b7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-continue/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ - "SyntaxError: Unsyntactic continue (5:6)" + "SyntaxError: Unsyntactic continue. (5:6)" ], "program": { "type": "Program", @@ -82,4 +82,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-decorators/output.json index bd16de29ca2e..d9414a2148b2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-decorators/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Decorators can't be used with a static block (3:2)" + "SyntaxError: Decorators can't be used with a static block. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-decorators/output.json index bd16de29ca2e..d9414a2148b2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-decorators/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Decorators can't be used with a static block (3:2)" + "SyntaxError: Decorators can't be used with a static block. (3:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-octal/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-octal/output.json index e22e29928345..87910943bb1a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-octal/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-legacy-octal/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Legacy octal literals are not allowed in strict mode (4:4)" + "SyntaxError: Legacy octal literals are not allowed in strict mode. (4:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-return/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-return/output.json index 2f0fef206125..54615d3c4805 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-return/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-return/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: 'return' outside of function (4:4)" + "SyntaxError: 'return' outside of function. (4:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-super-call/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-super-call/output.json index e07c019a7eb3..06b81b2d74c5 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-super-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-super-call/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (5:4)" + "SyntaxError: `super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (5:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-yield/output.json b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-yield/output.json index a88cd81ff0b2..fd89e2096834 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-yield/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-static-block/invalid-yield/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (5:6)", - "SyntaxError: Missing semicolon (5:11)" + "SyntaxError: Unexpected reserved word 'yield'. (5:6)", + "SyntaxError: Missing semicolon. (5:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-binary/options.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-binary/options.json index 258615f550b5..ac9f6e0c2976 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-binary/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-binary/options.json @@ -2,5 +2,5 @@ "plugins": [ "decimal" ], - "throws": "Invalid decimal (1:0)" + "throws": "Invalid decimal. (1:0)" } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-e/output.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-e/output.json index 1ae22702c120..e6de275ebd4a 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-e/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-e/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid decimal (1:0)" + "SyntaxError: Invalid decimal. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-hexadecimal/options.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-hexadecimal/options.json index 258615f550b5..ac9f6e0c2976 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-hexadecimal/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-hexadecimal/options.json @@ -2,5 +2,5 @@ "plugins": [ "decimal" ], - "throws": "Invalid decimal (1:0)" + "throws": "Invalid decimal. (1:0)" } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-non-octal-decimal-int/output.json index 60c5dbd4f533..dd00c655c614 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-non-octal-decimal-int/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-non-octal-decimal-int/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid decimal (1:0)" + "SyntaxError: Invalid decimal. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-legacy/output.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-legacy/output.json index 2c49c0fb79fe..2b5fe541e1a4 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-legacy/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-legacy/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid decimal (1:0)" + "SyntaxError: Invalid decimal. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-new/options.json b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-new/options.json index 258615f550b5..ac9f6e0c2976 100644 --- a/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-new/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decimal/invalid-octal-new/options.json @@ -2,5 +2,5 @@ "plugins": [ "decimal" ], - "throws": "Invalid decimal (1:0)" + "throws": "Invalid decimal. (1:0)" } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json index 083fa746f96b..ac182855aaa8 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax (1:15)" + "SyntaxError: Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-true-decorator-after-export/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-true-decorator-after-export/options.json index 8fc06b1b8c69..fb8aa087e818 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-true-decorator-after-export/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-true-decorator-after-export/options.json @@ -1,5 +1,12 @@ { + "plugins": [ + [ + "decorators", + { + "decoratorsBeforeExport": true + } + ] + ], "sourceType": "module", - "plugins": [["decorators", { "decoratorsBeforeExport": true }]], - "throws": "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax (1:7)" -} + "throws": "Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax. (1:7)" +} \ No newline at end of file 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 fd172b86c4d5..30ccb90fa3c7 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 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 47d78bbffa84..517d01cda9d3 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: 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 ab145b851060..6c325f5f3e08 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: 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 1268657c20ea..f56e95334661 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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Decorators cannot be used to decorate object literal properties (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-2/no-semi/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-semi/options.json index ffac21b69548..82f0c2e573ff 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-semi/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-semi/options.json @@ -1,3 +1,11 @@ { - "throws": "Decorators must not be followed by a semicolon (2:5)" -} + "plugins": [ + [ + "decorators", + { + "decoratorsBeforeExport": false + } + ] + ], + "throws": "Decorators must not be followed by a semicolon. (2:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/restricted-1/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/restricted-1/options.json index 9fc4104fb39c..adcec8cd5066 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/restricted-1/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/restricted-1/options.json @@ -1,3 +1,11 @@ { - "throws": "Leading decorators must be attached to a class declaration (1:6)" -} + "plugins": [ + [ + "decorators", + { + "decoratorsBeforeExport": false + } + ] + ], + "throws": "Leading decorators must be attached to a class declaration. (1:6)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/restricted-2/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/restricted-2/options.json index 9fc4104fb39c..adcec8cd5066 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/restricted-2/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/restricted-2/options.json @@ -1,3 +1,11 @@ { - "throws": "Leading decorators must be attached to a class declaration (1:6)" -} + "plugins": [ + [ + "decorators", + { + "decoratorsBeforeExport": false + } + ] + ], + "throws": "Leading decorators must be attached to a class declaration. (1:6)" +} \ No newline at end of file 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 b1e699b351b1..9ced77d44e81 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 @@ -2,6 +2,6 @@ "plugins": [ "decorators-legacy" ], - "throws": "A decorated export must export a class declaration (2:0)", + "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 b1e699b351b1..9ced77d44e81 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 @@ -2,6 +2,6 @@ "plugins": [ "decorators-legacy" ], - "throws": "A decorated export must export a class declaration (2:0)", + "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-semi/options.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-semi/options.json index ffac21b69548..1f5a9fbe704f 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/no-semi/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/no-semi/options.json @@ -1,3 +1,8 @@ { - "throws": "Decorators must not be followed by a semicolon (2:5)" -} + "plugins": [ + [ + "decorators-legacy" + ] + ], + "throws": "Decorators must not be followed by a semicolon. (2:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json index 37e56eeb13ba..aa1370dee87b 100644 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: import can only be used in import() or import.meta (1:1)" + "SyntaxError: `import` can only be used in `import()` or `import.meta`. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/invalid-default-from-identifier/output.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/invalid-default-from-identifier/output.json index cc0e24e848fe..5ddf61e3c74e 100644 --- a/packages/babel-parser/test/fixtures/experimental/export-extensions/invalid-default-from-identifier/output.json +++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/invalid-default-from-identifier/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: 'from' is not allowed as an identifier after 'export default' (1:15)" + "SyntaxError: 'from' is not allowed as an identifier after 'export default'. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-function-keyword-declaration/output.json b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-function-keyword-declaration/output.json index eaab0f905ba6..4909ee0409db 100644 --- a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-function-keyword-declaration/output.json +++ b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-function-keyword-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Missing semicolon (2:17)" + "SyntaxError: Missing semicolon. (2:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/incorrect-arity/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/incorrect-arity/output.json index de469d3cab1e..bfd8760dcdf2 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/incorrect-arity/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/incorrect-arity/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":75,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":65}}, "errors": [ - "SyntaxError: import() requires exactly one or two arguments (1:0)", - "SyntaxError: import() requires exactly one or two arguments (2:0)" + "SyntaxError: `import()` requires exactly one or two arguments. (1:0)", + "SyntaxError: `import()` requires exactly one or two arguments. (2:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-escaped-assert/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-escaped-assert/output.json index 31284550fd91..fcc951faa198 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-escaped-assert/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-escaped-assert/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ - "SyntaxError: Missing semicolon (1:12)", - "SyntaxError: Missing semicolon (1:24)" + "SyntaxError: Missing semicolon. (1:12)", + "SyntaxError: Missing semicolon. (1:24)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-export-without-from/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-export-without-from/output.json index 682ac330ebc0..8e0546403d41 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-export-without-from/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-export-without-from/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":39}}, "errors": [ - "SyntaxError: Missing semicolon (2:14)", - "SyntaxError: Missing semicolon (2:21)" + "SyntaxError: Missing semicolon. (2:14)", + "SyntaxError: Missing semicolon. (2:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-spread-element-import-call/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-spread-element-import-call/output.json index f016f97336e9..73e6a01ff02d 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-spread-element-import-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-spread-element-import-call/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: ... is not allowed in import() (1:21)" + "SyntaxError: `...` is not allowed in `import()`. (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type-string/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type-string/output.json index b6c67e2e6d94..6e8521a04568 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type-string/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type-string/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":81,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":81}}, "errors": [ - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:52)", - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:66)" + "SyntaxError: Duplicate key \"type\" is not allowed in module attributes. (1:52)", + "SyntaxError: Duplicate key \"type\" is not allowed in module attributes. (1:66)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type/output.json index 5d8f1cee0e88..4b9130a19719 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/invalid-syntax-with-repeated-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "errors": [ - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:50)" + "SyntaxError: Duplicate key \"type\" is not allowed in module attributes. (1:50)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json index 31e3705afb81..dce442f8ffc0 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/string-literal/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":101,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":52}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:36)", - "SyntaxError: The only accepted module attribute is `type` (2:40)" + "SyntaxError: The only accepted module attribute is `type`. (1:36)", + "SyntaxError: The only accepted module attribute is `type`. (2:40)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-invalid-value/options.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-invalid-value/options.json index 8fde8e5bc0ba..274b43a4b5c8 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-invalid-value/options.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-invalid-value/options.json @@ -5,5 +5,5 @@ ] ], "sourceType": "module", - "throws": "Only string literals are allowed as module attribute values (1:60)" + "throws": "Only string literals are allowed as module attribute values. (1:60)" } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-no-type-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-no-type-attribute/output.json index c728fc223164..487d980a1d3b 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-no-type-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-no-type-attribute/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:40)" + "SyntaxError: The only accepted module attribute is `type`. (1:40)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-object-method-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-object-method-attribute/output.json index 7a44aa2b8d85..d17d1e8bd120 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-object-method-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-object-method-attribute/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":79}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:54)" + "SyntaxError: The only accepted module attribute is `type`. (1:54)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-repeated-type/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-repeated-type/output.json index 4c24d416cc23..027b2393ea88 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-repeated-type/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-export-with-repeated-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}}, "errors": [ - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:54)" + "SyntaxError: Duplicate key \"type\" is not allowed in module attributes. (1:54)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-invalid-value/options.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-invalid-value/options.json index a1951fb94624..c70777c18cfa 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-invalid-value/options.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-invalid-value/options.json @@ -5,5 +5,5 @@ ] ], "sourceType": "module", - "throws": "Only string literals are allowed as module attribute values (1:56)" + "throws": "Only string literals are allowed as module attribute values. (1:56)" } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-no-type-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-no-type-attribute/output.json index 69a02fc5865f..1328bd89fc18 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-no-type-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-no-type-attribute/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:36)" + "SyntaxError: The only accepted module attribute is `type`. (1:36)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-object-method-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-object-method-attribute/output.json index 4259ecc0ee05..d29b9970cd24 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-object-method-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-assertions/valid-syntax-with-object-method-attribute/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":75,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":75}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:50)" + "SyntaxError: The only accepted module attribute is `type`. (1:50)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/import-with-statement/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/import-with-statement/output.json index cccb9e1b329d..3cf88fc56351 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/import-with-statement/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/import-with-statement/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: 'with' in strict mode (2:0)" + "SyntaxError: 'with' in strict mode. (2:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/incorrect-arity/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/incorrect-arity/output.json index fbc2d14ad598..c6d5c8559db2 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/incorrect-arity/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/incorrect-arity/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":63}}, "errors": [ - "SyntaxError: import() requires exactly one or two arguments (1:0)", - "SyntaxError: import() requires exactly one or two arguments (2:0)" + "SyntaxError: `import()` requires exactly one or two arguments. (1:0)", + "SyntaxError: `import()` requires exactly one or two arguments. (2:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/invalid-spread-element-import-call/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/invalid-spread-element-import-call/output.json index f016f97336e9..73e6a01ff02d 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/invalid-spread-element-import-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/invalid-spread-element-import-call/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: ... is not allowed in import() (1:21)" + "SyntaxError: `...` is not allowed in `import()`. (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-invalid-value/options.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-invalid-value/options.json index f21e649b0f1d..31598c9503d2 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-invalid-value/options.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-invalid-value/options.json @@ -8,5 +8,5 @@ ] ], "sourceType": "module", - "throws": "Only string literals are allowed as module attribute values (1:52)" + "throws": "Only string literals are allowed as module attribute values. (1:52)" } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-no-type-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-no-type-attribute/output.json index a3bbfd621562..6791eb25360d 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-no-type-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-no-type-attribute/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:32)" + "SyntaxError: The only accepted module attribute is `type`. (1:32)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-object-method-attribute/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-object-method-attribute/output.json index 12af675ae8b5..6c04f786b853 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-object-method-attribute/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-object-method-attribute/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}}, "errors": [ - "SyntaxError: The only accepted module attribute is `type` (1:46)" + "SyntaxError: The only accepted module attribute is `type`. (1:46)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-repeated-type/output.json b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-repeated-type/output.json index ad53ece6e4dc..cfa3028cc06a 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-repeated-type/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-attributes/valid-syntax-with-repeated-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "errors": [ - "SyntaxError: Duplicate key \"type\" is not allowed in module attributes (1:46)" + "SyntaxError: Duplicate key \"type\" is not allowed in module attributes. (1:46)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-await-label-in-module-blocks/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-await-label-in-module-blocks/output.json index 5b7d9f6731e8..d6e97dfea9a0 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-await-label-in-module-blocks/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-await-label-in-module-blocks/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Unexpected reserved word 'await' (1:9)" + "SyntaxError: Unexpected reserved word 'await'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json index 86b7e8c0c9e4..3326a47bcd8b 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Private name #p is not defined (4:22)" + "SyntaxError: Private name #p is not defined. (4:22)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks01/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks01/output.json index 571c2383d6ec..433158e333c2 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks01/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks01/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Export 'foo' is not defined (2:11)" + "SyntaxError: Export 'foo' is not defined. (2:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks02/output.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks02/output.json index bd11a6632a11..4da25389967a 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks02/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-undefined-export-in-module-blocks02/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Export 'foo' is not defined (3:11)" + "SyntaxError: Export 'foo' is not defined. (3:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json b/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json index 8beba46012b2..858ff9048303 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json +++ b/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":127,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":52}}, "errors": [ - "SyntaxError: An export name cannot include a lone surrogate, found '\\ud800' (2:16)" + "SyntaxError: An export name cannot include a lone surrogate, found '\\ud800'. (2:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json index f92740eabc90..2c9791192907 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Unexpected argument placeholder (3:16)", - "SyntaxError: Unexpected argument placeholder (3:19)" + "SyntaxError: Unexpected argument placeholder. (3:16)", + "SyntaxError: Unexpected argument placeholder. (3:19)" ], "program": { "type": "Program", @@ -103,12 +103,12 @@ "type": "ThisExpression", "start":69,"end":73,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":8}} }, + "computed": false, "property": { "type": "Identifier", "start":74,"end":75,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "right": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json index 6b08f2e6eb24..2f6afad78036 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected argument placeholder (1:11)", - "SyntaxError: Unexpected argument placeholder (1:17)" + "SyntaxError: Unexpected argument placeholder. (1:11)", + "SyntaxError: Unexpected argument placeholder. (1:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json index f62c456f95b6..7f9de01c8262 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Missing semicolon (2:19)" + "SyntaxError: Missing semicolon. (2:19)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json index 6c724302e0b3..699e25b0154f 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json @@ -3,7 +3,7 @@ "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ "SyntaxError: Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option. (1:5)", - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:5)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await-f/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await-f/options.json index 98b0d71d084e..5833aa6792d1 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await-f/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await-f/options.json @@ -1,4 +1,11 @@ { - "plugins": [["pipelineOperator", { "proposal": "minimal" }]], - "throws": "Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal (2:14)" -} + "plugins": [ + [ + "pipelineOperator", + { + "proposal": "minimal" + } + ] + ], + "throws": "Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal. (2:14)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await/options.json index 98b0d71d084e..5833aa6792d1 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await/options.json @@ -1,4 +1,11 @@ { - "plugins": [["pipelineOperator", { "proposal": "minimal" }]], - "throws": "Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal (2:14)" -} + "plugins": [ + [ + "pipelineOperator", + { + "proposal": "minimal" + } + ] + ], + "throws": "Unexpected \"await\" after pipeline body; await must have parentheses in minimal proposal. (2:14)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json index 21cf0ef9779b..5cf158b587ad 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Pipeline head should not be a comma-separated sequence expression (1:0)" + "SyntaxError: Pipeline head should not be a comma-separated sequence expression. (1:0)" ], "program": { "type": "Program", @@ -19,6 +19,10 @@ "left": { "type": "SequenceExpression", "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "expressions": [ { "type": "NumericLiteral", @@ -38,11 +42,7 @@ }, "value": 2 } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "operator": "|>", "right": { diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-invalid-hash-token,-followed-by-digit/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-invalid-hash-token,-followed-by-digit/options.json index a2f6f625f90c..71621d63481a 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-invalid-hash-token,-followed-by-digit/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-invalid-hash-token,-followed-by-digit/options.json @@ -1,4 +1,11 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Unexpected digit after hash token (1:5)" -} + "plugins": [ + [ + "pipelineOperator", + { + "proposal": "smart" + } + ] + ], + "throws": "Unexpected digit after hash token. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json index d7262f7ab729..58b07efb5aeb 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:5)" ], "program": { "type": "Program", @@ -28,6 +28,10 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "id": null, "generator": false, "async": false, @@ -56,10 +60,6 @@ "name": "f" } } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json index e8ce055d0d81..0a12a16ad6b5 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:16)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:16)" ], "program": { "type": "Program", @@ -28,6 +28,10 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "id": null, "generator": false, "async": false, @@ -69,10 +73,6 @@ } } } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json index 1c55597d1ea8..0f4ff2959268 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:5)" ], "program": { "type": "Program", @@ -28,6 +28,10 @@ "expression": { "type": "ArrowFunctionExpression", "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "id": null, "generator": false, "async": false, @@ -55,10 +59,6 @@ "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json index 4e08420cc88a..76621d804b23 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:11)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:11)" ], "program": { "type": "Program", @@ -28,6 +28,10 @@ "expression": { "type": "BinaryExpression", "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "left": { "type": "PipelinePrimaryTopicReference", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} @@ -46,10 +50,6 @@ }, "arguments": [] } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json index 9c89df8ebff9..3d5dd55ce1f9 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:5)" ], "program": { "type": "Program", @@ -28,6 +28,10 @@ "expression": { "type": "BinaryExpression", "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, "left": { "type": "Identifier", "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, @@ -42,10 +46,6 @@ "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" } - }, - "extra": { - "parenthesized": true, - "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json index f4a75092e3cf..c6eec8dc7101 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Pipeline body may not be a comma-separated sequence expression (1:6)" + "SyntaxError: Pipeline body may not be a comma-separated sequence expression. (1:6)" ], "program": { "type": "Program", @@ -35,6 +35,10 @@ "expression": { "type": "SequenceExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, + "extra": { + "parenthesized": true, + "parenStart": 6 + }, "expressions": [ { "type": "PipelinePrimaryTopicReference", @@ -44,11 +48,7 @@ "type": "PipelinePrimaryTopicReference", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}} } - ], - "extra": { - "parenthesized": true, - "parenStart": 6 - } + ] } } }, diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json index c774d9cb44f7..ae82401e5220 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Pipeline body may not be a comma-separated sequence expression (1:6)" + "SyntaxError: Pipeline body may not be a comma-separated sequence expression. (1:6)" ], "program": { "type": "Program", @@ -32,6 +32,10 @@ "expression": { "type": "SequenceExpression", "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, + "extra": { + "parenthesized": true, + "parenStart": 6 + }, "expressions": [ { "type": "PipelinePrimaryTopicReference", @@ -41,11 +45,7 @@ "type": "PipelinePrimaryTopicReference", "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}} } - ], - "extra": { - "parenthesized": true, - "parenStart": 6 - } + ] } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json index 556699d07afc..98c5ae1ab6f6 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", @@ -33,12 +33,12 @@ "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, + "computed": true, "property": { "type": "Identifier", "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" - }, - "computed": true + } } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json index 6e09acd357ab..03a4f94e336b 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json index 4c0d88c5a719..bb0ec03e3aa1 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json index 18fa5a9166ad..a2a9389e68cc 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json index 06a45df42fac..3363e00e6ded 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:22)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:22)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json index e673a7df67c9..e77303e8aad9 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (2:48)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (2:11)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (2:48)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (2:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json index b413aeb837f3..b59317570054 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:45)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:45)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json index f907f6c39b60..1093dabf1139 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:32)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:32)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json index b5610cbd5590..7f5b97a41831 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:34)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:34)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json index cd596f541bf2..344da50b5d59 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (3:32)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (3:32)" ], "program": { "type": "Program", @@ -53,12 +53,12 @@ "start":22,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12},"identifierName":"JSON"}, "name": "JSON" }, + "computed": false, "property": { "type": "Identifier", "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, "name": "parse" - }, - "computed": false + } }, "arguments": [ { @@ -97,12 +97,12 @@ "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"console"}, "name": "console" }, + "computed": false, "property": { "type": "Identifier", "start":65,"end":70,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, "name": "error" - }, - "computed": false + } }, "arguments": [ { diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json index cde715cc8a70..e36e609e28b6 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:34)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:34)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json index 10719f0083a3..b12167e9c644 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:24)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:24)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/options.json index a684795fbfb9..c4d1cfc53f07 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/options.json @@ -1,4 +1,11 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized (1:8)" -} + "plugins": [ + [ + "pipelineOperator", + { + "proposal": "smart" + } + ] + ], + "throws": "Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized. (1:8)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json index 499705448de1..dcf7d7105d55 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":45}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:39)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:39)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:5)" ], "program": { "type": "Program", @@ -68,12 +68,12 @@ "type": "ThisExpression", "start":30,"end":34,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":34}} }, + "computed": false, "property": { "type": "Identifier", "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"x"}, "name": "x" - }, - "computed": false + } }, "right": { "type": "PipelinePrimaryTopicReference", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json index 1aa91e74b179..88eb526ee274 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:19)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:19)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json index 6c2b7a1acf34..9e45ecfa0c71 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:19)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" + "SyntaxError: Topic reference was used in a lexical context without topic binding. (1:19)", + "SyntaxError: Pipeline is in topic style but does not use topic reference. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json index d641de74a78d..bb4be6f0b83c 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:7)" + "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`). (4:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json index b6dd5e0efde8..937249312e48 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:10)" + "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`). (4:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json index f690ece03932..0c4896736ec7 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:6)" + "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`). (4:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json index fa97d8cdcf31..b6196e5fc62c 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:7)" + "SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`). (4:7)" ], "program": { "type": "Program", @@ -74,14 +74,14 @@ "left": { "type": "PrivateName", "start":38,"end":40,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":7}}, + "extra": { + "parenthesized": true, + "parenStart": 37 + }, "id": { "type": "Identifier", "start":39,"end":40,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":7},"identifierName":"x"}, "name": "x" - }, - "extra": { - "parenthesized": true, - "parenStart": 37 } }, "operator": "in", diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/output.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/output.json index faefdfa5404b..43986a918741 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Private name #x is not defined (3:4)" + "SyntaxError: Private name #x is not defined. (3:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-end-bar/options.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-end-bar/options.json index de1fad0a7393..a9774f0d38ea 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-end-bar/options.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-end-bar/options.json @@ -1,4 +1,11 @@ { - "plugins": [["recordAndTuple", { "syntaxType": "hash" }]], - "throws": "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar' (1:0)" -} + "plugins": [ + [ + "recordAndTuple", + { + "syntaxType": "hash" + } + ] + ], + "throws": "Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-start-bar/options.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-start-bar/options.json index ad916de06150..48de601e90a1 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-start-bar/options.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-start-bar/options.json @@ -1,4 +1,11 @@ { - "plugins": [["recordAndTuple", { "syntaxType": "hash" }]], - "throws": "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar' (1:0)" -} + "plugins": [ + [ + "recordAndTuple", + { + "syntaxType": "hash" + } + ] + ], + "throws": "Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-start-hash/options.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-start-hash/options.json index 9d23281e46d6..c93ec6c9c98a 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-start-hash/options.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-record-start-hash/options.json @@ -1,4 +1,11 @@ { - "plugins": [["recordAndTuple", { "syntaxType": "bar" }]], - "throws": "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash' (1:0)" -} + "plugins": [ + [ + "recordAndTuple", + { + "syntaxType": "bar" + } + ] + ], + "throws": "Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-end-bar/options.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-end-bar/options.json index cacf8c4cadda..9d8814b7e889 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-end-bar/options.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-end-bar/options.json @@ -1,4 +1,11 @@ { - "plugins": [["recordAndTuple", { "syntaxType": "hash" }]], - "throws": "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar' (1:0)" -} + "plugins": [ + [ + "recordAndTuple", + { + "syntaxType": "hash" + } + ] + ], + "throws": "Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-start-bar/options.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-start-bar/options.json index c7b3f7a090ab..d217cbfae4d4 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-start-bar/options.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-start-bar/options.json @@ -1,4 +1,11 @@ { - "plugins": [["recordAndTuple", { "syntaxType": "hash" }]], - "throws": "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar' (1:0)" -} + "plugins": [ + [ + "recordAndTuple", + { + "syntaxType": "hash" + } + ] + ], + "throws": "Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-start-hash/options.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-start-hash/options.json index 4a28c837723d..a6d1b353aaeb 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-start-hash/options.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/incorrect-type-tuple-start-hash/options.json @@ -1,4 +1,11 @@ { - "plugins": [["recordAndTuple", { "syntaxType": "bar" }]], - "throws": "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash' (1:0)" -} + "plugins": [ + [ + "recordAndTuple", + { + "syntaxType": "bar" + } + ] + ], + "throws": "Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-method/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-method/output.json index b918fb65e408..002513eb8a1b 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-method/output.json @@ -2,11 +2,11 @@ "type": "File", "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Only properties and spread elements are allowed in record definitions (2:2)", - "SyntaxError: Only properties and spread elements are allowed in record definitions (3:2)", - "SyntaxError: Only properties and spread elements are allowed in record definitions (4:2)", - "SyntaxError: Only properties and spread elements are allowed in record definitions (5:2)", - "SyntaxError: Only properties and spread elements are allowed in record definitions (6:2)" + "SyntaxError: Only properties and spread elements are allowed in record definitions. (2:2)", + "SyntaxError: Only properties and spread elements are allowed in record definitions. (3:2)", + "SyntaxError: Only properties and spread elements are allowed in record definitions. (4:2)", + "SyntaxError: Only properties and spread elements are allowed in record definitions. (5:2)", + "SyntaxError: Only properties and spread elements are allowed in record definitions. (6:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-proto/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-proto/output.json index 4f409dffa250..f6258ed64591 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-proto/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-record-proto/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: '__proto__' is not allowed in Record expressions (1:3)" + "SyntaxError: '__proto__' is not allowed in Record expressions. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-tuple-holes/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-tuple-holes/output.json index 40d2d81f688e..f8797f38968a 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-tuple-holes/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/invalid-tuple-holes/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Unexpected token ',' (1:3)" + "SyntaxError: Unexpected token ','. (1:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json index 609dda3bbf1b..69fddd506ff5 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json index e3b8e5b00191..0fc67ba12484 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json index 0179dbeaeaff..e59bbfe2cad5 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json index 3c29809b70f4..8b9d391fee4e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json index a1809a9c8d81..e0d283b698ba 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json index 8e236a6eadc1..d802658a976f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json index e7b147232828..521ca332fc89 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json index 4a43408b0fbc..ff5cdbb036e9 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json index 44c794754aa4..37db4ca5d327 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json index 455448a59aef..45fe8a611f1c 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json index 8168708424a4..92696d6a2b7a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json index ce52b8a32780..b12e604a227f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json index 35f991fe7e66..2191fe47e3c3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json index 7cb40307353a..fd022b18743e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json index eff90743fb54..c8a8ace0731e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json index 1087c48d75b5..285ba8b261d3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json index c5667acab8c3..e0e25f0d9dbe 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json index 79f7bd562e1e..1469759e01c3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json index 4f81da2ce933..b38cc4f6ec37 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json index 723655879b5f..2f2690a5c967 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json index e4a9490764ce..29e0c9be4038 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json index da8fed17fc46..0587eaa80589 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json index 7ae0eef00647..9e5506d91600 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json index c24fdfc69ccb..8509c759ef1f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json index 82c45a0863af..ad4e07051ead 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json index 653f4d11577a..e7104ab464e1 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json index 411c960f4bd9..fbccc2e520e4 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json index 58f335c032b2..451cc64b4e0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json index 1bb35ed64a9f..8442b1ae1341 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json index b713e29da119..d5eae3f8319c 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json index f46c259f1f2b..fc0eb2ff7935 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json index 0bc304bb7f24..105e8497892a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":17}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json index d49ff0ece275..5598ae1a64be 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json index e5802b234722..7454907ab06a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json index fd45665f95f1..1006aef7e6d3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json index 5778cecc9dc6..46dc9e4f1cf8 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json index fde0d72e80dd..afd42f7f2ea3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json index ed08a002f952..d523942ca20f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json index 17bae3ae9977..641d258d1f0f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json index 66c1f8c3f742..28eb8064224e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json index e0a9cd51c3a4..e4c24b282432 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json index f6098844bbd8..f488d02eb209 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json index 73f36b31b12f..b5e6c1c2e5ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json index c20647b9ca75..92b6d035b94b 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json index 6d1d532d73cb..fa3c7c9528d9 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json index 14f94a2dfd62..c3a94a681d8c 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json index 9dc1704ccb9d..532638d1aa58 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json index bf1a1f2cd623..cdb7e813f425 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json index a091d166a9cd..f0f002f58f65 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json index 00c9046112e0..7d7cf713053a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json index 1a31ef55aa0f..44fdb2c31daf 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json index 0743ba782383..06ecc3f9b93b 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json index 3ca7f733f342..7e17cc54d65d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json index dd14b4489249..464f64d5705d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json index 46e5846787ca..4a113e829cdd 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json index d765a4698e87..c20a14a38516 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json index 85fc081b8e3c..9e6f2f2fcf91 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json index 2b9b23d37689..7dc2b8dd81ad 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json index 05837f4a9777..8ba27d9e2247 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json index aad86fddc422..315096395c8d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json index 1710ddd99dd0..966732da59b2 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json index aee11de08c59..97b660a32885 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json index 0e1c9101ebcb..58c471e5b02d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json index c705268ab87a..b655d26b306f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json index e7434d46f7a1..3ab854d6dde6 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json index 5a00ed65e725..a823b83638de 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json index 4d6328f56dd1..947114672460 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:10)" + "SyntaxError: Invalid escape sequence in template. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json index e2385a402468..67136a55292d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "errors": [ - "SyntaxError: Invalid escape sequence in template (1:2)" + "SyntaxError: Invalid escape sequence in template. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/output.json index 47dbaed6089b..095abcd5bac6 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (1:6)" + "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json index 71e47b18fa76..1a605c119399 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions (2:6)" + "SyntaxError: 'await' is only allowed within async functions. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/output.json index 27236952ad5a..7187b528a95e 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (2:2)" + "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/output.json index 1b4283b27129..bc5e8e26746e 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-script/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (1:0)" + "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/41/options.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/41/options.json index 04f4b2b1a5c5..a97865953786 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/41/options.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/41/options.json @@ -1,4 +1,6 @@ { - "plugins": ["decorators-legacy"], - "throws": "Leading decorators must be attached to a class declaration (1:5)" -} + "plugins": [ + "decorators-legacy" + ], + "throws": "Leading decorators must be attached to a class declaration. (1:5)" +} \ 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 7f6646ea0dfc..f1feb7e203c2 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/42/options.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/42/options.json @@ -2,5 +2,5 @@ "plugins": [ "decorators-legacy" ], - "throws": "Decorators must be attached to a class element (1:18)" + "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/classes/constructor-override-with-class-prop-plugin/output.json b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json index 078602d8aced..1e4afb6959a7 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json +++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Classes may not have a field named 'constructor' (2:2)" + "SyntaxError: Classes may not have a field named 'constructor'. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/comment/06-type-include-error/options.json b/packages/babel-parser/test/fixtures/flow/comment/06-type-include-error/options.json index 88f910bcebbf..7a153491b5a6 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/06-type-include-error/options.json +++ b/packages/babel-parser/test/fixtures/flow/comment/06-type-include-error/options.json @@ -1,3 +1,15 @@ { - "throws": "Unterminated comment (2:2)" -} + "sourceType": "module", + "plugins": [ + [ + "jsx" + ], + [ + "flow" + ], + [ + "flowComments" + ] + ], + "throws": "Unterminated comment. (2:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/07-type-include-error/options.json b/packages/babel-parser/test/fixtures/flow/comment/07-type-include-error/options.json index eb40f4f05235..53b11019faad 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/07-type-include-error/options.json +++ b/packages/babel-parser/test/fixtures/flow/comment/07-type-include-error/options.json @@ -1,3 +1,15 @@ { - "throws": "Unterminated comment (1:0)" -} + "sourceType": "module", + "plugins": [ + [ + "jsx" + ], + [ + "flow" + ], + [ + "flowComments" + ] + ], + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/08-type-flow-include-error/options.json b/packages/babel-parser/test/fixtures/flow/comment/08-type-flow-include-error/options.json index eb40f4f05235..53b11019faad 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/08-type-flow-include-error/options.json +++ b/packages/babel-parser/test/fixtures/flow/comment/08-type-flow-include-error/options.json @@ -1,3 +1,15 @@ { - "throws": "Unterminated comment (1:0)" -} + "sourceType": "module", + "plugins": [ + [ + "jsx" + ], + [ + "flow" + ], + [ + "flowComments" + ] + ], + "throws": "Unterminated comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/09-type-flow-include-error/options.json b/packages/babel-parser/test/fixtures/flow/comment/09-type-flow-include-error/options.json index 88f910bcebbf..7a153491b5a6 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/09-type-flow-include-error/options.json +++ b/packages/babel-parser/test/fixtures/flow/comment/09-type-flow-include-error/options.json @@ -1,3 +1,15 @@ { - "throws": "Unterminated comment (2:2)" -} + "sourceType": "module", + "plugins": [ + [ + "jsx" + ], + [ + "flow" + ], + [ + "flowComments" + ] + ], + "throws": "Unterminated comment. (2:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/10-type-annotation-error/options.json b/packages/babel-parser/test/fixtures/flow/comment/10-type-annotation-error/options.json index 4e97b8b84490..6c58eeaa58a9 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/10-type-annotation-error/options.json +++ b/packages/babel-parser/test/fixtures/flow/comment/10-type-annotation-error/options.json @@ -1,3 +1,15 @@ { - "throws": "Unterminated comment (1:22)" -} + "sourceType": "module", + "plugins": [ + [ + "jsx" + ], + [ + "flow" + ], + [ + "flowComments" + ] + ], + "throws": "Unterminated comment. (1:22)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/11-nested-comments-invalid/options.json b/packages/babel-parser/test/fixtures/flow/comment/11-nested-comments-invalid/options.json index 8b8fde928397..fa8393d46ad0 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/11-nested-comments-invalid/options.json +++ b/packages/babel-parser/test/fixtures/flow/comment/11-nested-comments-invalid/options.json @@ -1,3 +1,15 @@ { - "throws": "Unterminated comment (1:5)" -} + "sourceType": "module", + "plugins": [ + [ + "jsx" + ], + [ + "flow" + ], + [ + "flowComments" + ] + ], + "throws": "Unterminated comment. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json index 6f4643e82a44..bfcedf2ad9ae 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json @@ -2,22 +2,22 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Unterminated flow-comment (1:13)" + "SyntaxError: Unterminated flow-comment. (1:13)" ], "program": { "type": "Program", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, - "sourceType": "module", - "interpreter": null, - "body": [], - "directives": [], "innerComments": [ { "type": "CommentLine", "value": "asd */", "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}} } - ] + ], + "sourceType": "module", + "interpreter": null, + "body": [], + "directives": [] }, "comments": [ { diff --git a/packages/babel-parser/test/fixtures/flow/comment/13-nested-flow-comments-invalid/options.json b/packages/babel-parser/test/fixtures/flow/comment/13-nested-flow-comments-invalid/options.json index fb8fdf85eed0..d06b54b623ed 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/13-nested-flow-comments-invalid/options.json +++ b/packages/babel-parser/test/fixtures/flow/comment/13-nested-flow-comments-invalid/options.json @@ -1,3 +1,15 @@ { - "throws": "Cannot have a flow comment inside another flow comment (1:0)" -} + "sourceType": "module", + "plugins": [ + [ + "jsx" + ], + [ + "flow" + ], + [ + "flowComments" + ] + ], + "throws": "Cannot have a flow comment inside another flow comment. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-declare-export-type/options.json b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-declare-export-type/options.json index 2f2a34e73580..52dfd40dfe6e 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-declare-export-type/options.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-declare-export-type/options.json @@ -1,3 +1,8 @@ { - "throws": "`declare export type` is not supported. Use `export type` instead (1:15)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ], + "throws": "`declare export type` is not supported. Use `export type` instead. (1:15)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-const/options.json b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-const/options.json index 8466e2ca853c..0e5a23146200 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-const/options.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-const/options.json @@ -1,3 +1,8 @@ { - "throws": "`declare export const` is not supported. Use `declare export var` instead (1:15)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ], + "throws": "`declare export const` is not supported. Use `declare export var` instead. (1:15)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-default-var/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-default-var/output.json index 79403b71b304..d967e14c3970 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-default-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-default-var/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Missing semicolon (1:26)" + "SyntaxError: Missing semicolon. (1:26)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-interface/options.json b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-interface/options.json index 3977f3c48054..a4f4398504eb 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-interface/options.json @@ -1,3 +1,8 @@ { - "throws": "`declare export interface` is not supported. Use `export interface` instead (1:15)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ], + "throws": "`declare export interface` is not supported. Use `export interface` instead. (1:15)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-let/options.json b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-let/options.json index 745a711f1178..fc259b7d22b4 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-let/options.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/invalid-export-let/options.json @@ -1,3 +1,8 @@ { - "throws": "`declare export let` is not supported. Use `declare export var` instead (1:15)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ], + "throws": "`declare export let` is not supported. Use `declare export var` instead. (1:15)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/8/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/8/options.json index 32826163f102..07c925b39115 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/8/options.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/8/options.json @@ -1,3 +1,8 @@ { - "throws": "Only declares and type imports are allowed inside declare module (2:2)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ], + "throws": "Only declares and type imports are allowed inside declare module. (2:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json index 6b671f1ed633..1411eb174450 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":87}}, "errors": [ - "SyntaxError: Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:55)" + "SyntaxError: Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module. (1:55)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json index a1bf5fae4b25..456dfcbf1491 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":86}}, "errors": [ - "SyntaxError: Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:53)" + "SyntaxError: Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module. (1:53)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json index 6155f8eda4f7..c6c5d3a2c3b5 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ - "SyntaxError: Imports within a `declare module` body must always be `import type` or `import typeof` (1:21)" + "SyntaxError: Imports within a `declare module` body must always be `import type` or `import typeof`. (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json index bd3851fd4f37..477e9cb675db 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ - "SyntaxError: `declare module` cannot be used inside another `declare module` (1:27)" + "SyntaxError: `declare module` cannot be used inside another `declare module`. (1:27)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json index b16aeb7c7e86..137e8fd6036a 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "errors": [ - "SyntaxError: Duplicate `declare module.exports` statement (1:55)" + "SyntaxError: Duplicate `declare module.exports` statement. (1:55)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/invalid-literal/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/invalid-literal/output.json index 6418fa0d75e6..e6a5a8117947 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/invalid-literal/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/invalid-literal/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + "SyntaxError: Missing semicolon. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json index a48c8cad045b..2a5e58c6beac 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ - "SyntaxError: Unexpected keyword 'class' (1:5)" + "SyntaxError: Unexpected keyword 'class'. (1:5)" ], "program": { "type": "Program", @@ -21,9 +21,9 @@ "body": { "type": "EnumStringBody", "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":1}}, + "hasUnknownMembers": false, "explicitType": false, - "members": [], - "hasUnknownMembers": false + "members": [] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json index 79791869df20..35964d8e517b 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ - "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)" + "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions. (3:2)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "DeclareClass", "start":8,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":4,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, @@ -30,14 +37,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json index 5f245815fbf6..1d1b441e43bb 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)" + "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions. (4:2)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "DeclareClass", "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"B"}, @@ -50,14 +57,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json index 6933be95528f..def4a6ab48f4 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)", - "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (3:2)" + "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions. (3:2)", + "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object. (3:2)" ], "program": { "type": "Program", @@ -14,6 +14,13 @@ { "type": "DeclareClass", "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"C"}, @@ -51,14 +58,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json index 6c4b0246e420..baf91fda2fc7 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)", - "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (4:2)" + "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions. (4:2)", + "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object. (4:2)" ], "program": { "type": "Program", @@ -14,6 +14,13 @@ { "type": "DeclareClass", "start":8,"end":64,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"D"}, @@ -70,14 +77,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json index 6cbdf063a824..52ca6a7b16c4 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)" + "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions. (4:2)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "InterfaceDeclaration", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"F"}, @@ -50,14 +57,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json index ef17a8522e31..c05fb49b077f 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ - "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)", - "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (3:2)" + "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions. (3:2)", + "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object. (3:2)" ], "program": { "type": "Program", @@ -14,6 +14,13 @@ { "type": "InterfaceDeclaration", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"G"}, @@ -51,14 +58,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json index c8b023403203..e387f51c3ecc 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ - "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)", - "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (4:2)" + "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions. (4:2)", + "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object. (4:2)" ], "program": { "type": "Program", @@ -14,6 +14,13 @@ { "type": "InterfaceDeclaration", "start":8,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"H"}, @@ -70,14 +77,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json index 94a068947058..78a7c5b5129c 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "errors": [ - "SyntaxError: Explicit inexact syntax cannot appear inside an explicit exact object type (2:25)" + "SyntaxError: Explicit inexact syntax cannot appear inside an explicit exact object type. (2:25)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "TypeAlias", "start":8,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -48,14 +55,7 @@ "internalSlots": [], "exact": true, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json index 36abf35d4535..0d9f4b00f006 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "errors": [ - "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:10)" + "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object. (2:10)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "TypeAlias", "start":8,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -48,14 +55,7 @@ "internalSlots": [], "exact": false, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json index 16a8edbd4bcb..2bf826537e20 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":37}}, "errors": [ - "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)" + "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object. (2:21)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "TypeAlias", "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":37}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, @@ -67,14 +74,7 @@ "internalSlots": [], "exact": false, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json index ff2e24bc5d28..15cdfdd17964 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "errors": [ - "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)" + "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object. (2:21)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "TypeAlias", "start":8,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"U"}, @@ -48,14 +55,7 @@ "internalSlots": [], "exact": false, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json index 40f82000ed09..f72a571b8678 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":32}}, "errors": [ - "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)" + "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object. (2:21)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "TypeAlias", "start":8,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"V"}, @@ -62,14 +69,7 @@ "internalSlots": [], "exact": false, "inexact": true - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json index ab97f0f061ed..870295c80707 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":30}}, "errors": [ - "SyntaxError: Unexpected reserved type bool (2:23)" + "SyntaxError: Unexpected reserved type bool. (2:23)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "InterfaceDeclaration", "start":9,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -51,14 +58,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json index 53fdc1eadb82..5ae6cee7b6bc 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":32}}, "errors": [ - "SyntaxError: Unexpected reserved type bool (2:23)" + "SyntaxError: Unexpected reserved type bool. (2:23)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "InterfaceDeclaration", "start":9,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -60,14 +67,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json index a9b966d7dba8..e7845d7709fb 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ - "SyntaxError: Unexpected reserved type bool (2:20)" + "SyntaxError: Unexpected reserved type bool. (2:20)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "InterfaceDeclaration", "start":9,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -41,14 +48,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json index 9c8eea94c707..3db5700fa537 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "errors": [ - "SyntaxError: Unexpected reserved type bool (2:20)" + "SyntaxError: Unexpected reserved type bool. (2:20)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "InterfaceDeclaration", "start":9,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "id": { "type": "Identifier", "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, @@ -50,14 +57,7 @@ "indexers": [], "internalSlots": [], "exact": false - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/assignment-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/assignment-expression/output.json index e0bd14b6ea94..87987732d0b1 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/assignment-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/assignment-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:0)" + "SyntaxError: Unexpected reserved word 'interface'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/binary-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/binary-expression/output.json index d4a672ad70ad..6fab807b4f4b 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/binary-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/binary-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:0)" + "SyntaxError: Unexpected reserved word 'interface'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/call-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/call-expression/output.json index aa6500d58b08..09abd7b564bc 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/call-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/call-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:0)" + "SyntaxError: Unexpected reserved word 'interface'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/class-declaration/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/class-declaration/output.json index 1193e8005e6f..eb39635cad1e 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/class-declaration/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/class-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:6)" + "SyntaxError: Unexpected reserved word 'interface'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/conditional-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/conditional-expression/output.json index f262c436627f..bf92baddfd42 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/conditional-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/conditional-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:0)" + "SyntaxError: Unexpected reserved word 'interface'. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/function-declaration/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/function-declaration/output.json index 47fedb9e186c..a60dbbf13b34 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/function-declaration/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:9)" + "SyntaxError: Unexpected reserved word 'interface'. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/import-statement/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/import-statement/output.json index d994e24f05fb..b8e8d006003b 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/import-statement/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/import-statement/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:7)" + "SyntaxError: Unexpected reserved word 'interface'. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/member-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/member-expression/output.json index 6a8a618b8f55..ae5cd2eba406 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/member-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/member-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (2:0)" + "SyntaxError: Unexpected reserved word 'interface'. (2:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/new-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/new-expression/output.json index 394218d16272..969cf3726cca 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/new-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/new-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:4)" + "SyntaxError: Unexpected reserved word 'interface'. (1:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json index 638420bfde16..42005e7bcc82 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/sequence-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:1)" + "SyntaxError: Unexpected reserved word 'interface'. (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/unary-expression/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/unary-expression/output.json index 47bfc9d51654..129b76cbbfb2 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/unary-expression/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/unary-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:5)" + "SyntaxError: Unexpected reserved word 'interface'. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/variable/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/variable/output.json index e040c227cced..f5873f3aa0ed 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/variable/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-as-identifier/variable/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:6)" + "SyntaxError: Unexpected reserved word 'interface'. (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json index 0cb78e7903e0..beb134cf75a8 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:10)" + "SyntaxError: Cannot overwrite reserved type string. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json index ae3f5125cf1c..7acd2649075d 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "errors": [ - "SyntaxError: Unexpected reserved type string (1:26)" + "SyntaxError: Unexpected reserved type string. (1:26)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json index 663e4c8f9dc4..8113695e2af4 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Unexpected reserved type string (1:21)" + "SyntaxError: Unexpected reserved type string. (1:21)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/03/output.json b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json index e056c32eb0a4..b60d7bb89e9d 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/03/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Invalid identifier @@asyncIterator (1:19)" + "SyntaxError: Invalid identifier @@asyncIterator. (1:19)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/04/output.json b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json index 106b8002e3e1..af13628daf67 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/04/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Invalid identifier @@iterator (1:14)" + "SyntaxError: Invalid identifier @@iterator. (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/05/output.json b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json index ca6b8b096ca9..62da6b46de38 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/05/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@asyncIterator (2:17)" + "SyntaxError: Invalid identifier @@asyncIterator. (2:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/06/output.json b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json index fad3d4597882..ab1dcead6990 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/06/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@iterator (2:12)" + "SyntaxError: Invalid identifier @@iterator. (2:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/07/output.json b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json index 265adf68c112..b9ecdcf070b9 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/07/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Invalid identifier @@iterator (1:15)" + "SyntaxError: Invalid identifier @@iterator. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/08/output.json b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json index 278c95feaf01..b37c770ce7ca 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/08/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "errors": [ - "SyntaxError: Invalid identifier @@asyncIterator (1:20)" + "SyntaxError: Invalid identifier @@asyncIterator. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/09/output.json b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json index 07177225478a..a227d4ac763b 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/09/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@iterator (2:12)" + "SyntaxError: Invalid identifier @@iterator. (2:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/10/output.json b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json index 836c3af1af2b..b50a5abc6096 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/10/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@asyncIterator (2:17)" + "SyntaxError: Invalid identifier @@asyncIterator. (2:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/iterator/11/output.json b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json index a97fb3437b0c..16cad2038841 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/11/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Invalid identifier @@random (2:10)" + "SyntaxError: Invalid identifier @@random. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/invalid-number-negative/options.json b/packages/babel-parser/test/fixtures/flow/literal-types/invalid-number-negative/options.json index d4fadede72f8..7e3708dd05ae 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/invalid-number-negative/options.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/invalid-number-negative/options.json @@ -1,3 +1,8 @@ { - "throws": "Unexpected token, expected \"number\" or \"bigint\" (1:8)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ], + "throws": "Unexpected token, expected \"number\" or \"bigint\". (1:8)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json index 246523ff7330..72eeed7be3ef 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "errors": [ - "SyntaxError: Identifier 'C1' has already been declared (2:6)" + "SyntaxError: Identifier 'C1' has already been declared. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json index edb012f084b6..ed99a0a53cba 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "errors": [ - "SyntaxError: Identifier 'I' has already been declared (2:10)" + "SyntaxError: Identifier 'I' has already been declared. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json index a17be34d1705..2604e8f329b1 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "errors": [ - "SyntaxError: Identifier 'T1' has already been declared (2:5)" + "SyntaxError: Identifier 'T1' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json index 200019bb51bd..60511cf37309 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: getter must not have any formal parameters (2:2)" + "SyntaxError: A 'get' accesor must not have any formal parameters. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json index d98c7d2c4130..2b8b981277f3 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: getter must not have any formal parameters (2:2)" + "SyntaxError: A 'get' accesor must not have any formal parameters. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json index fa18c3c235cd..e2425bb764a1 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: setter must have exactly one formal parameter (2:2)" + "SyntaxError: A 'set' accesor must have exactly one formal parameter. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json index b2207b3a6f28..f4a757bc130d 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: setter function argument must not be a rest parameter (2:2)" + "SyntaxError: A 'set' accesor function argument must not be a rest parameter. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json index 200ac258b04e..330bce798084 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:12)" + "SyntaxError: Cannot overwrite reserved type string. (1:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json index 92d62672928e..99b5c40cf3c8 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":24}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (2:11)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "ExpressionStatement", "start":43,"end":67,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Function which looks like a return type", + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} + } + ], "expression": { "type": "ConditionalExpression", "start":43,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, @@ -24,11 +31,11 @@ "consequent": { "type": "Identifier", "start":48,"end":49,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, - "name": "b", "extra": { "parenthesized": true, "parenStart": 47 - } + }, + "name": "b" }, "alternate": { "type": "ArrowFunctionExpression", @@ -63,14 +70,7 @@ "name": "e" } } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Function which looks like a return type", - "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json index f6bdf3a0ad89..89889f8f6fc8 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":36}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (2:8)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "ExpressionStatement", "start":47,"end":83,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter after type parameters", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} + } + ], "expression": { "type": "ConditionalExpression", "start":47,"end":82,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, @@ -66,11 +73,11 @@ "body": { "type": "Identifier", "start":71,"end":72,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25},"identifierName":"e"}, - "name": "e", "extra": { "parenthesized": true, "parenStart": 70 - } + }, + "name": "e" }, "typeParameters": { "type": "TypeParameterDeclaration", @@ -104,14 +111,7 @@ "name": "g" } } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter after type parameters", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json index d527059cda90..8674cdbad94d 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (2:5)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (2:5)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "ExpressionStatement", "start":47,"end":76,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter after type parameters", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} + } + ], "expression": { "type": "ConditionalExpression", "start":47,"end":75,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, @@ -51,11 +58,11 @@ "body": { "type": "Identifier", "start":64,"end":65,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"e"}, - "name": "e", "extra": { "parenthesized": true, "parenStart": 63 - } + }, + "name": "e" } }, "alternate": { @@ -77,14 +84,7 @@ "name": "g" } } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter after type parameters", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json index 72ec0ee8727d..dba5be30ebe1 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (2:11)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "ExpressionStatement", "start":25,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter", + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}} + } + ], "expression": { "type": "ConditionalExpression", "start":25,"end":59,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, @@ -51,11 +58,11 @@ "body": { "type": "Identifier", "start":48,"end":49,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":24},"identifierName":"d"}, - "name": "d", "extra": { "parenthesized": true, "parenStart": 47 - } + }, + "name": "d" } }, "alternate": { @@ -77,14 +84,7 @@ "name": "g" } } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Invalid LHS parameter", - "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json index c3c7f880bf51..11aaddc9f8ce 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:14)" + "SyntaxError: Identifier 'A' has already been declared. (2:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json index 24563be730dc..1cf712d55e5c 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:18)" + "SyntaxError: Identifier 'A' has already been declared. (2:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json index b687d1711180..bb4e78a5cfa4 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:10)" + "SyntaxError: Identifier 'A' has already been declared. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json index baeda3cb81d9..e772e9aae3ca 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:12)" + "SyntaxError: Identifier 'A' has already been declared. (2:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json index efef58004674..66f2dfa70ec2 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json index 33e3c985215c..122721c64fca 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:18)" + "SyntaxError: Identifier 'A' has already been declared. (2:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json index 555f58649c80..dda2cb323b66 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:14)" + "SyntaxError: Identifier 'A' has already been declared. (2:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json index dd8f7d4acb27..735a7e7d3875 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:4)" + "SyntaxError: Identifier 'A' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-func-declare-func/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-func-declare-func/output.json index ac0fe1790e79..51d503239e35 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-func-declare-func/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-func-declare-func/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:17)" + "SyntaxError: Identifier 'A' has already been declared. (2:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json index 4f2b265c8859..3f7ca64764ad 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:10)" + "SyntaxError: Identifier 'A' has already been declared. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json index d1e848e45942..3b3315551b51 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:14)" + "SyntaxError: Identifier 'A' has already been declared. (2:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json index 6a4433ea75d3..37ee03cd1c53 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:18)" + "SyntaxError: Identifier 'A' has already been declared. (2:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json index d102313ba870..0541efe5098e 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:10)" + "SyntaxError: Identifier 'A' has already been declared. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json index 085f418b8da3..dabb9e6868b3 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:12)" + "SyntaxError: Identifier 'A' has already been declared. (2:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json index 4f7bdf0cd238..ea9fe3a23d51 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json index b68fa592840b..e3f86747836f 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:6)" + "SyntaxError: Identifier 'A' has already been declared. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json index 00382a7d0f82..e2d56fdd9974 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:4)" + "SyntaxError: Identifier 'A' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json index bbcc52e79f84..9f336b096af1 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:12)" + "SyntaxError: Identifier 'A' has already been declared. (2:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json index ae77d22a5326..4c1e309bb834 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json index fcfa4d85054d..539999553481 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:4)" + "SyntaxError: Identifier 'A' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json index 6170eb332b03..3cbdce95a171 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:6)" + "SyntaxError: Identifier 'A' has already been declared. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json index 017c30dec6cd..f5913e48b7d1 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:10)" + "SyntaxError: Identifier 'A' has already been declared. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json index 33397a54dd82..bf2d2deacfff 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:4)" + "SyntaxError: Identifier 'A' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json index 13e009e688b1..9127083ccf95 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:12)" + "SyntaxError: Identifier 'A' has already been declared. (2:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json index b6c3a2ed34c1..99fb97a5bfeb 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json index 31719046a5b5..6d71a6844fd6 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:4)" + "SyntaxError: Identifier 'A' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json index 0dbab3e68b36..613c62173740 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:18)" + "SyntaxError: Identifier 'A' has already been declared. (2:18)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json index 80e7ca6b69f3..2723f74b4cb9 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:10)" + "SyntaxError: Identifier 'A' has already been declared. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json index 22d33f342732..fb5ddd470990 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:12)" + "SyntaxError: Identifier 'A' has already been declared. (2:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json index 749d355f7d5f..c7ce24f1ec0f 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-arrow-function/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-arrow-function/output.json index 954fd71984d6..c590ae09e7e4 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Binding invalid left-hand side in function parameter list (1:9)" + "SyntaxError: Binding invalid left-hand side in function parameter list. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter/output.json index 320f898c90e4..9656625921b0 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-getter/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: getter must not have any formal parameters (2:2)", + "SyntaxError: A 'get' accesor must not have any formal parameters. (2:2)", "SyntaxError: A getter cannot have a `this` parameter. (2:10)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter-type/output.json b/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter-type/output.json index 06408c4054a1..b7097b3ee38e 100644 --- a/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/this-annotation/this-setter-type/output.json @@ -3,7 +3,7 @@ "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: A setter cannot have a `this` parameter. (2:10)", - "SyntaxError: setter must have exactly one formal parameter (2:2)" + "SyntaxError: A 'set' accesor must have exactly one formal parameter. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json index bd280f5d148b..ce2d751eecc3 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":21}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type number (1:5)" + "SyntaxError: Cannot overwrite reserved type number. (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json index a9ad9925ad29..7e4ba7374c8a 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ - "SyntaxError: Unexpected reserved type number (1:9)" + "SyntaxError: Unexpected reserved type number. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json index 4ffc8971610e..61457b416420 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Unexpected reserved type string (1:11)" + "SyntaxError: Unexpected reserved type string. (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json index 6f5bb81982ce..9a9f84123d2d 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type bool (1:13)" + "SyntaxError: Cannot overwrite reserved type bool. (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json index 1c70bbf4c422..ca1acaeb919e 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Spread operator cannot appear in class or interface definitions (2:1)" + "SyntaxError: Spread operator cannot appear in class or interface definitions. (2:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json index f3000dfc4440..78f7f45078a7 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "errors": [ - "SyntaxError: Spread properties cannot have variance (3:1)" + "SyntaxError: Spread properties cannot have variance. (3:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json index 9822fae01d58..a0b64c179dc9 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "errors": [ - "SyntaxError: Unexpected reserved type interface (2:21)" + "SyntaxError: Unexpected reserved type interface. (2:21)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "VariableDeclaration", "start":9,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -60,14 +67,7 @@ } } ], - "kind": "const", - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + "kind": "const" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json index f719b76ee8a7..28c79510d2a9 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":36}}, "errors": [ - "SyntaxError: Unexpected reserved type number (2:22)" + "SyntaxError: Unexpected reserved type number. (2:22)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "VariableDeclaration", "start":9,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -60,14 +67,7 @@ } } ], - "kind": "const", - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + "kind": "const" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json index 0335f33501c6..4ae2409d44ac 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":30}}, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (2:16)" + "SyntaxError: Unexpected reserved word 'static'. (2:16)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "VariableDeclaration", "start":9,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -51,14 +58,7 @@ } } ], - "kind": "const", - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + "kind": "const" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json index 6a21871a8258..4b10af5f151b 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":40}}, "errors": [ - "SyntaxError: Unexpected reserved type interface (2:18)" + "SyntaxError: Unexpected reserved type interface. (2:18)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "VariableDeclaration", "start":9,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":40}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -60,14 +67,7 @@ } } ], - "kind": "const", - "leadingComments": [ - { - "type": "CommentLine", - "value": " @flow", - "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}} - } - ] + "kind": "const" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json index 8b2be7f584af..fb2ea336b82e 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25` (1:20)" + "SyntaxError: Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-invalid/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-invalid/output.json index bccd704e2e4e..b5a540d6c43e 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}` (1:0)" + "SyntaxError: Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`. (1:0)" ], "program": { "type": "Program", @@ -43,4 +43,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json index cbd99a19951e..a6c41f8a551c 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:14)" + "SyntaxError: Cannot overwrite reserved type string. (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json index 1e241ce54643..0f207a703de1 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:14)" + "SyntaxError: Cannot overwrite reserved type string. (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json index 4598f3355fcf..5057feb09e4a 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:19)" + "SyntaxError: Cannot overwrite reserved type string. (1:19)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json index 20c6c607313f..c023388b2229 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, "errors": [ - "SyntaxError: Unexpected keyword 'debugger' (1:17)" + "SyntaxError: Unexpected keyword 'debugger'. (1:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json index 37af63c0996a..4ee78d1c3f38 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements (1:13)" + "SyntaxError: The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements. (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json index 56fba75c81f5..b2d8bf49aaf4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:16)" + "SyntaxError: Cannot overwrite reserved type string. (1:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json index ff46538a95f6..ba5a39c96a01 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:14)" + "SyntaxError: Cannot overwrite reserved type string. (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json index 8d2dd58fa474..8cfb38d920f6 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ - "SyntaxError: The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements (1:15)" + "SyntaxError: The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json index 78cb69bb8dea..62cb0339d903 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:12)" + "SyntaxError: Cannot overwrite reserved type string. (1:12)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_error_with_jsx/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_error_with_jsx/options.json index c6b625d25a5c..f29d6f797271 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_error_with_jsx/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_error_with_jsx/options.json @@ -1,4 +1,8 @@ { - "plugins": ["flow", "jsx"], - "throws": "Unterminated JSX contents (1:3)" -} + "sourceType": "module", + "plugins": [ + "flow", + "jsx" + ], + "throws": "Unterminated JSX contents. (1:3)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_error_without_jsx/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_error_without_jsx/options.json index cf72e7dfcad7..ba4ee9f1ee50 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_error_without_jsx/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_error_without_jsx/options.json @@ -1,4 +1,7 @@ { - "plugins": ["flow"], - "throws": "Expected an arrow function after this type parameter declaration (1:0)" -} + "sourceType": "module", + "plugins": [ + "flow" + ], + "throws": "Expected an arrow function after this type parameter declaration. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json index 3c1f8ac956fb..39aa8410a22f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: Unexpected keyword 'delete' (1:14)" + "SyntaxError: Unexpected keyword 'delete'. (1:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json index ebd1f2cd376b..ef23432c669b 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ - "SyntaxError: `_` is only allowed as a type argument to call or new (2:16)" + "SyntaxError: `_` is only allowed as a type argument to call or new. (2:16)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "VariableDeclaration", "start":8,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "declarations": [ { "type": "VariableDeclarator", @@ -62,14 +69,7 @@ } } ], - "kind": "var", - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + "kind": "var" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json index ab4466e15218..2f5e884ae124 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ - "SyntaxError: Cannot overwrite reserved type _ (2:5)" + "SyntaxError: Cannot overwrite reserved type _. (2:5)" ], "program": { "type": "Program", @@ -13,6 +13,13 @@ { "type": "TypeAlias", "start":8,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"_"}, @@ -22,14 +29,7 @@ "right": { "type": "NumberTypeAnnotation", "start":17,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json index a0f7c08fcadc..c12e93560d7f 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "errors": [ - "SyntaxError: Unexpected reserved type _ (2:13)", - "SyntaxError: `_` is only allowed as a type argument to call or new (2:19)" + "SyntaxError: Unexpected reserved type _. (2:13)", + "SyntaxError: `_` is only allowed as a type argument to call or new. (2:19)" ], "program": { "type": "Program", @@ -14,6 +14,13 @@ { "type": "TypeAlias", "start":8,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} + } + ], "id": { "type": "Identifier", "start":13,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":12},"identifierName":"Generic"}, @@ -40,14 +47,7 @@ "start":26,"end":27,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"_"}, "name": "_" } - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": "@flow", - "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json index 84a61889a5fc..a903d2f7910b 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:10)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json index c56ca182c299..a3702166bc5f 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:13)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json index 5eb20e808dfa..5e2301a4433c 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:15)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:15)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json index 60c8b992e95f..b4b1f013c446 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:5)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:5)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "SequenceExpression", "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "expressions": [ { "type": "Identifier", @@ -45,11 +49,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json index 6fef5e583406..515994b7b123 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:2)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json index 2dfd651b7a6b..101e6aae6b1c 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:3)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:3)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ArrayExpression", "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "elements": [ { "type": "TypeCastExpression", @@ -34,11 +38,7 @@ } } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json index 98c3f55f974e..35a0d73ad0d3 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:7)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:7)" ], "program": { "type": "Program", @@ -16,6 +16,10 @@ "expression": { "type": "ArrayExpression", "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, + "extra": { + "parenthesized": true, + "parenStart": 0 + }, "elements": [ { "type": "Identifier", @@ -45,11 +49,7 @@ } ] } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json index 06d2a6430d16..d0d78e0fcb01 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:9)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json index 9633347434f8..95997b8e15f3 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ - "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:13)" + "SyntaxError: The type cast expression is expected to be wrapped with parenthesis. (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func-invalid-parenthesized/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func-invalid-parenthesized/options.json index a1bb4174e9e8..fa228e470871 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func-invalid-parenthesized/options.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func-invalid-parenthesized/options.json @@ -1,6 +1,8 @@ { "sourceType": "module", - "plugins": ["flow"], + "plugins": [ + "flow" + ], "createParenthesizedExpressions": true, - "throws": "Expected an arrow function after this type parameter declaration (1:0)" -} + "throws": "Expected an arrow function after this type parameter declaration. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func-invalid/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func-invalid/options.json index ad808bcb8ba6..ba4ee9f1ee50 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func-invalid/options.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/generic-arrow-func-invalid/options.json @@ -1,5 +1,7 @@ { "sourceType": "module", - "plugins": ["flow"], - "throws": "Expected an arrow function after this type parameter declaration (1:0)" -} + "plugins": [ + "flow" + ], + "throws": "Expected an arrow function after this type parameter declaration. (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/attribute-arbitrary-expression/options.json b/packages/babel-parser/test/fixtures/jsx/errors/attribute-arbitrary-expression/options.json index 19a214000ffc..7499fff99bee 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/attribute-arbitrary-expression/options.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/attribute-arbitrary-expression/options.json @@ -1,3 +1,7 @@ { - "throws": "JSX value should be either an expression or a quoted JSX text (1:9)" -} + "plugins": [ + "jsx", + "flow" + ], + "throws": "JSX value should be either an expression or a quoted JSX text. (1:9)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json index 404503d8655f..852e9b82b988 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: JSX attributes must only be assigned a non-empty expression (1:9)" + "SyntaxError: JSX attributes must only be assigned a non-empty expression. (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/jsx/errors/unclosed-tag/options.json b/packages/babel-parser/test/fixtures/jsx/errors/unclosed-tag/options.json index 4b723200dfbc..11ed53a9d0ce 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/unclosed-tag/options.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/unclosed-tag/options.json @@ -1,3 +1,7 @@ { - "throws": "Unterminated JSX contents (1:5)" -} + "plugins": [ + "jsx", + "flow" + ], + "throws": "Unterminated JSX contents. (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/unterminated-string/options.json b/packages/babel-parser/test/fixtures/jsx/errors/unterminated-string/options.json index 78911055bcf5..4db510afc344 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/unterminated-string/options.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/unterminated-string/options.json @@ -1,3 +1,7 @@ { - "throws": "Unterminated string constant (1:9)" -} + "plugins": [ + "jsx", + "flow" + ], + "throws": "Unterminated string constant. (1:9)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json index d70e7d0fc17c..34879791df24 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Expected corresponding JSX closing tag for <> (1:2)" + "SyntaxError: Expected corresponding JSX closing tag for <>. (1:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json index 54ddb9bae05b..91bc9cb8cab5 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "errors": [ - "SyntaxError: Expected corresponding JSX closing tag for (1:5)" + "SyntaxError: Expected corresponding JSX closing tag for . (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json index a5d5ef8d53f4..fddeb885845a 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Expected corresponding JSX closing tag for (1:11)" + "SyntaxError: Expected corresponding JSX closing tag for . (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/placeholders/variable/let-context-3/output.json b/packages/babel-parser/test/fixtures/placeholders/variable/let-context-3/output.json index d4fef28640ba..0caca0ef9fab 100644 --- a/packages/babel-parser/test/fixtures/placeholders/variable/let-context-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/variable/let-context-3/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}}, "errors": [ - "SyntaxError: Missing semicolon (1:13)" + "SyntaxError: Missing semicolon. (1:13)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json index f8e8595b61c9..f1ae2d68f273 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "errors": [ - "SyntaxError: Escape sequence in keyword asserts (1:49)" + "SyntaxError: Escape sequence in keyword asserts. (1:49)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/assign/parenthesized-object-assign/output.json b/packages/babel-parser/test/fixtures/typescript/assign/parenthesized-object-assign/output.json index 69e8d31055c7..97fb8c0a4178 100644 --- a/packages/babel-parser/test/fixtures/typescript/assign/parenthesized-object-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assign/parenthesized-object-assign/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8}}, "errors": [ - "SyntaxError: Invalid parenthesized assignment pattern (1:0)" + "SyntaxError: Invalid parenthesized assignment pattern. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/output.json index 6497654889f0..ae1af02f4f71 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-assert-and-assign/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", - "SyntaxError: Invalid left-hand side in assignment expression (2:6)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)", + "SyntaxError: Invalid left-hand side in assignment expression. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-type-assertion-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-type-assertion-and-assign/output.json index 78450d163a7a..0251d106c95b 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-type-assertion-and-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/unparenthesized-type-assertion-and-assign/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)" + "SyntaxError: Invalid left-hand side in assignment expression. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json index ffa963c815c3..7d0ed1197220 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Class methods cannot have the 'declare' modifier (2:2)" + "SyntaxError: Class methods cannot have the 'declare' modifier. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-new-line-abstract/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-new-line-abstract/output.json index 04a02c759f73..e5c58d18f8ce 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-new-line-abstract/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-new-line-abstract/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + "SyntaxError: Missing semicolon. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json index 945b98a43008..17e2af85eb86 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Duplicate modifier: 'declare' (2:17)" + "SyntaxError: Duplicate modifier: 'declare'. (2:17)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json index d902e7d6b78f..e8183c3919ae 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Duplicate modifier: 'declare' (2:24)" + "SyntaxError: Duplicate modifier: 'declare'. (2:24)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json index 85529184ac19..3e9c4477d0a9 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Class methods cannot have the 'readonly' modifier (2:4)" + "SyntaxError: Class methods cannot have the 'readonly' modifier. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json index 45e7aad7b7d6..e9b9e33e09d6 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-index-signatures/output.json @@ -2,11 +2,11 @@ "type": "File", "start":0,"end":178,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ - "SyntaxError: Index signatures cannot have the 'abstract' modifier (2:2)", - "SyntaxError: Index signatures cannot have the 'declare' modifier (3:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('private') (4:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('public') (5:2)", - "SyntaxError: Index signatures cannot have an accessibility modifier ('protected') (6:2)" + "SyntaxError: Index signatures cannot have the 'abstract' modifier. (2:2)", + "SyntaxError: Index signatures cannot have the 'declare' modifier. (3:2)", + "SyntaxError: Index signatures cannot have an accessibility modifier ('private'). (4:2)", + "SyntaxError: Index signatures cannot have an accessibility modifier ('public'). (5:2)", + "SyntaxError: Index signatures cannot have an accessibility modifier ('protected'). (6:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json index 5e3dd363ef99..655d74e15f97 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Private elements cannot have an accessibility modifier ('private') (2:2)" + "SyntaxError: Private elements cannot have an accessibility modifier ('private'). (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json index 8a49738f30e3..8a42104f41c9 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Private elements cannot have an accessibility modifier ('protected') (2:2)" + "SyntaxError: Private elements cannot have an accessibility modifier ('protected'). (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json index 0bf961bf5037..2dcd12502239 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: Private elements cannot have an accessibility modifier ('public') (2:2)" + "SyntaxError: Private elements cannot have an accessibility modifier ('public'). (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/import/export-import-type/output.json b/packages/babel-parser/test/fixtures/typescript/import/export-import-type/output.json index e2dc9b3429bb..7a1e697a78ff 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/export-import-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/export-import-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ - "SyntaxError: An import alias can not use 'import type' (1:23)" + "SyntaxError: An import alias can not use 'import type'. (1:23)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/import/type-equals/output.json b/packages/babel-parser/test/fixtures/typescript/import/type-equals/output.json index aa41cc16a54e..296d3c9a9131 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/type-equals/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/type-equals/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ - "SyntaxError: An import alias can not use 'import type' (1:16)", - "SyntaxError: An import alias can not use 'import type' (2:16)" + "SyntaxError: An import alias can not use 'import type'. (1:16)", + "SyntaxError: An import alias can not use 'import type'. (2:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/interface/declare-new-line/output.json index 5158d520298c..8c0e2f04650b 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/declare-new-line/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + "SyntaxError: Missing semicolon. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/invalid-abstract-interface/output.json b/packages/babel-parser/test/fixtures/typescript/interface/invalid-abstract-interface/output.json index 9e1d3aec785f..6321f1d4d666 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/invalid-abstract-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/invalid-abstract-interface/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "errors": [ - "SyntaxError: Missing semicolon (1:8)", - "SyntaxError: Missing semicolon (2:3)" + "SyntaxError: Missing semicolon. (1:8)", + "SyntaxError: Missing semicolon. (2:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/interface/new-line-error/output.json b/packages/babel-parser/test/fixtures/typescript/interface/new-line-error/output.json index f379134be8af..5d40fecea3b1 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/new-line-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/new-line-error/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "errors": [ - "SyntaxError: Missing semicolon (2:1)" + "SyntaxError: Missing semicolon. (2:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-declare-new-line/output.json index 1ba41584fb21..eba3117302c9 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-declare-new-line/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":2}}, "errors": [ - "SyntaxError: Missing semicolon (6:7)" + "SyntaxError: Missing semicolon. (6:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line-error/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line-error/output.json index 5c7e547bf607..a9261e1f6a78 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line-error/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "errors": [ - "SyntaxError: Missing semicolon (2:3)" + "SyntaxError: Missing semicolon. (2:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-declare-new-line/output.json index 738b0bfc7701..03e74714f1de 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-declare-new-line/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":2}}, "errors": [ - "SyntaxError: Missing semicolon (6:7)" + "SyntaxError: Missing semicolon. (6:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line-error/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line-error/output.json index 33ffb7be102a..d238c7782e5f 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line-error/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "errors": [ - "SyntaxError: Missing semicolon (2:3)" + "SyntaxError: Missing semicolon. (2:3)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/output.json index a99125a44c6f..545dff304a1c 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules (2:14)" + "SyntaxError: 'await' is only allowed within async functions and at the top levels of modules. (2:14)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json index b3b42d74d8e3..050f5b449bc0 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:6)" + "SyntaxError: Identifier 'A' has already been declared. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json index a1cc8e60fcc4..50df16c438b5 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json index caddda18d801..358e205df60a 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json index baf3fa807a05..7d2d9187deca 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "errors": [ - "SyntaxError: Identifier 'X' has already been declared (2:5)" + "SyntaxError: Identifier 'X' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json index 6a310f817190..337f567e0864 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Identifier 'X' has already been declared (2:6)" + "SyntaxError: Identifier 'X' has already been declared. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json index 0660bfd16649..8caf5094606b 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "errors": [ - "SyntaxError: Identifier 'X' has already been declared (2:11)" + "SyntaxError: Identifier 'X' has already been declared. (2:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json index d254111a610a..1064f42ab336 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "errors": [ - "SyntaxError: Identifier 'Foo' has already been declared (2:9)" + "SyntaxError: Identifier 'Foo' has already been declared. (2:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json index 62bf37e86c3f..ade778b2ecbb 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Identifier 'X' has already been declared (2:10)" + "SyntaxError: Identifier 'X' has already been declared. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json index cf541c4247d4..d28c8823491f 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "errors": [ - "SyntaxError: Identifier 'Foo' has already been declared (2:4)" + "SyntaxError: Identifier 'Foo' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json index 7b8d2e208cc2..f03fee5e57a2 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ - "SyntaxError: Identifier 'X' has already been declared (2:5)" + "SyntaxError: Identifier 'X' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json index cf541c4247d4..d28c8823491f 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "errors": [ - "SyntaxError: Identifier 'Foo' has already been declared (2:4)" + "SyntaxError: Identifier 'Foo' has already been declared. (2:4)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json index 2613394dc026..1f2bd5ae890e 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "errors": [ - "SyntaxError: Identifier 'Foo' has already been declared (2:5)" + "SyntaxError: Identifier 'Foo' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json index 27a720cd09d3..f5dbf9b04881 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "errors": [ - "SyntaxError: Identifier 'X' has already been declared (2:5)" + "SyntaxError: Identifier 'X' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json index cb3f09c087df..1287f55c35dc 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "errors": [ - "SyntaxError: Identifier 'Foo' has already been declared (2:5)" + "SyntaxError: Identifier 'Foo' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json index 7738c56de634..bf421c4979b8 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:6)" + "SyntaxError: Identifier 'A' has already been declared. (2:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json index 775af3064133..67621591051e 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json index 2e27314bf592..d491df97f2b9 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:10)" + "SyntaxError: Identifier 'A' has already been declared. (2:10)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json index 48fee42b09ad..82a5b2a87831 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ - "SyntaxError: Identifier 'A' has already been declared (2:5)" + "SyntaxError: Identifier 'A' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json index cb3f09c087df..1287f55c35dc 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "errors": [ - "SyntaxError: Identifier 'Foo' has already been declared (2:5)" + "SyntaxError: Identifier 'Foo' has already been declared. (2:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/type-alias/declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/type-alias/declare-new-line/output.json index 89ebf2f1f64a..54ec72264bb5 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-alias/declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-alias/declare-new-line/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ - "SyntaxError: Missing semicolon (1:7)" + "SyntaxError: Missing semicolon. (1:7)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-errors/output.json b/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-errors/output.json index 0a28271d346e..8c5d3e842721 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-errors/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic-errors/output.json @@ -2,9 +2,9 @@ "type": "File", "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":19}}, "errors": [ - "SyntaxError: Argument in a type import must be a string literal (1:16)", - "SyntaxError: Argument in a type import must be a string literal (2:16)", - "SyntaxError: Argument in a type import must be a string literal (3:16)" + "SyntaxError: Argument in a type import must be a string literal. (1:16)", + "SyntaxError: Argument in a type import must be a string literal. (2:16)", + "SyntaxError: Argument in a type import must be a string literal. (3:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/typescript/types/intrinsic-keyword-error/output.json b/packages/babel-parser/test/fixtures/typescript/types/intrinsic-keyword-error/output.json index ffd6e5a2a929..aeebec90dbdc 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/intrinsic-keyword-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/intrinsic-keyword-error/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ - "SyntaxError: Missing semicolon (1:20)" + "SyntaxError: Missing semicolon. (1:20)" ], "program": { "type": "Program", diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-illegal-non-constructor-call/options.json b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-illegal-non-constructor-call/options.json index 84442f571d97..6379176c7160 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-illegal-non-constructor-call/options.json +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-illegal-non-constructor-call/options.json @@ -1,3 +1,3 @@ { - "throws": "super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?" + "throws": "`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?" } diff --git a/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/options.json b/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/options.json index e79b0ad1b184..20761c305c91 100644 --- a/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/options.json +++ b/packages/babel-preset-env/test/fixtures/top-level-await/unsupported/options.json @@ -6,5 +6,5 @@ "supportsTopLevelAwait": false }, "presets": ["env"], - "throws": "Unexpected reserved word 'await' (1:0)" + "throws": "Unexpected reserved word 'await'. (1:0)" } diff --git a/packages/babel-preset-typescript/test/fixtures/flow-compat/js-invalid/options.json b/packages/babel-preset-typescript/test/fixtures/flow-compat/js-invalid/options.json index fe0ad873dac4..285bd0c11662 100644 --- a/packages/babel-preset-typescript/test/fixtures/flow-compat/js-invalid/options.json +++ b/packages/babel-preset-typescript/test/fixtures/flow-compat/js-invalid/options.json @@ -1,4 +1,4 @@ { "presets": [["flow", {}, "before"], "typescript", ["flow", {}, "after"]], - "throws": "Unexpected reserved word 'enum' (1:0)" + "throws": "Unexpected reserved word 'enum'. (1:0)" } From 76473e10d122756af6da3ce87d97a7fab3a2caab Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Tue, 13 Apr 2021 06:10:21 +0900 Subject: [PATCH 06/12] Support TS 4.3 `get`/`set` type members (#13089) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nicolò Ribaudo --- .../src/generators/typescript.ts | 5 + .../typescript/interface-method-kind/input.js | 4 + .../interface-method-kind/output.js | 4 + packages/babel-parser/src/parser/statement.js | 8 ++ .../babel-parser/src/plugins/flow/index.js | 5 - .../src/plugins/typescript/index.js | 89 +++++++++++++++-- packages/babel-parser/src/types.js | 1 + .../declare/pattern-parameters/output.json | 9 +- .../interface/get-set-ambiguous/input.ts | 6 ++ .../interface/get-set-ambiguous/output.json | 86 +++++++++++++++++ .../input.ts | 3 + .../output.json | 58 +++++++++++ .../get-set-invalid-parameters/input.ts | 4 + .../get-set-invalid-parameters/output.json | 70 ++++++++++++++ .../get-set-invalid-reset-parameter/input.ts | 3 + .../output.json | 53 +++++++++++ .../get-set-invalid-return-types/input.ts | 3 + .../get-set-invalid-return-types/output.json | 57 +++++++++++ .../get-set-invalid-this-parameters/input.ts | 4 + .../output.json | 95 +++++++++++++++++++ .../interface/get-set-methods/input.ts | 4 + .../interface/get-set-methods/output.json | 68 +++++++++++++ .../interface/get-set-properties/input.ts | 4 + .../interface/get-set-properties/output.json | 66 +++++++++++++ .../get-set-type-parameters/input.ts | 4 + .../get-set-type-parameters/output.json | 92 ++++++++++++++++++ .../typescript/interface/get-set/input.ts | 4 + .../typescript/interface/get-set/output.json | 66 +++++++++++++ .../invalid-modifiers-method/output.json | 21 ++-- .../interface/method-computed/output.json | 14 +-- .../interface/method-generic/output.json | 3 +- .../interface/method-optional/output.json | 3 +- .../interface/method-plain/output.json | 6 +- .../interface/pattern-parameters/output.json | 9 +- .../reserved-method-name/output.json | 3 +- .../types/pattern-parameters/output.json | 9 +- .../types/type-literal-get-set/input.ts | 4 + .../types/type-literal-get-set/output.json | 78 +++++++++++++++ .../src/ast-types/generated/index.ts | 1 + .../babel-types/src/definitions/typescript.ts | 3 + scripts/parser-tests/typescript/allowlist.txt | 2 + 41 files changed, 990 insertions(+), 41 deletions(-) create mode 100644 packages/babel-generator/test/fixtures/typescript/interface-method-kind/input.js create mode 100644 packages/babel-generator/test/fixtures/typescript/interface-method-kind/output.js create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-ambiguous/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-ambiguous/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-optional-parameter/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-optional-parameter/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-parameters/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-parameters/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-reset-parameter/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-reset-parameter/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-this-parameters/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-this-parameters/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-methods/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-methods/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-properties/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-properties/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-type-parameters/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set-type-parameters/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/interface/get-set/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/output.json diff --git a/packages/babel-generator/src/generators/typescript.ts b/packages/babel-generator/src/generators/typescript.ts index af70e81923d5..742cefa1dfaa 100644 --- a/packages/babel-generator/src/generators/typescript.ts +++ b/packages/babel-generator/src/generators/typescript.ts @@ -127,6 +127,11 @@ export function tsPrintPropertyOrMethodName(this: Printer, node) { } export function TSMethodSignature(this: Printer, node: t.TSMethodSignature) { + const { kind } = node; + if (kind === "set" || kind === "get") { + this.word(kind); + this.space(); + } this.tsPrintPropertyOrMethodName(node); this.tsPrintSignatureDeclarationBase(node); this.token(";"); diff --git a/packages/babel-generator/test/fixtures/typescript/interface-method-kind/input.js b/packages/babel-generator/test/fixtures/typescript/interface-method-kind/input.js new file mode 100644 index 000000000000..3e2f9d8af07b --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/interface-method-kind/input.js @@ -0,0 +1,4 @@ +interface Foo { + get foo(); + set bar(v); +} diff --git a/packages/babel-generator/test/fixtures/typescript/interface-method-kind/output.js b/packages/babel-generator/test/fixtures/typescript/interface-method-kind/output.js new file mode 100644 index 000000000000..2ac4a6d0bf01 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/interface-method-kind/output.js @@ -0,0 +1,4 @@ +interface Foo { + get foo(); + set bar(v); +} \ No newline at end of file diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 52fe66190f68..f8c05d912709 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -2384,4 +2384,12 @@ export default class StatementParser extends ExpressionParser { this.checkLVal(specifier.local, "import specifier", BIND_LEXICAL); node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); } + + // This is used in flow and typescript plugin + // Determine whether a parameter is a this param + isThisParam( + param: N.Pattern | N.Identifier | N.TSParameterProperty, + ): boolean { + return param.type === "Identifier" && param.name === "this"; + } } diff --git a/packages/babel-parser/src/plugins/flow/index.js b/packages/babel-parser/src/plugins/flow/index.js index 572613068c74..256590452db2 100644 --- a/packages/babel-parser/src/plugins/flow/index.js +++ b/packages/babel-parser/src/plugins/flow/index.js @@ -2387,11 +2387,6 @@ export default (superClass: Class): Class => return !this.match(tt.colon) && super.isNonstaticConstructor(method); } - // determine whether a parameter is a this param - isThisParam(param) { - return param.type === "Identifier" && param.name === "this"; - } - // parse type parameters for class methods pushClassMethod( classBody: N.ClassBody, diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 4e684b6da0ab..e910703f3ecc 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -70,12 +70,15 @@ const TSErrors = makeErrorTemplates( { AbstractMethodHasImplementation: "Method '%0' cannot have an implementation because it is marked abstract.", + AccesorCannotDeclareThisParameter: + "'get' and 'set' accessors cannot declare 'this' parameters.", + AccesorCannotHaveTypeParameters: "An accessor cannot have type parameters.", ClassMethodHasDeclare: "Class methods cannot have the 'declare' modifier.", ClassMethodHasReadonly: "Class methods cannot have the 'readonly' modifier.", ConstructorHasTypeParameters: "Type parameters cannot appear on a constructor declaration.", - DeclareAccessor: "'declare' is not allowed in %0ters.", + DeclareAccessor: "'declare' is not allowed in %0ters.", DeclareClassFieldHasInitializer: "Initializers are not allowed in ambient contexts.", DeclareFunctionHasImplementation: @@ -122,6 +125,12 @@ const TSErrors = makeErrorTemplates( "Private elements cannot have an accessibility modifier ('%0').", ReadonlyForMethodSignature: "'readonly' modifier can only appear on a property declaration or index signature.", + SetAccesorCannotHaveOptionalParameter: + "A 'set' accessor cannot have an optional parameter.", + SetAccesorCannotHaveRestParameter: + "A 'set' accessor cannot have rest parameter.", + SetAccesorCannotHaveReturnType: + "A 'set' accessor cannot have a return type annotation.", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: @@ -193,12 +202,7 @@ export default (superClass: Class): Class => return this.match(tt.name); } - tsNextTokenCanFollowModifier() { - // Note: TypeScript's implementation is much more complicated because - // more things are considered modifiers there. - // This implementation only handles modifiers not handled by @babel/parser itself. And "static". - // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method... - this.next(); + tsTokenCanFollowModifier() { return ( (this.match(tt.bracketL) || this.match(tt.braceL) || @@ -210,6 +214,15 @@ export default (superClass: Class): Class => ); } + tsNextTokenCanFollowModifier() { + // Note: TypeScript's implementation is much more complicated because + // more things are considered modifiers there. + // This implementation only handles modifiers not handled by @babel/parser itself. And "static". + // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method... + this.next(); + return this.tsTokenCanFollowModifier(); + } + /** Parses a modifier matching one the given modifier names. */ tsParseModifier(allowedModifiers: T[]): ?T { if (!this.match(tt.name)) { @@ -547,8 +560,8 @@ export default (superClass: Class): Class => } tsParseTypeMemberSemicolon(): void { - if (!this.eat(tt.comma)) { - this.semicolon(); + if (!this.eat(tt.comma) && !this.isLineTerminator()) { + this.expect(tt.semi); } } @@ -602,8 +615,57 @@ export default (superClass: Class): Class => this.raise(node.start, TSErrors.ReadonlyForMethodSignature); } const method: N.TsMethodSignature = nodeAny; + if (method.kind && this.isRelational("<")) { + this.raise(this.state.pos, TSErrors.AccesorCannotHaveTypeParameters); + } this.tsFillSignature(tt.colon, method); this.tsParseTypeMemberSemicolon(); + if (method.kind === "get") { + if (method.parameters.length > 0) { + this.raise(this.state.pos, Errors.BadGetterArity); + if (this.isThisParam(method.parameters[0])) { + this.raise( + this.state.pos, + TSErrors.AccesorCannotDeclareThisParameter, + ); + } + } + } else if (method.kind === "set") { + if (method.parameters.length !== 1) { + this.raise(this.state.pos, Errors.BadSetterArity); + } else { + const firstParameter = method.parameters[0]; + if (this.isThisParam(firstParameter)) { + this.raise( + this.state.pos, + TSErrors.AccesorCannotDeclareThisParameter, + ); + } + if ( + firstParameter.type === "Identifier" && + firstParameter.optional + ) { + this.raise( + this.state.pos, + TSErrors.SetAccesorCannotHaveOptionalParameter, + ); + } + if (firstParameter.type === "RestElement") { + this.raise( + this.state.pos, + TSErrors.SetAccesorCannotHaveRestParameter, + ); + } + } + if (method.typeAnnotation) { + this.raise( + method.typeAnnotation.start, + TSErrors.SetAccesorCannotHaveReturnType, + ); + } + } else { + method.kind = "method"; + } return this.finishNode(method, "TSMethodSignature"); } else { const property: N.TsPropertySignature = nodeAny; @@ -657,6 +719,15 @@ export default (superClass: Class): Class => } this.parsePropertyName(node, /* isPrivateNameAllowed */ false); + if ( + !node.computed && + node.key.type === "Identifier" && + (node.key.name === "get" || node.key.name === "set") && + this.tsTokenCanFollowModifier() + ) { + node.kind = node.key.name; + this.parsePropertyName(node, /* isPrivateNameAllowed */ false); + } return this.tsParsePropertyOrMethodSignature(node, !!node.readonly); } diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index 6bf9b9cb0f78..c0c996389981 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -1208,6 +1208,7 @@ export type TsPropertySignature = TsNamedTypeElementBase & { export type TsMethodSignature = TsSignatureDeclarationBase & TsNamedTypeElementBase & { type: "TSMethodSignature", + kind: "method" | "get" | "set", }; // *Not* a ClassMemberBase: Can't have accessibility, can't be abstract, can't be optional. diff --git a/packages/babel-parser/test/fixtures/typescript/declare/pattern-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/declare/pattern-parameters/output.json index e38f277d47ad..5a0f8fbc624d 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/pattern-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/pattern-parameters/output.json @@ -43,7 +43,8 @@ "type": "TSVoidKeyword", "start":34,"end":38,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16}} } - } + }, + "kind": "method" }, { "type": "TSMethodSignature", @@ -74,7 +75,8 @@ "type": "TSAnyKeyword", "start":56,"end":59,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19}} } - } + }, + "kind": "method" }, { "type": "TSMethodSignature", @@ -126,7 +128,8 @@ "type": "TSVoidKeyword", "start":95,"end":99,"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":38}} } - } + }, + "kind": "method" } ] }, diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-ambiguous/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-ambiguous/input.ts new file mode 100644 index 000000000000..8663a711f90b --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-ambiguous/input.ts @@ -0,0 +1,6 @@ +interface Foo { + get + foo(): string; + set + bar(v); +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-ambiguous/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-ambiguous/output.json new file mode 100644 index 000000000000..be21c57f2c3a --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-ambiguous/output.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":56,"loc":{"start":{"line":1,"column":14},"end":{"line":6,"column":1}}, + "body": [ + { + "type": "TSPropertySignature", + "start":18,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5}}, + "key": { + "type": "Identifier", + "start":18,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"get"}, + "name": "get" + }, + "computed": false + }, + { + "type": "TSMethodSignature", + "start":24,"end":38,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, + "key": { + "type": "Identifier", + "start":24,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"foo"}, + "name": "foo" + }, + "computed": false, + "parameters": [], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":29,"end":37,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":15}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":31,"end":37,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":15}} + } + }, + "kind": "method" + }, + { + "type": "TSPropertySignature", + "start":41,"end":44,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":5}}, + "key": { + "type": "Identifier", + "start":41,"end":44,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":5},"identifierName":"set"}, + "name": "set" + }, + "computed": false + }, + { + "type": "TSMethodSignature", + "start":47,"end":54,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":9}}, + "key": { + "type": "Identifier", + "start":47,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":5},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "parameters": [ + { + "type": "Identifier", + "start":51,"end":52,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":7},"identifierName":"v"}, + "name": "v" + } + ], + "kind": "method" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-optional-parameter/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-optional-parameter/input.ts new file mode 100644 index 000000000000..94dab3cd7318 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-optional-parameter/input.ts @@ -0,0 +1,3 @@ +interface Foo { + set bar(foo?: string); +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-optional-parameter/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-optional-parameter/output.json new file mode 100644 index 000000000000..7ceb61f8f992 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-optional-parameter/output.json @@ -0,0 +1,58 @@ +{ + "type": "File", + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "errors": [ + "SyntaxError: A 'set' accessor cannot have an optional parameter. (3:1)" + ], + "program": { + "type": "Program", + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":42,"loc":{"start":{"line":1,"column":14},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "TSMethodSignature", + "start":18,"end":40,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, + "key": { + "type": "Identifier", + "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "kind": "set", + "parameters": [ + { + "type": "Identifier", + "start":26,"end":38,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":22},"identifierName":"foo"}, + "name": "foo", + "optional": true, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":30,"end":38,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":32,"end":38,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22}} + } + } + } + ] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-parameters/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-parameters/input.ts new file mode 100644 index 000000000000..571a874d30a1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-parameters/input.ts @@ -0,0 +1,4 @@ +interface Foo { + get foo(param): string; + set foo(); +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-parameters/output.json new file mode 100644 index 000000000000..15833b14b38a --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-parameters/output.json @@ -0,0 +1,70 @@ +{ + "type": "File", + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "errors": [ + "SyntaxError: A 'get' accesor must not have any formal parameters. (3:5)", + "SyntaxError: A 'set' accesor must have exactly one formal parameter. (4:1)" + ], + "program": { + "type": "Program", + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":56,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "TSMethodSignature", + "start":18,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":25}}, + "key": { + "type": "Identifier", + "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, + "name": "foo" + }, + "computed": false, + "kind": "get", + "parameters": [ + { + "type": "Identifier", + "start":26,"end":31,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"param"}, + "name": "param" + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":32,"end":40,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":24}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":34,"end":40,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":24}} + } + } + }, + { + "type": "TSMethodSignature", + "start":44,"end":54,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":12}}, + "key": { + "type": "Identifier", + "start":48,"end":51,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"foo"}, + "name": "foo" + }, + "computed": false, + "kind": "set", + "parameters": [] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-reset-parameter/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-reset-parameter/input.ts new file mode 100644 index 000000000000..9acf2deb4869 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-reset-parameter/input.ts @@ -0,0 +1,3 @@ +interface Foo { + set bar(...v); +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-reset-parameter/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-reset-parameter/output.json new file mode 100644 index 000000000000..81831562369b --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-reset-parameter/output.json @@ -0,0 +1,53 @@ +{ + "type": "File", + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "errors": [ + "SyntaxError: A 'set' accessor cannot have rest parameter. (3:1)" + ], + "program": { + "type": "Program", + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "TSMethodSignature", + "start":18,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, + "key": { + "type": "Identifier", + "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "kind": "set", + "parameters": [ + { + "type": "RestElement", + "start":26,"end":30,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14}}, + "argument": { + "type": "Identifier", + "start":29,"end":30,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"v"}, + "name": "v" + } + } + ] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/input.ts new file mode 100644 index 000000000000..ee80bfe1d836 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/input.ts @@ -0,0 +1,3 @@ +interface Foo { + set foo(param): string; +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/output.json new file mode 100644 index 000000000000..3d085079205f --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-return-types/output.json @@ -0,0 +1,57 @@ +{ + "type": "File", + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "errors": [ + "SyntaxError: A 'set' accessor cannot have a return type annotation. (2:16)" + ], + "program": { + "type": "Program", + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":43,"loc":{"start":{"line":1,"column":14},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "TSMethodSignature", + "start":18,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":25}}, + "kind": "set", + "key": { + "type": "Identifier", + "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, + "name": "foo" + }, + "computed": false, + "parameters": [ + { + "type": "Identifier", + "start":26,"end":31,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"param"}, + "name": "param" + } + ], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":32,"end":40,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":24}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":34,"end":40,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":24}} + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-this-parameters/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-this-parameters/input.ts new file mode 100644 index 000000000000..0c35d67abc6d --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-this-parameters/input.ts @@ -0,0 +1,4 @@ +interface Foo { + get bar(this: Foo); + set bar(this: Foo); +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-this-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-this-parameters/output.json new file mode 100644 index 000000000000..53aad5599247 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-invalid-this-parameters/output.json @@ -0,0 +1,95 @@ +{ + "type": "File", + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "errors": [ + "SyntaxError: A 'get' accesor must not have any formal parameters. (3:5)", + "SyntaxError: 'get' and 'set' accessors cannot declare 'this' parameters. (3:5)", + "SyntaxError: 'get' and 'set' accessors cannot declare 'this' parameters. (4:1)" + ], + "program": { + "type": "Program", + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":61,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "TSMethodSignature", + "start":18,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, + "key": { + "type": "Identifier", + "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "kind": "get", + "parameters": [ + { + "type": "Identifier", + "start":26,"end":35,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":19},"identifierName":"this"}, + "name": "this", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":30,"end":35,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":32,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":19}}, + "typeName": { + "type": "Identifier", + "start":32,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":19},"identifierName":"Foo"}, + "name": "Foo" + } + } + } + } + ] + }, + { + "type": "TSMethodSignature", + "start":40,"end":59,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, + "key": { + "type": "Identifier", + "start":44,"end":47,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "kind": "set", + "parameters": [ + { + "type": "Identifier", + "start":48,"end":57,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":19},"identifierName":"this"}, + "name": "this", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":52,"end":57,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":19}}, + "typeAnnotation": { + "type": "TSTypeReference", + "start":54,"end":57,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19}}, + "typeName": { + "type": "Identifier", + "start":54,"end":57,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19},"identifierName":"Foo"}, + "name": "Foo" + } + } + } + } + ] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-methods/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-methods/input.ts new file mode 100644 index 000000000000..d9df5e022250 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-methods/input.ts @@ -0,0 +1,4 @@ +interface Foo { + get(): string; + set(): string; +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-methods/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-methods/output.json new file mode 100644 index 000000000000..e2119a7de9aa --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-methods/output.json @@ -0,0 +1,68 @@ +{ + "type": "File", + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":51,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "TSMethodSignature", + "start":18,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, + "key": { + "type": "Identifier", + "start":18,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"get"}, + "name": "get" + }, + "computed": false, + "parameters": [], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":23,"end":31,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":15}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":25,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} + } + }, + "kind": "method" + }, + { + "type": "TSMethodSignature", + "start":35,"end":49,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, + "key": { + "type": "Identifier", + "start":35,"end":38,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"set"}, + "name": "set" + }, + "computed": false, + "parameters": [], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":40,"end":48,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":15}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":42,"end":48,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":15}} + } + }, + "kind": "method" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-properties/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-properties/input.ts new file mode 100644 index 000000000000..135b4db01abd --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-properties/input.ts @@ -0,0 +1,4 @@ +interface Foo { + get foo: string; + set bar: string; +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-properties/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-properties/output.json new file mode 100644 index 000000000000..6f286bc4dfe2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-properties/output.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":55,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "TSPropertySignature", + "start":18,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, + "key": { + "type": "Identifier", + "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, + "name": "foo" + }, + "computed": false, + "kind": "get", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":25,"end":33,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":17}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":27,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}} + } + } + }, + { + "type": "TSPropertySignature", + "start":37,"end":53,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":18}}, + "key": { + "type": "Identifier", + "start":41,"end":44,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "kind": "set", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":44,"end":52,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":17}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":46,"end":52,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17}} + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-type-parameters/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set-type-parameters/input.ts new file mode 100644 index 000000000000..085b06d811bf --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-type-parameters/input.ts @@ -0,0 +1,4 @@ +interface Foo { + get foo(): string; + set bar(v); +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set-type-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set-type-parameters/output.json new file mode 100644 index 000000000000..0548c7796bf0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set-type-parameters/output.json @@ -0,0 +1,92 @@ +{ + "type": "File", + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "errors": [ + "SyntaxError: An accessor cannot have type parameters. (2:10)", + "SyntaxError: An accessor cannot have type parameters. (3:10)" + ], + "program": { + "type": "Program", + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":58,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "TSMethodSignature", + "start":18,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, + "key": { + "type": "Identifier", + "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, + "name": "foo" + }, + "computed": false, + "kind": "get", + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":25,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12}}, + "params": [ + { + "type": "TSTypeParameter", + "start":26,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, + "name": "T" + } + ] + }, + "parameters": [], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":30,"end":38,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":32,"end":38,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22}} + } + } + }, + { + "type": "TSMethodSignature", + "start":42,"end":56,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, + "key": { + "type": "Identifier", + "start":46,"end":49,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "kind": "set", + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start":49,"end":52,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":12}}, + "params": [ + { + "type": "TSTypeParameter", + "start":50,"end":51,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}}, + "name": "T" + } + ] + }, + "parameters": [ + { + "type": "Identifier", + "start":53,"end":54,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":14},"identifierName":"v"}, + "name": "v" + } + ] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set/input.ts b/packages/babel-parser/test/fixtures/typescript/interface/get-set/input.ts new file mode 100644 index 000000000000..1d700d78aed8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set/input.ts @@ -0,0 +1,4 @@ +interface Foo { + get foo(): string; + set bar(v); +} diff --git a/packages/babel-parser/test/fixtures/typescript/interface/get-set/output.json b/packages/babel-parser/test/fixtures/typescript/interface/get-set/output.json new file mode 100644 index 000000000000..fd035cd7cd87 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/interface/get-set/output.json @@ -0,0 +1,66 @@ +{ + "type": "File", + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, + "name": "Foo" + }, + "body": { + "type": "TSInterfaceBody", + "start":14,"end":52,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "TSMethodSignature", + "start":18,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, + "kind": "get", + "key": { + "type": "Identifier", + "start":22,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, + "name": "foo" + }, + "computed": false, + "parameters": [], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":27,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":19}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":29,"end":35,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19}} + } + } + }, + { + "type": "TSMethodSignature", + "start":39,"end":50,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, + "kind": "set", + "key": { + "type": "Identifier", + "start":43,"end":46,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "parameters": [ + { + "type": "Identifier", + "start":47,"end":48,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"v"}, + "name": "v" + } + ] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-method/output.json b/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-method/output.json index 080f46b132ef..ac8626f2cc4e 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-method/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/invalid-modifiers-method/output.json @@ -38,7 +38,8 @@ "name": "a" }, "computed": false, - "parameters": [] + "parameters": [], + "kind": "method" }, { "type": "TSMethodSignature", @@ -50,7 +51,8 @@ "name": "b" }, "computed": false, - "parameters": [] + "parameters": [], + "kind": "method" }, { "type": "TSMethodSignature", @@ -62,7 +64,8 @@ "name": "c" }, "computed": false, - "parameters": [] + "parameters": [], + "kind": "method" }, { "type": "TSMethodSignature", @@ -74,7 +77,8 @@ "name": "d" }, "computed": false, - "parameters": [] + "parameters": [], + "kind": "method" }, { "type": "TSMethodSignature", @@ -86,7 +90,8 @@ "name": "e" }, "computed": false, - "parameters": [] + "parameters": [], + "kind": "method" }, { "type": "TSMethodSignature", @@ -98,7 +103,8 @@ "name": "f" }, "computed": false, - "parameters": [] + "parameters": [], + "kind": "method" }, { "type": "TSMethodSignature", @@ -110,7 +116,8 @@ "name": "g" }, "computed": false, - "parameters": [] + "parameters": [], + "kind": "method" } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/method-computed/output.json b/packages/babel-parser/test/fixtures/typescript/interface/method-computed/output.json index 0546e0e21df5..112c4b21bedc 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/method-computed/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/method-computed/output.json @@ -31,12 +31,12 @@ "start":19,"end":25,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":26,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "parameters": [], "typeAnnotation": { @@ -46,7 +46,8 @@ "type": "TSVoidKeyword", "start":39,"end":43,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":29}} } - } + }, + "kind": "method" }, { "type": "TSMethodSignature", @@ -60,12 +61,12 @@ "start":50,"end":56,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, + "computed": false, "property": { "type": "Identifier", "start":57,"end":65,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" - }, - "computed": false + } }, "optional": true, "parameters": [], @@ -76,7 +77,8 @@ "type": "TSNumberKeyword", "start":71,"end":77,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":32}} } - } + }, + "kind": "method" } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/method-generic/output.json b/packages/babel-parser/test/fixtures/typescript/interface/method-generic/output.json index dcd0be5cd357..36810e05164b 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/method-generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/method-generic/output.json @@ -80,7 +80,8 @@ "name": "T" } } - } + }, + "kind": "method" } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/method-optional/output.json b/packages/babel-parser/test/fixtures/typescript/interface/method-optional/output.json index dfaf36169aef..353478b4def8 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/method-optional/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/method-optional/output.json @@ -37,7 +37,8 @@ "type": "TSVoidKeyword", "start":24,"end":28,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14}} } - } + }, + "kind": "method" } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/method-plain/output.json b/packages/babel-parser/test/fixtures/typescript/interface/method-plain/output.json index 48f549db12a4..3db978d83f5c 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/method-plain/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/method-plain/output.json @@ -28,7 +28,8 @@ "name": "m" }, "computed": false, - "parameters": [] + "parameters": [], + "kind": "method" }, { "type": "TSMethodSignature", @@ -83,7 +84,8 @@ "type": "TSVoidKeyword", "start":58,"end":62,"loc":{"start":{"line":3,"column":35},"end":{"line":3,"column":39}} } - } + }, + "kind": "method" } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/pattern-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/interface/pattern-parameters/output.json index 9924e1f55778..4664dc3b8951 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/pattern-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/pattern-parameters/output.json @@ -43,7 +43,8 @@ "type": "TSVoidKeyword", "start":26,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16}} } - } + }, + "kind": "method" }, { "type": "TSMethodSignature", @@ -74,7 +75,8 @@ "type": "TSAnyKeyword", "start":48,"end":51,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19}} } - } + }, + "kind": "method" }, { "type": "TSMethodSignature", @@ -126,7 +128,8 @@ "type": "TSVoidKeyword", "start":87,"end":91,"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":38}} } - } + }, + "kind": "method" } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/reserved-method-name/output.json b/packages/babel-parser/test/fixtures/typescript/interface/reserved-method-name/output.json index 59bb78a048ef..c32fcfd2edfb 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/reserved-method-name/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/reserved-method-name/output.json @@ -36,7 +36,8 @@ "type": "TSVoidKeyword", "start":27,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":17}} } - } + }, + "kind": "method" } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/pattern-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/types/pattern-parameters/output.json index f9b74326a9a0..ad11ca49f7e6 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/pattern-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/pattern-parameters/output.json @@ -43,7 +43,8 @@ "type": "TSVoidKeyword", "start":23,"end":27,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16}} } - } + }, + "kind": "method" }, { "type": "TSMethodSignature", @@ -74,7 +75,8 @@ "type": "TSAnyKeyword", "start":45,"end":48,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19}} } - } + }, + "kind": "method" }, { "type": "TSMethodSignature", @@ -126,7 +128,8 @@ "type": "TSVoidKeyword", "start":84,"end":88,"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":38}} } - } + }, + "kind": "method" } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/input.ts b/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/input.ts new file mode 100644 index 000000000000..a3a21e03ca1e --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/input.ts @@ -0,0 +1,4 @@ +var obj: { + get foo(): string; + set bar(v); +}; diff --git a/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/output.json b/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/output.json new file mode 100644 index 000000000000..1709b69d53a0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/type-literal-get-set/output.json @@ -0,0 +1,78 @@ +{ + "type": "File", + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, + "program": { + "type": "Program", + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, + "declarations": [ + { + "type": "VariableDeclarator", + "start":4,"end":47,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":4,"end":47,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":1},"identifierName":"obj"}, + "name": "obj", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":7,"end":47,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, + "typeAnnotation": { + "type": "TSTypeLiteral", + "start":9,"end":47,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, + "members": [ + { + "type": "TSMethodSignature", + "start":13,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, + "kind": "get", + "key": { + "type": "Identifier", + "start":17,"end":20,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, + "name": "foo" + }, + "computed": false, + "parameters": [], + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":22,"end":30,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":19}}, + "typeAnnotation": { + "type": "TSStringKeyword", + "start":24,"end":30,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19}} + } + } + }, + { + "type": "TSMethodSignature", + "start":34,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, + "kind": "set", + "key": { + "type": "Identifier", + "start":38,"end":41,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"bar"}, + "name": "bar" + }, + "computed": false, + "parameters": [ + { + "type": "Identifier", + "start":42,"end":43,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"v"}, + "name": "v" + } + ] + } + ] + } + } + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-types/src/ast-types/generated/index.ts b/packages/babel-types/src/ast-types/generated/index.ts index da47784f7529..a5f105c87cda 100755 --- a/packages/babel-types/src/ast-types/generated/index.ts +++ b/packages/babel-types/src/ast-types/generated/index.ts @@ -1712,6 +1712,7 @@ export interface TSMethodSignature extends BaseNode { parameters: Array; typeAnnotation?: TSTypeAnnotation | null; computed?: boolean | null; + kind: "method" | "get" | "set"; optional?: boolean | null; } diff --git a/packages/babel-types/src/definitions/typescript.ts b/packages/babel-types/src/definitions/typescript.ts index c805c0b751d0..5d2f7d764b91 100644 --- a/packages/babel-types/src/definitions/typescript.ts +++ b/packages/babel-types/src/definitions/typescript.ts @@ -118,6 +118,9 @@ defineType("TSMethodSignature", { fields: { ...signatureDeclarationCommon, ...namedTypeElementCommon, + kind: { + validate: assertOneOf("method", "get", "set"), + }, }, }); diff --git a/scripts/parser-tests/typescript/allowlist.txt b/scripts/parser-tests/typescript/allowlist.txt index 5ea3208fa25b..857715df1055 100644 --- a/scripts/parser-tests/typescript/allowlist.txt +++ b/scripts/parser-tests/typescript/allowlist.txt @@ -138,6 +138,8 @@ deleteOperator1.ts deleteOperatorInStrictMode.ts dependencyViaImportAlias.ts destructuredDeclarationEmit.ts +divergentAccessors1.ts +divergentAccessorsTypes1.ts doubleUnderscoreExportStarConflict.ts duplicateIdentifierBindingElementInParameterDeclaration1.ts duplicateIdentifierBindingElementInParameterDeclaration2.ts From 94ca52d8a75b82e69e65b76e8b1bacaaaedfffd3 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Tue, 13 Apr 2021 09:08:26 +0900 Subject: [PATCH 07/12] babel-parser: Deep freeze for `makeErrorTemplates` (#13142) --- packages/babel-parser/src/parser/error.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-parser/src/parser/error.js b/packages/babel-parser/src/parser/error.js index 7c805001e67a..aa68465b618f 100644 --- a/packages/babel-parser/src/parser/error.js +++ b/packages/babel-parser/src/parser/error.js @@ -36,11 +36,11 @@ export function makeErrorTemplates( ): ErrorTemplates { const templates: ErrorTemplates = {}; Object.keys(messages).forEach(reasonCode => { - templates[reasonCode] = { + templates[reasonCode] = Object.freeze({ code, reasonCode, template: messages[reasonCode], - }; + }); }); return Object.freeze(templates); } From 703776e4ec45b4c61c89c5851e1292fd26344436 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Fri, 16 Apr 2021 11:18:24 +0900 Subject: [PATCH 08/12] Use this.isThisParam in typescript parser (#13163) --- packages/babel-parser/src/plugins/typescript/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index e910703f3ecc..d888f8b1ceb3 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -3067,10 +3067,7 @@ export default (superClass: Class): Class => const baseCount = super.getGetterSetterExpectedParamCount(method); const params = this.getObjectOrClassMethodParams(method); const firstParam = params[0]; - const hasContextParam = - firstParam && - firstParam.type === "Identifier" && - firstParam.name === "this"; + const hasContextParam = firstParam && this.isThisParam(firstParam); return hasContextParam ? baseCount + 1 : baseCount; } From 00a49097b8ff25261d9ebee5dab273f7c3dc0b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 20 Apr 2021 13:00:05 -0400 Subject: [PATCH 09/12] Parse class fields and private methods by default (#13175) * feat: materialize class features * chore: move testcases to es2022 * chore: update test fixtures * chore: remove classPr\w+ from options.json * chore: remove empty options.json * update flow test allowlist * update typescript allowlist --- .../babel-parser/src/parser/error-message.js | 3 +- .../babel-parser/src/parser/expression.js | 11 +--- packages/babel-parser/src/parser/statement.js | 7 --- .../invalid-arrow-function/output.json | 2 +- .../new-target-invalid/output.json | 2 +- .../no-method-asi/options.json | 3 - .../async-functions/no-method-asi/output.json | 63 +++++++++++++++++++ .../class-method-no-asi/options.json | 3 - .../class-method-no-asi/output.json | 63 +++++++++++++++++++ .../asi-failure-generator/input.js | 0 .../asi-failure-generator/options.json | 3 + .../async-generator/input.js | 0 .../async-generator/output.json | 0 .../class-private-methods/async/input.js | 0 .../class-private-methods/async/output.json | 0 .../class-private-methods/combined/input.js | 0 .../combined/output.json | 0 .../failure-name-constructor/input.js | 0 .../failure-name-constructor/output.json | 0 .../failure-spaces/input.js | 0 .../failure-spaces/output.json | 0 .../class-private-methods/generator/input.js | 0 .../generator/output.json | 0 .../class-private-methods/get-set/input.js | 0 .../class-private-methods/get-set/output.json | 0 .../class-private-methods/method/input.js | 0 .../class-private-methods/method/output.json | 0 .../class-private-names-duplicated/README.md | 0 .../instance-field-instance-field/input.js | 0 .../instance-field-instance-field/output.json | 0 .../instance-field-instance-get/input.js | 0 .../instance-field-instance-get/output.json | 0 .../instance-field-instance-method/input.js | 0 .../output.json | 0 .../instance-field-instance-set/input.js | 0 .../instance-field-instance-set/output.json | 0 .../instance-field-static-field/input.js | 0 .../instance-field-static-field/output.json | 0 .../instance-field-static-get/input.js | 0 .../instance-field-static-get/output.json | 0 .../instance-field-static-method/input.js | 0 .../instance-field-static-method/output.json | 0 .../instance-field-static-set/input.js | 0 .../instance-field-static-set/output.json | 0 .../instance-get-instance-field/input.js | 0 .../instance-get-instance-field/output.json | 0 .../instance-get-instance-get/input.js | 0 .../instance-get-instance-get/output.json | 0 .../instance-get-instance-method/input.js | 0 .../instance-get-instance-method/output.json | 0 .../instance-get-instance-set/input.js | 0 .../instance-get-instance-set/output.json | 0 .../instance-get-static-field/input.js | 0 .../instance-get-static-field/output.json | 0 .../instance-get-static-get/input.js | 0 .../instance-get-static-get/output.json | 0 .../instance-get-static-method/input.js | 0 .../instance-get-static-method/output.json | 0 .../instance-get-static-set/input.js | 0 .../instance-get-static-set/output.json | 0 .../instance-method-instance-field/input.js | 0 .../output.json | 0 .../instance-method-instance-get/input.js | 0 .../instance-method-instance-get/output.json | 0 .../instance-method-instance-method/input.js | 0 .../output.json | 0 .../instance-method-instance-set/input.js | 0 .../instance-method-instance-set/output.json | 0 .../instance-method-static-field/input.js | 0 .../instance-method-static-field/output.json | 0 .../instance-method-static-get/input.js | 0 .../instance-method-static-get/output.json | 0 .../instance-method-static-method/input.js | 0 .../instance-method-static-method/output.json | 0 .../instance-method-static-set/input.js | 0 .../instance-method-static-set/output.json | 0 .../instance-set-instance-field/input.js | 0 .../instance-set-instance-field/output.json | 0 .../instance-set-instance-get/input.js | 0 .../instance-set-instance-get/output.json | 0 .../instance-set-instance-method/input.js | 0 .../instance-set-instance-method/output.json | 0 .../instance-set-instance-set/input.js | 0 .../instance-set-instance-set/output.json | 0 .../instance-set-static-field/input.js | 0 .../instance-set-static-field/output.json | 0 .../instance-set-static-get/input.js | 0 .../instance-set-static-get/output.json | 0 .../instance-set-static-method/input.js | 0 .../instance-set-static-method/output.json | 0 .../instance-set-static-set/input.js | 0 .../instance-set-static-set/output.json | 0 .../static-field-instance-field/input.js | 0 .../static-field-instance-field/output.json | 0 .../static-field-instance-get/input.js | 0 .../static-field-instance-get/output.json | 0 .../static-field-instance-method/input.js | 0 .../static-field-instance-method/output.json | 0 .../static-field-instance-set/input.js | 0 .../static-field-instance-set/output.json | 0 .../static-field-static-field/input.js | 0 .../static-field-static-field/output.json | 0 .../static-field-static-get/input.js | 0 .../static-field-static-get/output.json | 0 .../static-field-static-method/input.js | 0 .../static-field-static-method/output.json | 0 .../static-field-static-set/input.js | 0 .../static-field-static-set/output.json | 0 .../static-get-instance-field/input.js | 0 .../static-get-instance-field/output.json | 0 .../static-get-instance-get/input.js | 0 .../static-get-instance-get/output.json | 0 .../static-get-instance-method/input.js | 0 .../static-get-instance-method/output.json | 0 .../static-get-instance-set/input.js | 0 .../static-get-instance-set/output.json | 0 .../static-get-static-field/input.js | 0 .../static-get-static-field/output.json | 0 .../static-get-static-get/input.js | 0 .../static-get-static-get/output.json | 0 .../static-get-static-method/input.js | 0 .../static-get-static-method/output.json | 0 .../static-get-static-set/input.js | 0 .../static-get-static-set/output.json | 0 .../static-method-instance-field/input.js | 0 .../static-method-instance-field/output.json | 0 .../static-method-instance-get/input.js | 0 .../static-method-instance-get/output.json | 0 .../static-method-instance-method/input.js | 0 .../static-method-instance-method/output.json | 0 .../static-method-instance-set/input.js | 0 .../static-method-instance-set/output.json | 0 .../static-method-static-field/input.js | 0 .../static-method-static-field/output.json | 0 .../static-method-static-get/input.js | 0 .../static-method-static-get/output.json | 0 .../static-method-static-method/input.js | 0 .../static-method-static-method/output.json | 0 .../static-method-static-set/input.js | 0 .../static-method-static-set/output.json | 0 .../static-set-instance-field/input.js | 0 .../static-set-instance-field/output.json | 0 .../static-set-instance-get/input.js | 0 .../static-set-instance-get/output.json | 0 .../static-set-instance-method/input.js | 0 .../static-set-instance-method/output.json | 0 .../static-set-instance-set/input.js | 0 .../static-set-instance-set/output.json | 0 .../static-set-static-field/input.js | 0 .../static-set-static-field/output.json | 0 .../static-set-static-get/input.js | 0 .../static-set-static-get/output.json | 0 .../static-set-static-method/input.js | 0 .../static-set-static-method/output.json | 0 .../static-set-static-set/input.js | 0 .../static-set-static-set/output.json | 0 .../asi-failure-generator/input.js | 0 .../asi-failure-generator/options.json | 2 +- .../asi-failure-inline/input.js | 0 .../asi-failure-inline/options.json | 2 +- .../asi-success/input.js | 0 .../asi-success/output.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 0 .../declared-later-outer-class/input.js | 0 .../declared-later-outer-class/output.json | 0 .../declared-later-same-class/input.js | 0 .../declared-later-same-class/output.json | 0 .../failure-computed/input.js | 0 .../failure-computed/options.json | 2 +- .../input.js | 0 .../output.json | 0 .../failure-delete-private-property/input.js | 0 .../output.json | 0 .../failure-name-constructor/input.js | 0 .../failure-name-constructor/output.json | 0 .../failure-numeric-literal/input.js | 0 .../failure-numeric-literal/options.json | 5 +- .../failure-numeric-start-identifier/input.js | 0 .../options.json | 5 +- .../failure-shorthand/input.js | 0 .../failure-shorthand/options.json | 3 + .../failure-spaces/input.js | 0 .../failure-spaces/output.json | 0 .../failure-string-literal/input.js | 0 .../failure-string-literal/options.json | 2 +- .../class-private-properties/inline/input.js | 0 .../inline/output.json | 0 .../invalid-destructuring-arguments/input.js | 0 .../output.json | 0 .../invalid-destructuring/input.js | 0 .../invalid-destructuring/output.json | 0 .../invalid-object-method/input.js | 0 .../invalid-object-method/output.json | 0 .../invalid-ts-type-literal/input.js | 0 .../invalid-ts-type-literal/options.json | 3 + .../invalid-ts-type-literal/output.json | 0 .../class-private-properties/nested/input.js | 0 .../nested/output.json | 0 .../optional-chain-object/input.js | 0 .../optional-chain-object/output.json | 0 .../optional-chain-start-call/input.js | 0 .../optional-chain-start-call/output.json | 0 .../optional-chain-start-member-call/input.js | 0 .../output.json | 0 .../optional-chain-start-member/input.js | 0 .../optional-chain-start-member/output.json | 0 .../optional-chain-start-simple/input.js | 0 .../optional-chain-start-simple/output.json | 0 .../pbn-success/input.js | 0 .../pbn-success/output.json | 0 .../class-private-properties/static/input.js | 0 .../static/output.json | 0 .../super-call/input.js | 0 .../super-call/output.json | 0 .../super-private-member-access/input.js | 0 .../super-private-member-access/output.json | 0 .../undeclared-nested/input.js | 0 .../undeclared-nested/output.json | 0 .../undeclared-top-level/input.js | 0 .../undeclared-top-level/output.json | 0 .../arguments-in-arrow-function/input.js | 0 .../arguments-in-arrow-function/output.json | 0 .../arguments-in-function/input.js | 0 .../arguments-in-function/output.json | 0 .../arguments-in-key/input.js | 0 .../arguments-in-key/output.json | 0 .../input.js | 0 .../options.json | 3 + .../output.json | 0 .../arguments-in-nested-class/input.js | 0 .../arguments-in-nested-class/output.json | 0 .../class-properties/arguments/input.js | 0 .../class-properties/arguments/output.json | 0 .../asi-failure-computed/input.js | 0 .../asi-failure-computed/options.json | 2 +- .../asi-failure-generator/input.js | 0 .../asi-failure-generator/options.json | 2 +- .../asi-failure-inline/input.js | 0 .../asi-failure-inline/options.json | 2 +- .../class-properties/asi-success/input.js | 0 .../class-properties/asi-success/output.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 0 .../await-in-async-in-class-property/input.js | 0 .../output.json | 0 .../await-in-class-property-in-async/input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 0 .../class-properties/computed/input.js | 0 .../class-properties/computed/output.json | 0 .../class-properties/edge-cases/input.js | 0 .../class-properties/edge-cases/output.json | 0 .../class-properties/inline/input.js | 0 .../class-properties/inline/output.json | 0 .../new-target-invalid/input.js | 0 .../new-target-invalid/output.json | 2 +- .../new-target-with-flow/input.js | 0 .../new-target-with-flow/options.json | 3 + .../new-target-with-flow/output.json | 0 .../class-properties/new-target/input.js | 0 .../class-properties/new-target/output.json | 0 .../class-properties/no-ctor-2/input.js | 0 .../class-properties/no-ctor-2/output.json | 0 .../class-properties/no-ctor/input.js | 0 .../class-properties/no-ctor/output.json | 0 .../no-static-prototype-2/input.js | 0 .../no-static-prototype-2/output.json | 0 .../no-static-prototype/input.js | 0 .../no-static-prototype/output.json | 0 .../static-field-named-constructor/input.js | 0 .../output.json | 0 .../class-properties/super-call/input.js | 0 .../class-properties/super-call/output.json | 0 .../super-inside-arrow-function/input.js | 0 .../super-inside-arrow-function/output.json | 0 .../super-inside-function/input.js | 0 .../super-inside-function/output.json | 0 .../class-properties/super/input.js | 0 .../class-properties/super/output.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 0 .../invalid-new-target/output.json | 2 +- .../class-private-method/basic/options.json | 7 +-- .../not-enabled/options.json | 2 +- .../class-private-property/basic/options.json | 2 +- .../class-private-property/flow/options.json | 6 +- .../not-enabled/options.json | 2 +- .../typescript/options.json | 6 +- .../estree/class-property/basic/options.json | 2 +- .../class-property/not-enabled/options.json | 2 +- .../estree/private-in/basic/options.json | 2 +- .../class-private-properties/input.js | 4 -- .../class-private-properties/options.json | 3 - .../input.js | 3 - .../options.json | 4 -- .../input.js | 3 - .../options.json | 4 -- .../input.js | 3 - .../options.json | 4 -- .../_no-plugin/private-in/options.json | 5 +- .../asi-failure-generator/options.json | 7 --- .../async-generator/options.json | 3 - .../class-private-methods/async/options.json | 3 - .../combined/options.json | 7 --- .../failure-name-constructor/options.json | 3 - .../failure-no-plugin/input.js | 4 -- .../failure-no-plugin/options.json | 4 -- .../failure-spaces/options.json | 3 - .../generator/options.json | 3 - .../get-set/options.json | 3 - .../class-private-methods/method/options.json | 3 - .../instance-field-instance-get/options.json | 3 - .../options.json | 3 - .../instance-field-instance-set/options.json | 3 - .../instance-field-static-field/options.json | 3 - .../instance-field-static-get/options.json | 3 - .../instance-field-static-method/options.json | 3 - .../instance-field-static-set/options.json | 3 - .../instance-get-instance-field/options.json | 3 - .../instance-get-instance-get/options.json | 3 - .../instance-get-instance-method/options.json | 3 - .../instance-get-static-field/options.json | 3 - .../instance-get-static-get/options.json | 3 - .../instance-get-static-method/options.json | 3 - .../instance-get-static-set/options.json | 3 - .../options.json | 3 - .../instance-method-instance-get/options.json | 3 - .../options.json | 3 - .../instance-method-instance-set/options.json | 3 - .../instance-method-static-field/options.json | 3 - .../instance-method-static-get/options.json | 3 - .../options.json | 3 - .../instance-method-static-set/options.json | 3 - .../instance-set-instance-field/options.json | 3 - .../instance-set-instance-method/options.json | 3 - .../instance-set-instance-set/options.json | 3 - .../instance-set-static-field/options.json | 3 - .../instance-set-static-get/options.json | 3 - .../instance-set-static-method/options.json | 3 - .../instance-set-static-set/options.json | 3 - .../options.json | 3 - .../static-field-instance-field/options.json | 3 - .../static-field-instance-get/options.json | 3 - .../static-field-instance-method/options.json | 3 - .../static-field-instance-set/options.json | 3 - .../static-field-static-field/options.json | 3 - .../static-field-static-get/options.json | 3 - .../static-field-static-method/options.json | 3 - .../static-field-static-set/options.json | 3 - .../static-get-instance-field/options.json | 3 - .../static-get-instance-get/options.json | 3 - .../static-get-instance-method/options.json | 3 - .../static-get-instance-set/options.json | 3 - .../static-get-static-field/options.json | 3 - .../static-get-static-get/options.json | 3 - .../static-get-static-method/options.json | 3 - .../static-method-instance-field/options.json | 3 - .../static-method-instance-get/options.json | 3 - .../options.json | 3 - .../static-method-instance-set/options.json | 3 - .../static-method-static-field/options.json | 3 - .../static-method-static-get/options.json | 3 - .../static-method-static-method/options.json | 3 - .../static-method-static-set/options.json | 3 - .../static-set-instance-field/options.json | 3 - .../static-set-instance-get/options.json | 3 - .../static-set-instance-method/options.json | 3 - .../static-set-instance-set/options.json | 3 - .../static-set-static-field/options.json | 3 - .../static-set-static-method/options.json | 3 - .../static-set-static-set/options.json | 3 - .../asi-success/options.json | 3 - .../options.json | 3 - .../options.json | 3 - .../declared-later-outer-class/options.json | 3 - .../declared-later-same-class/options.json | 3 - .../options.json | 3 - .../options.json | 3 - .../failure-name-constructor/options.json | 3 - .../failure-shorthand/options.json | 6 -- .../failure-spaces/options.json | 3 - .../inline/options.json | 3 - .../options.json | 3 - .../invalid-destructuring/options.json | 3 - .../invalid-object-method/options.json | 3 - .../invalid-ts-type-literal/options.json | 3 - .../nested/options.json | 3 - .../optional-chain-object/options.json | 3 - .../optional-chain-start-call/options.json | 3 - .../options.json | 3 - .../optional-chain-start-member/options.json | 3 - .../optional-chain-start-simple/options.json | 3 - .../class-private-properties/options.json | 3 - .../pbn-success/options.json | 3 - .../static/options.json | 3 - .../super-call/options.json | 3 - .../super-private-member-access/options.json | 3 - .../undeclared-nested/options.json | 5 -- .../undeclared-top-level/options.json | 5 -- .../arguments-in-arrow-function/options.json | 3 - .../arguments-in-function/options.json | 3 - .../arguments-in-key/options.json | 3 - .../options.json | 6 -- .../arguments-in-nested-class/options.json | 3 - .../class-properties/arguments/options.json | 3 - .../class-properties/asi-success/options.json | 3 - .../options.json | 3 - .../options.json | 3 - .../class-properties/computed/options.json | 3 - .../class-properties/edge-cases/options.json | 3 - .../class-properties/inline/options.json | 3 - .../new-target-invalid/options.json | 3 - .../new-target-with-flow/options.json | 3 - .../class-properties/new-target/options.json | 3 - .../class-properties/no-ctor-2/options.json | 3 - .../class-properties/no-ctor/options.json | 3 - .../no-static-prototype-2/options.json | 3 - .../no-static-prototype/options.json | 3 - .../class-properties/options.json | 3 - .../options.json | 3 - .../class-properties/super-call/options.json | 3 - .../super-inside-arrow-function/options.json | 3 - .../super-inside-function/options.json | 3 - .../class-properties/super/options.json | 3 - .../options.json | 3 - .../options.json | 3 - .../decorators-2/class-property/options.json | 6 +- .../compued-property/options.json | 5 +- .../private-property/options.json | 6 +- .../decorators-2/static-property/options.json | 5 +- .../computed-member-expr-on-prop/options.json | 2 +- .../options.json | 9 +-- .../valid-class-in-module-blocks/options.json | 7 +-- .../options.json | 2 +- .../options.json | 2 +- .../private-expression/options.json | 2 +- .../private-in-class-heritage/options.json | 2 +- .../private-in-escaped-sequence/options.json | 2 +- .../private-in-parenthesized/options.json | 2 +- .../private-in-without-field/options.json | 2 +- .../private-in/private-in/options.json | 2 +- .../options.json | 1 - .../inside-class-property/options.json | 2 +- .../inside-property-key/options.json | 5 +- .../uncategorised/43/options.json | 3 - .../uncategorised/44/options.json | 3 - .../uncategorised/45/options.json | 3 - .../uncategorised/46/options.json | 3 - .../uncategorised/47/options.json | 2 +- .../uncategorised/48/options.json | 2 +- .../declare-method/options.json | 6 +- .../flow/class-private-property/options.json | 2 +- .../declare-after-decorators/options.json | 6 +- .../declare-before-decorators/options.json | 6 +- .../flow/class-properties/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../flow/classes/good_01/options.json | 2 +- .../asserts-this-with-predicate/options.json | 2 +- .../fixtures/typescript/class/options.json | 2 +- .../declare/module-class/options.json | 2 +- .../declare/namespace-class/options.json | 2 +- .../async-arrow-generic-9560/options.json | 2 +- scripts/parser-tests/flow/allowlist.txt | 2 + scripts/parser-tests/typescript/allowlist.txt | 6 -- 481 files changed, 202 insertions(+), 586 deletions(-) delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/no-method-asi/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/no-method-asi/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2018/async-generators/class-method-no-asi/options.json create mode 100644 packages/babel-parser/test/fixtures/es2018/async-generators/class-method-no-asi/output.json rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/asi-failure-generator/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/es2022/class-private-methods/asi-failure-generator/options.json rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/async-generator/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/async-generator/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/async/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/async/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/combined/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/combined/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/failure-name-constructor/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/failure-name-constructor/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/failure-spaces/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/failure-spaces/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/generator/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/generator/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/get-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/get-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-methods/method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/README.md (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-instance-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-instance-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-instance-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-instance-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-instance-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-instance-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-instance-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-instance-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-static-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-static-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-static-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-static-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-static-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-static-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-static-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-field-static-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-instance-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-instance-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-instance-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-instance-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-instance-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-instance-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-instance-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-instance-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-static-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-static-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-static-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-static-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-static-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-static-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-static-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-get-static-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-instance-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-instance-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-instance-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-instance-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-instance-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-instance-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-instance-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-instance-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-static-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-static-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-static-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-static-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-static-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-static-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-static-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-method-static-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-instance-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-instance-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-instance-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-instance-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-instance-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-instance-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-instance-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-instance-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-static-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-static-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-static-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-static-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-static-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-static-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-static-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/instance-set-static-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-instance-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-instance-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-instance-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-instance-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-instance-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-instance-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-instance-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-instance-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-static-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-static-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-static-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-static-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-static-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-static-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-static-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-field-static-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-instance-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-instance-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-instance-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-instance-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-instance-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-instance-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-instance-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-instance-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-static-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-static-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-static-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-static-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-static-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-static-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-static-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-get-static-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-instance-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-instance-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-instance-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-instance-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-instance-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-instance-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-instance-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-instance-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-static-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-static-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-static-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-static-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-static-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-static-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-static-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-method-static-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-instance-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-instance-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-instance-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-instance-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-instance-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-instance-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-instance-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-instance-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-static-field/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-static-field/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-static-get/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-static-get/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-static-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-static-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-static-set/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-names-duplicated/static-set-static-set/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/asi-failure-generator/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental/class-properties => es2022/class-private-properties}/asi-failure-generator/options.json (56%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/asi-failure-inline/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/asi-failure-inline/options.json (51%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/asi-success/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/asi-success/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/await-in-async-in-private-property/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/await-in-async-in-private-property/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/await-in-private-property-in-async/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/await-in-private-property-in-async/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/await-in-private-property-in-params-of-async-arrow/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/declared-later-outer-class/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/declared-later-outer-class/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/declared-later-same-class/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/declared-later-same-class/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-computed/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-computed/options.json (51%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-delete-optional-private-property/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-delete-optional-private-property/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-delete-private-property/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-delete-private-property/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-name-constructor/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-name-constructor/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-numeric-literal/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-numeric-literal/options.json (53%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-numeric-start-identifier/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-numeric-start-identifier/options.json (53%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-shorthand/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-shorthand/options.json rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-spaces/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-spaces/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-string-literal/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/failure-string-literal/options.json (51%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/inline/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/inline/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/invalid-destructuring-arguments/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/invalid-destructuring-arguments/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/invalid-destructuring/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/invalid-destructuring/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/invalid-object-method/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/invalid-object-method/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/invalid-ts-type-literal/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-ts-type-literal/options.json rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/invalid-ts-type-literal/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/nested/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/nested/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-object/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-object/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-start-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-start-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-start-member-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-start-member-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-start-member/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-start-member/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-start-simple/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/optional-chain-start-simple/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/pbn-success/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/pbn-success/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/static/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/static/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/super-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/super-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/super-private-member-access/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/super-private-member-access/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/undeclared-nested/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/undeclared-nested/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/undeclared-top-level/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-private-properties/undeclared-top-level/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-arrow-function/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-arrow-function/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-function/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-function/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-key/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-key/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-nested-class-decorator-call-expression/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/options.json rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-nested-class-decorator-call-expression/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-nested-class/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments-in-nested-class/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/arguments/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/asi-failure-computed/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/asi-failure-computed/options.json (56%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/asi-failure-generator/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental/class-private-properties => es2022/class-properties}/asi-failure-generator/options.json (51%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/asi-failure-inline/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/asi-failure-inline/options.json (56%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/asi-success/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/asi-success/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-identifier-in-property-in-arguments-of-async-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-in-async-in-class-property/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-in-async-in-class-property/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-in-class-property-in-async/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-in-class-property-in-async/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-in-computed-property-in-params-of-async-arrow/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-in-property-in-params-of-async-arrow/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/await-in-property-in-params-of-async-arrow/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/computed/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/computed/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/edge-cases/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/edge-cases/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/inline/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/inline/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/new-target-invalid/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/new-target-invalid/output.json (94%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/new-target-with-flow/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/options.json rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/new-target-with-flow/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/new-target/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/new-target/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/no-ctor-2/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/no-ctor-2/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/no-ctor/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/no-ctor/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/no-static-prototype-2/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/no-static-prototype-2/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/no-static-prototype/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/no-static-prototype/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/static-field-named-constructor/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/static-field-named-constructor/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/super-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/super-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/super-inside-arrow-function/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/super-inside-arrow-function/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/super-inside-function/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/super-inside-function/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/super/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/super/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/yield-in-class-property-in-generator/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/yield-in-class-property-in-generator/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/yield-in-generator-in-class-property/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/class-properties/yield-in-generator-in-class-property/output.json (100%) delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/class-private-properties/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/class-private-properties/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer-and-type/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer-and-type/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-without-initializer/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-without-initializer/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/asi-failure-generator/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/async/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-no-plugin/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-no-plugin/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-shorthand/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-object/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-call/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member-call/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-simple/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/static/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/computed/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/inline/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/new-target/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/super-call/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/super/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/uncategorised/43/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/uncategorised/44/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/uncategorised/45/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/uncategorised/46/options.json diff --git a/packages/babel-parser/src/parser/error-message.js b/packages/babel-parser/src/parser/error-message.js index eba5a60cb2fe..0742e32f025d 100644 --- a/packages/babel-parser/src/parser/error-message.js +++ b/packages/babel-parser/src/parser/error-message.js @@ -189,7 +189,8 @@ export const ErrorMessages = makeErrorTemplates( "Leading decorators must be attached to a class declaration.", UnexpectedLexicalDeclaration: "Lexical declaration cannot appear in a single-statement context.", - UnexpectedNewTarget: "`new.target` can only be used in functions.", + UnexpectedNewTarget: + "`new.target` can only be used in functions or class properties.", UnexpectedNumericSeparator: "A numeric separator is only allowed between two digits.", UnexpectedPrivateField: diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 3c3a640ca5e6..27d699e8255a 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1283,7 +1283,6 @@ export default class ExpressionParser extends LValParser { const isPrivate = this.match(tt.hash); if (isPrivate) { - this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]); if (!isPrivateNameAllowed) { this.raise(this.state.pos, Errors.UnexpectedPrivateField); } @@ -1520,15 +1519,7 @@ export default class ExpressionParser extends LValParser { const metaProp = this.parseMetaProperty(node, meta, "target"); if (!this.scope.inNonArrowFunction && !this.scope.inClass) { - const errorTemplate = { ...Errors.UnexpectedNewTarget }; - - if (this.hasPlugin("classProperties")) { - errorTemplate.template += " or class properties"; - } - - /* eslint-disable @babel/development-internal/dry-error-messages */ - this.raise(metaProp.start, errorTemplate); - /* eslint-enable @babel/development-internal/dry-error-messages */ + this.raise(metaProp.start, Errors.UnexpectedNewTarget); } return metaProp; diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index f8c05d912709..3daf7a22cf00 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1564,8 +1564,6 @@ export default class StatementParser extends ExpressionParser { classBody: N.ClassBody, prop: N.ClassPrivateProperty, ) { - this.expectPlugin("classPrivateProperties", prop.key.start); - const node = this.parseClassPrivateProperty(prop); classBody.body.push(node); @@ -1603,8 +1601,6 @@ export default class StatementParser extends ExpressionParser { isGenerator: boolean, isAsync: boolean, ): void { - this.expectPlugin("classPrivateMethods", method.key.start); - const node = this.parseMethod( method, isGenerator, @@ -1650,9 +1646,6 @@ export default class StatementParser extends ExpressionParser { // https://tc39.es/proposal-class-fields/#prod-FieldDefinition parseClassProperty(node: N.ClassProperty): N.ClassProperty { - if (!node.typeAnnotation || this.match(tt.eq)) { - this.expectPlugin("classProperties"); - } this.parseInitializer(node); this.semicolon(); return this.finishNode(node, "ClassProperty"); diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json index 8708bc00f8ff..9df9e66b9303 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ - "SyntaxError: `new.target` can only be used in functions. (2:2)" + "SyntaxError: `new.target` can only be used in functions or class properties. (2:2)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json index 0b1babd1f983..bae2a36c8de2 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: `new.target` can only be used in functions. (1:0)" + "SyntaxError: `new.target` can only be used in functions or class properties. (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/no-method-asi/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/no-method-asi/options.json deleted file mode 100644 index 7348c12f9e90..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/no-method-asi/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (3:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/no-method-asi/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/no-method-asi/output.json new file mode 100644 index 000000000000..8cfa22d1ed02 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/no-method-asi/output.json @@ -0,0 +1,63 @@ +{ + "type": "File", + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"A"}, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "ClassProperty", + "start":12,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, + "static": false, + "key": { + "type": "Identifier", + "start":12,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"async"}, + "name": "async" + }, + "computed": false, + "value": null + }, + { + "type": "ClassMethod", + "start":20,"end":25,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7}}, + "static": false, + "key": { + "type": "Identifier", + "start":20,"end":21,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":23,"end":25,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":7}}, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-no-asi/options.json b/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-no-asi/options.json deleted file mode 100644 index 7348c12f9e90..000000000000 --- a/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-no-asi/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (3:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-no-asi/output.json b/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-no-asi/output.json new file mode 100644 index 000000000000..a5531d0392d7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-no-asi/output.json @@ -0,0 +1,63 @@ +{ + "type": "File", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "id": { + "type": "Identifier", + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"A"}, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "ClassProperty", + "start":12,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, + "static": false, + "key": { + "type": "Identifier", + "start":12,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"async"}, + "name": "async" + }, + "computed": false, + "value": null + }, + { + "type": "ClassMethod", + "start":20,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, + "static": false, + "kind": "method", + "key": { + "type": "Identifier", + "start":22,"end":23,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"a"}, + "name": "a" + }, + "computed": false, + "id": null, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":25,"end":27,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/asi-failure-generator/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/asi-failure-generator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/asi-failure-generator/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/asi-failure-generator/input.js diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-methods/asi-failure-generator/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/asi-failure-generator/options.json new file mode 100644 index 000000000000..d87ca9131484 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2022/class-private-methods/asi-failure-generator/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (3:3)" +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/async-generator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/async-generator/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/async-generator/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/async-generator/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/async/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/async/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/async/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/async/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/async/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/async/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/combined/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-name-constructor/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-name-constructor/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-name-constructor/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-name-constructor/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-spaces/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-spaces/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-spaces/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/failure-spaces/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/generator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/generator/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/generator/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/generator/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/get-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/get-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/get-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/get-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-methods/method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-methods/method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-methods/method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-methods/method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/README.md b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/README.md similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/README.md rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/README.md diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-instance-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-field-static-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-instance-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-get-static-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-instance-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-method-static-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-instance-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/instance-set-static-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-instance-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-field-static-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-instance-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-get-static-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-instance-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-method-static-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-instance-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-field/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-field/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-field/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-field/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-get/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-get/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-get/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-get/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-set/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-set/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-set/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-names-duplicated/static-set-static-set/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-generator/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-generator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-generator/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-generator/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-generator/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-generator/options.json similarity index 56% rename from packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-generator/options.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-generator/options.json index 2a095c57b80a..f6c40158813b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-generator/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-generator/options.json @@ -1,4 +1,4 @@ { "throws": "Unexpected token (3:8)", - "plugins": ["classProperties"] + "plugins": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-inline/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-inline/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-inline/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-inline/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-inline/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-inline/options.json similarity index 51% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-inline/options.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-inline/options.json index 86a0463390f9..25190f8412ed 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-inline/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-failure-inline/options.json @@ -1,4 +1,4 @@ { "throws": "Unexpected token (2:5)", - "plugins": ["classPrivateProperties"] + "plugins": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-success/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-success/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-success/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/asi-success/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/await-identifier-in-property-in-arguments-of-async-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-async-in-private-property/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-async-in-private-property/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-async-in-private-property/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-async-in-private-property/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-async/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-async/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-async/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-async/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-params-of-async-arrow/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-params-of-async-arrow/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-params-of-async-arrow/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-params-of-async-arrow/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/await-in-private-property-in-params-of-async-arrow/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-outer-class/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/declared-later-same-class/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-computed/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-computed/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-computed/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-computed/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-computed/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-computed/options.json similarity index 51% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-computed/options.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-computed/options.json index d740be4d9342..40615fd0b8fe 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-computed/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-computed/options.json @@ -1,4 +1,4 @@ { "throws": "Unexpected token (3:3)", - "plugins": ["classPrivateProperties"] + "plugins": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-optional-private-property/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-private-property/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-private-property/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-private-property/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-delete-private-property/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-name-constructor/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-name-constructor/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-name-constructor/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-name-constructor/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-literal/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-literal/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-literal/options.json similarity index 53% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-literal/options.json index 57e6697b16d2..b56cbc4fee2c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-literal/options.json @@ -1,6 +1,3 @@ { - "plugins": [ - "classPrivateProperties" - ], "throws": "Unexpected digit after hash token. (2:2)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-start-identifier/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-start-identifier/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-start-identifier/options.json similarity index 53% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/options.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-start-identifier/options.json index 57e6697b16d2..b56cbc4fee2c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-start-identifier/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-numeric-start-identifier/options.json @@ -1,6 +1,3 @@ { - "plugins": [ - "classPrivateProperties" - ], "throws": "Unexpected digit after hash token. (2:2)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-shorthand/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-shorthand/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-shorthand/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-shorthand/input.js diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-shorthand/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-shorthand/options.json new file mode 100644 index 000000000000..a323b4e6f07f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-shorthand/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (4:11)" +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-spaces/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-spaces/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-spaces/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-spaces/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-string-literal/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-string-literal/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-string-literal/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-string-literal/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-string-literal/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-string-literal/options.json similarity index 51% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-string-literal/options.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-string-literal/options.json index 714877566f00..99f73539477e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-string-literal/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/failure-string-literal/options.json @@ -1,4 +1,4 @@ { "throws": "Unexpected token (2:3)", - "plugins": ["classPrivateProperties"] + "plugins": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/inline/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/inline/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/inline/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/inline/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring-arguments/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring-arguments/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring-arguments/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring-arguments/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-destructuring/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-object-method/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-object-method/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-object-method/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-object-method/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-ts-type-literal/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-ts-type-literal/input.js diff --git a/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-ts-type-literal/options.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-ts-type-literal/options.json new file mode 100644 index 000000000000..5047d6993fe8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-ts-type-literal/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["typescript"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-ts-type-literal/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/invalid-ts-type-literal/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/nested/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-object/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-object/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-object/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-object/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-object/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-call/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-call/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-call/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member-call/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member-call/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member-call/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-member/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-simple/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-simple/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-simple/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-simple/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/optional-chain-start-simple/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/pbn-success/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/static/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/static/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/static/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/static/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/static/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/static/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/super-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/super-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-private-member-access/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/super-private-member-access/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/super-private-member-access/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/super-private-member-access/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-nested/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-nested/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-nested/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-nested/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/input.js b/packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-top-level/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/input.js rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-top-level/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json b/packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-top-level/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json rename to packages/babel-parser/test/fixtures/es2022/class-private-properties/undeclared-top-level/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-arrow-function/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-arrow-function/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-arrow-function/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-arrow-function/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-function/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-function/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-function/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-function/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-key/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/input.js diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/options.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/options.json new file mode 100644 index 000000000000..6c9cc72327dc --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["decorators", { "decoratorsBeforeExport": false }]] +} 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/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class-decorator-call-expression/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments-in-nested-class/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/arguments/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/arguments/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-computed/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-computed/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-computed/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-computed/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-computed/options.json b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-computed/options.json similarity index 56% rename from packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-computed/options.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-computed/options.json index 0c58f8ded10a..dae757e82e01 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-computed/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-computed/options.json @@ -1,4 +1,4 @@ { "throws": "Unexpected token (3:9)", - "plugins": ["classProperties"] + "plugins": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-generator/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-generator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-generator/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-generator/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-generator/options.json b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-generator/options.json similarity index 51% rename from packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-generator/options.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-generator/options.json index ed9a49a3e543..f6c40158813b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-failure-generator/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-generator/options.json @@ -1,4 +1,4 @@ { "throws": "Unexpected token (3:8)", - "plugins": ["classPrivateProperties"] + "plugins": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-inline/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-inline/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-inline/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-inline/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-inline/options.json b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-inline/options.json similarity index 56% rename from packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-inline/options.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-inline/options.json index 2a11366381bf..fd6f1939dc38 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-failure-inline/options.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-failure-inline/options.json @@ -1,4 +1,4 @@ { "throws": "Unexpected token (2:4)", - "plugins": ["classProperties"] + "plugins": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-success/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/asi-success/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/asi-success/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/asi-success/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-in-arguments-of-async-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-computed-property-inside-params-of-function-inside-params-of-async-function/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-property-in-arguments-of-async-call/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-property-in-arguments-of-async-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-property-in-arguments-of-async-call/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-property-in-arguments-of-async-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-identifier-in-property-in-arguments-of-async-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-async-in-class-property/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-in-async-in-class-property/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-async-in-class-property/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-in-async-in-class-property/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-class-property-in-async/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-in-class-property-in-async/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-class-property-in-async/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-in-class-property-in-async/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-computed-property-in-params-of-async-arrow/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-in-computed-property-in-params-of-async-arrow/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-in-computed-property-in-params-of-async-arrow/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-property-in-params-of-async-arrow/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-property-in-params-of-async-arrow/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-in-property-in-params-of-async-arrow/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-in-property-in-params-of-async-arrow/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-property-in-params-of-async-arrow/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/await-in-property-in-params-of-async-arrow/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/await-in-property-in-params-of-async-arrow/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/await-in-property-in-params-of-async-arrow/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/computed/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/computed/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/computed/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/computed/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/computed/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/edge-cases/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/edge-cases/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/edge-cases/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/edge-cases/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/inline/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/inline/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/inline/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/inline/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/inline/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/inline/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/inline/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/inline/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-invalid/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/new-target-invalid/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-invalid/output.json similarity index 94% rename from packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/new-target-invalid/output.json index cea178645416..9810be4ecad8 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-invalid/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: `new.target` can only be used in functions. or class properties (1:8)" + "SyntaxError: `new.target` can only be used in functions or class properties. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/input.js diff --git a/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/options.json b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/options.json new file mode 100644 index 000000000000..66dd3748d6ea --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["flow"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/new-target-with-flow/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/new-target/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/new-target/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/new-target/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/new-target/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/new-target/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor-2/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor-2/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor-2/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor-2/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/no-ctor/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype-2/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype-2/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype-2/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype-2/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/no-static-prototype/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/static-field-named-constructor/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/static-field-named-constructor/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/static-field-named-constructor/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/static-field-named-constructor/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/super-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/super-call/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/super-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/super-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-arrow-function/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/super-inside-function/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/super/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/super/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/super/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/super/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/super/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-class-property-in-generator/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/input.js b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-generator-in-class-property/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/input.js rename to packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-generator-in-class-property/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/output.json b/packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-generator-in-class-property/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/output.json rename to packages/babel-parser/test/fixtures/es2022/class-properties/yield-in-generator-in-class-property/output.json diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json index a0f82167368b..9810be4ecad8 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ - "SyntaxError: `new.target` can only be used in functions. (1:8)" + "SyntaxError: `new.target` can only be used in functions or class properties. (1:8)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/estree/class-private-method/basic/options.json b/packages/babel-parser/test/fixtures/estree/class-private-method/basic/options.json index 45861ad78b1e..686413bc8cd8 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-method/basic/options.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-method/basic/options.json @@ -1,8 +1,3 @@ { - "plugins": [ - "flow", - "jsx", - ["estree", { "classFeatures": true }], - "classPrivateMethods" - ] + "plugins": ["flow", "jsx", ["estree", { "classFeatures": true }]] } diff --git a/packages/babel-parser/test/fixtures/estree/class-private-method/not-enabled/options.json b/packages/babel-parser/test/fixtures/estree/class-private-method/not-enabled/options.json index 9a3d6c4ac482..acae373c9918 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-method/not-enabled/options.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-method/not-enabled/options.json @@ -1,3 +1,3 @@ { - "plugins": ["flow", "jsx", "estree", "classPrivateMethods"] + "plugins": ["flow", "jsx", "estree"] } diff --git a/packages/babel-parser/test/fixtures/estree/class-private-property/basic/options.json b/packages/babel-parser/test/fixtures/estree/class-private-property/basic/options.json index b78bd034b69a..e801f17f1ed3 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-property/basic/options.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-property/basic/options.json @@ -1,3 +1,3 @@ { - "plugins": [["estree", { "classFeatures": true }], "classPrivateProperties"] + "plugins": [["estree", { "classFeatures": true }]] } diff --git a/packages/babel-parser/test/fixtures/estree/class-private-property/flow/options.json b/packages/babel-parser/test/fixtures/estree/class-private-property/flow/options.json index 59d8dfe89bbe..9ea515ec580f 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-property/flow/options.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-property/flow/options.json @@ -1,7 +1,3 @@ { - "plugins": [ - "flow", - ["estree", { "classFeatures": true }], - "classPrivateProperties" - ] + "plugins": ["flow", ["estree", { "classFeatures": true }]] } diff --git a/packages/babel-parser/test/fixtures/estree/class-private-property/not-enabled/options.json b/packages/babel-parser/test/fixtures/estree/class-private-property/not-enabled/options.json index b78bd034b69a..e801f17f1ed3 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-property/not-enabled/options.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-property/not-enabled/options.json @@ -1,3 +1,3 @@ { - "plugins": [["estree", { "classFeatures": true }], "classPrivateProperties"] + "plugins": [["estree", { "classFeatures": true }]] } diff --git a/packages/babel-parser/test/fixtures/estree/class-private-property/typescript/options.json b/packages/babel-parser/test/fixtures/estree/class-private-property/typescript/options.json index adab610a4371..a2eadec114ee 100644 --- a/packages/babel-parser/test/fixtures/estree/class-private-property/typescript/options.json +++ b/packages/babel-parser/test/fixtures/estree/class-private-property/typescript/options.json @@ -1,7 +1,3 @@ { - "plugins": [ - "typescript", - ["estree", { "classFeatures": true }], - "classPrivateProperties" - ] + "plugins": ["typescript", ["estree", { "classFeatures": true }]] } diff --git a/packages/babel-parser/test/fixtures/estree/class-property/basic/options.json b/packages/babel-parser/test/fixtures/estree/class-property/basic/options.json index db0123b564cc..e801f17f1ed3 100644 --- a/packages/babel-parser/test/fixtures/estree/class-property/basic/options.json +++ b/packages/babel-parser/test/fixtures/estree/class-property/basic/options.json @@ -1,3 +1,3 @@ { - "plugins": [["estree", { "classFeatures": true }], "classProperties"] + "plugins": [["estree", { "classFeatures": true }]] } diff --git a/packages/babel-parser/test/fixtures/estree/class-property/not-enabled/options.json b/packages/babel-parser/test/fixtures/estree/class-property/not-enabled/options.json index 78ec974b4f47..070d941a7562 100644 --- a/packages/babel-parser/test/fixtures/estree/class-property/not-enabled/options.json +++ b/packages/babel-parser/test/fixtures/estree/class-property/not-enabled/options.json @@ -1,3 +1,3 @@ { - "plugins": ["estree", "classProperties"] + "plugins": ["estree"] } diff --git a/packages/babel-parser/test/fixtures/estree/private-in/basic/options.json b/packages/babel-parser/test/fixtures/estree/private-in/basic/options.json index 6db93254bf6b..3f3c0378adb1 100644 --- a/packages/babel-parser/test/fixtures/estree/private-in/basic/options.json +++ b/packages/babel-parser/test/fixtures/estree/private-in/basic/options.json @@ -1,3 +1,3 @@ { - "plugins": ["estree", "classPrivateProperties", "privateIn"] + "plugins": ["estree", "privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-private-properties/input.js b/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-private-properties/input.js deleted file mode 100644 index 07fa01ba84a8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-private-properties/input.js +++ /dev/null @@ -1,4 +0,0 @@ -class Point { - #x = 1; - #y = 2; -} diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-private-properties/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-private-properties/options.json deleted file mode 100644 index 6904d075e9f1..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-private-properties/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling one of the following parser plugin(s): 'classPrivateProperties, classPrivateMethods' (2:2)" -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer-and-type/input.js b/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer-and-type/input.js deleted file mode 100644 index f82f8d51d7cc..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer-and-type/input.js +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - bar: string = 'bizz'; -} diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer-and-type/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer-and-type/options.json deleted file mode 100644 index a4e85bf033a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer-and-type/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "plugins": ["flow"], - "throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (2:14)" -} diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer/input.js b/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer/input.js deleted file mode 100644 index fa80e3af68a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer/input.js +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - bar = 'bizz'; -} diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer/options.json deleted file mode 100644 index aaa6e8068648..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-with-initializer/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (2:6)", - "plugins": [] -} diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-without-initializer/input.js b/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-without-initializer/input.js deleted file mode 100644 index a36cdd975c82..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-without-initializer/input.js +++ /dev/null @@ -1,3 +0,0 @@ -class Foo { - bar; -} diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-without-initializer/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-without-initializer/options.json deleted file mode 100644 index bbec0b1850ba..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/class-properties-without-initializer/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'classProperties' (2:5)", - "plugins": [] -} diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/private-in/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/private-in/options.json index 582e8a659ab4..b605e6559e39 100644 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/private-in/options.json +++ b/packages/babel-parser/test/fixtures/experimental/_no-plugin/private-in/options.json @@ -1,6 +1,3 @@ { - "plugins": [ - "classPrivateProperties" - ], "throws": "This experimental syntax requires enabling the parser plugin: 'privateIn' (5:14)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/asi-failure-generator/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/asi-failure-generator/options.json deleted file mode 100644 index ab97abb8eb41..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/asi-failure-generator/options.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "throws": "Unexpected token (3:3)", - "plugins": [ - "classProperties", - "classPrivateMethods" - ] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/options.json deleted file mode 100644 index 8d265ec66c23..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateMethods"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/options.json deleted file mode 100644 index 8d265ec66c23..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateMethods"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/options.json deleted file mode 100644 index b69ee0b978f5..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/options.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugins": [ - "classProperties", - "classPrivateProperties", - "classPrivateMethods" - ] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/options.json deleted file mode 100644 index 8d265ec66c23..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateMethods"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-no-plugin/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-no-plugin/input.js deleted file mode 100644 index 2d0523cd4377..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-no-plugin/input.js +++ /dev/null @@ -1,4 +0,0 @@ -class Foo { - #p = x - #m () {} -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-no-plugin/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-no-plugin/options.json deleted file mode 100644 index 15cf5cc8d413..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-no-plugin/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'classPrivateMethods' (3:2)", - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/options.json deleted file mode 100644 index 8d265ec66c23..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateMethods"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/options.json deleted file mode 100644 index 8d265ec66c23..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateMethods"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/options.json deleted file mode 100644 index 8d265ec66c23..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateMethods"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/options.json deleted file mode 100644 index 8d265ec66c23..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateMethods"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/options.json deleted file mode 100644 index af02072af9d9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "classPrivateMethods"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/options.json deleted file mode 100644 index 25819769bb20..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/options.json deleted file mode 100644 index 25819769bb20..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-optional-private-property/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-shorthand/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-shorthand/options.json deleted file mode 100644 index fc0e9a4e81a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-shorthand/options.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "throws": "Unexpected token (4:11)", - "plugins": [ - "classPrivateProperties" - ] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/options.json deleted file mode 100644 index cb835ce4233c..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties", "typescript"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-object/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-object/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-object/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-call/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-call/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-call/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member-call/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member-call/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member-call/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-member/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-simple/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-simple/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/optional-chain-start-simple/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json deleted file mode 100644 index f26e916957c8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classPrivateProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/options.json deleted file mode 100644 index 1ca5069a3a2f..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "plugins": [ - "classPrivateProperties" - ] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/options.json deleted file mode 100644 index 1ca5069a3a2f..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "plugins": [ - "classPrivateProperties" - ] -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json deleted file mode 100644 index 4ee4c944603d..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "plugins": [ - "classProperties", - ["decorators", { "decoratorsBeforeExport": false }] - ] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/computed/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/inline/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/inline/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/inline/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/options.json deleted file mode 100644 index eabd25e1b5b8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties", "flow"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/options.json index 21fa2f7d9b3b..6c9cc72327dc 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/options.json @@ -1,7 +1,3 @@ { - "plugins": [ - "classProperties", - "classPrivateProperties", - ["decorators", { "decoratorsBeforeExport": false }] - ] + "plugins": [["decorators", { "decoratorsBeforeExport": false }]] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/compued-property/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/compued-property/options.json index 1ec7ff9a421c..6c9cc72327dc 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/compued-property/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/compued-property/options.json @@ -1,6 +1,3 @@ { - "plugins": [ - ["decorators", { "decoratorsBeforeExport": false }], - "classProperties" - ] + "plugins": [["decorators", { "decoratorsBeforeExport": false }]] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/options.json index 21fa2f7d9b3b..6c9cc72327dc 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/options.json @@ -1,7 +1,3 @@ { - "plugins": [ - "classProperties", - "classPrivateProperties", - ["decorators", { "decoratorsBeforeExport": false }] - ] + "plugins": [["decorators", { "decoratorsBeforeExport": false }]] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/options.json index 4ee4c944603d..6c9cc72327dc 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/options.json @@ -1,6 +1,3 @@ { - "plugins": [ - "classProperties", - ["decorators", { "decoratorsBeforeExport": false }] - ] + "plugins": [["decorators", { "decoratorsBeforeExport": false }]] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/options.json b/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/options.json index 137ef8fe75f1..a6855c41cfad 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/computed-member-expr-on-prop/options.json @@ -1,3 +1,3 @@ { - "plugins": ["decorators-legacy", "classProperties"] + "plugins": ["decorators-legacy"] } diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/options.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/options.json index 5a36d4e0d5af..6fdc8aa52350 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/options.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/invalid-class-in-module-blocks/options.json @@ -1,9 +1,4 @@ { "sourceType": "module", - "plugins": [ - "moduleBlocks", - "classPrivateProperties", - "classPrivateMethods", - "classProperties" - ] -} \ No newline at end of file + "plugins": ["moduleBlocks"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/module-blocks/valid-class-in-module-blocks/options.json b/packages/babel-parser/test/fixtures/experimental/module-blocks/valid-class-in-module-blocks/options.json index 02815f98933b..6fdc8aa52350 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-blocks/valid-class-in-module-blocks/options.json +++ b/packages/babel-parser/test/fixtures/experimental/module-blocks/valid-class-in-module-blocks/options.json @@ -1,9 +1,4 @@ { "sourceType": "module", - "plugins": [ - "moduleBlocks", - "classPrivateProperties", - "classPrivateMethods", - "classProperties" - ] + "plugins": ["moduleBlocks"] } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/options.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/options.json index 4f1c66180f1e..132494edab0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/options.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-left/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classPrivateProperties", "privateIn"] + "plugins": ["privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/options.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/options.json index 4f1c66180f1e..132494edab0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/options.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-binary-expression-right/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classPrivateProperties", "privateIn"] + "plugins": ["privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/options.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/options.json index 4f1c66180f1e..132494edab0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/options.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-expression/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classPrivateProperties", "privateIn"] + "plugins": ["privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/options.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/options.json index 4f1c66180f1e..132494edab0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/options.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-class-heritage/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classPrivateProperties", "privateIn"] + "plugins": ["privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/options.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/options.json index 4f1c66180f1e..132494edab0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/options.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-escaped-sequence/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classPrivateProperties", "privateIn"] + "plugins": ["privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/options.json index 4f1c66180f1e..132494edab0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/options.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-parenthesized/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classPrivateProperties", "privateIn"] + "plugins": ["privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/options.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/options.json index 4f1c66180f1e..132494edab0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/options.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in-without-field/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classPrivateProperties", "privateIn"] + "plugins": ["privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/private-in/private-in/options.json b/packages/babel-parser/test/fixtures/experimental/private-in/private-in/options.json index 4f1c66180f1e..132494edab0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/private-in/private-in/options.json +++ b/packages/babel-parser/test/fixtures/experimental/private-in/private-in/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classPrivateProperties", "privateIn"] + "plugins": ["privateIn"] } diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json deleted file mode 100644 index 0967ef424bce..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/options.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/options.json index ac03e3ac9677..3d99f51a3d04 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/options.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/options.json @@ -1,4 +1,4 @@ { - "plugins": ["topLevelAwati", "classProperties"], + "plugins": ["topLevelAwati"], "sourceType": "module" } diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-property-key/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-property-key/options.json index d136fa4bbc8c..aadc3411ae9b 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-property-key/options.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-property-key/options.json @@ -1,7 +1,4 @@ { - "plugins": [ - "topLevelAwait", - "classProperties" - ], + "plugins": ["topLevelAwait"], "sourceType": "module" } diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/43/options.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/43/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/43/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/44/options.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/44/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/44/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/45/options.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/45/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/45/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/46/options.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/46/options.json deleted file mode 100644 index 9c27576d4ad0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/46/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["classProperties"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/47/options.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/47/options.json index cbe3cf4d6141..a6855c41cfad 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/47/options.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/47/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classProperties", "decorators-legacy"] + "plugins": ["decorators-legacy"] } diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/48/options.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/48/options.json index cbe3cf4d6141..a6855c41cfad 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/48/options.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/48/options.json @@ -1,3 +1,3 @@ { - "plugins": ["classProperties", "decorators-legacy"] + "plugins": ["decorators-legacy"] } diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-method/options.json b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-method/options.json index 3bec5045a369..8e6ec258aec2 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-method/options.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-method/options.json @@ -1,8 +1,4 @@ { "sourceType": "module", - "plugins": [ - "flow", - "classPrivateProperties", - "classPrivateMethods" - ] + "plugins": ["flow"] } diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/options.json b/packages/babel-parser/test/fixtures/flow/class-private-property/options.json index d533f640ef62..8e6ec258aec2 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/options.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", - "plugins": ["flow", "classPrivateProperties"] + "plugins": ["flow"] } diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/options.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/options.json index 71e345f90808..4a1483574f95 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/options.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/options.json @@ -1,8 +1,4 @@ { "sourceType": "module", - "plugins": [ - "flow", - "classProperties", - ["decorators", { "decoratorsBeforeExport": false }] - ] + "plugins": ["flow", ["decorators", { "decoratorsBeforeExport": false }]] } diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-before-decorators/options.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-before-decorators/options.json index 43ca4a74f89e..1d76e2c51d33 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-before-decorators/options.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-before-decorators/options.json @@ -1,9 +1,5 @@ { "sourceType": "module", - "plugins": [ - "flow", - "classProperties", - ["decorators", { "decoratorsBeforeExport": false }] - ], + "plugins": ["flow", ["decorators", { "decoratorsBeforeExport": false }]], "throws": "Unexpected token (2:10)" } diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/options.json b/packages/babel-parser/test/fixtures/flow/class-properties/options.json index f7dcfe201b63..8e6ec258aec2 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/options.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", - "plugins": ["flow", "classProperties"] + "plugins": ["flow"] } diff --git a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/options.json b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/options.json index 192d7042e2c8..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/options.json +++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow", "classProperties"] + "plugins": ["jsx", "flow"] } diff --git a/packages/babel-parser/test/fixtures/flow/classes/constructor-with-class-prop-plugin/options.json b/packages/babel-parser/test/fixtures/flow/classes/constructor-with-class-prop-plugin/options.json index 3c8f72c90062..698e7668500f 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/constructor-with-class-prop-plugin/options.json +++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-with-class-prop-plugin/options.json @@ -1,3 +1,3 @@ { - "plugins": ["jsx", "flow", "classProperties"] + "plugins": ["jsx", "flow"] } diff --git a/packages/babel-parser/test/fixtures/flow/classes/good_01/options.json b/packages/babel-parser/test/fixtures/flow/classes/good_01/options.json index 65c79d81c796..66dd3748d6ea 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/good_01/options.json +++ b/packages/babel-parser/test/fixtures/flow/classes/good_01/options.json @@ -1,3 +1,3 @@ { - "plugins": ["flow", "classProperties"] + "plugins": ["flow"] } diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json index fb92dc3bde16..5047d6993fe8 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json @@ -1,3 +1,3 @@ { - "plugins": ["typescript", "classProperties"] + "plugins": ["typescript"] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/options.json b/packages/babel-parser/test/fixtures/typescript/class/options.json index fff045d3a491..fe9bffaa5e1a 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/options.json +++ b/packages/babel-parser/test/fixtures/typescript/class/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", - "plugins": ["typescript", "classProperties", "classPrivateProperties"] + "plugins": ["typescript"] } diff --git a/packages/babel-parser/test/fixtures/typescript/declare/module-class/options.json b/packages/babel-parser/test/fixtures/typescript/declare/module-class/options.json index fb92dc3bde16..5047d6993fe8 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/module-class/options.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/module-class/options.json @@ -1,3 +1,3 @@ { - "plugins": ["typescript", "classProperties"] + "plugins": ["typescript"] } diff --git a/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/options.json b/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/options.json index fb92dc3bde16..5047d6993fe8 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/options.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/namespace-class/options.json @@ -1,3 +1,3 @@ { - "plugins": ["typescript", "classProperties"] + "plugins": ["typescript"] } diff --git a/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560/options.json b/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560/options.json index fb92dc3bde16..5047d6993fe8 100644 --- a/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560/options.json +++ b/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560/options.json @@ -1,3 +1,3 @@ { - "plugins": ["typescript", "classProperties"] + "plugins": ["typescript"] } diff --git a/scripts/parser-tests/flow/allowlist.txt b/scripts/parser-tests/flow/allowlist.txt index b2d5b21fdd04..0056daf5f0d0 100644 --- a/scripts/parser-tests/flow/allowlist.txt +++ b/scripts/parser-tests/flow/allowlist.txt @@ -10,6 +10,8 @@ async_await/migrated_0024.js async_await/migrated_0027.js class_expression/anonymous_implements.js class_method_kinds/polymorphic_getter.js +class_properties/migrated_0003.js +class_properties/migrated_0008.js class_properties/migrated_0021.js class_properties/migrated_0026.js decorators/migrated_0003.js diff --git a/scripts/parser-tests/typescript/allowlist.txt b/scripts/parser-tests/typescript/allowlist.txt index 857715df1055..dd8f1b29553a 100644 --- a/scripts/parser-tests/typescript/allowlist.txt +++ b/scripts/parser-tests/typescript/allowlist.txt @@ -71,7 +71,6 @@ classCannotExtendVar.ts classExpressionWithDecorator1.ts classExtendsAcrossFiles.ts classExtendsMultipleBaseClasses.ts -classIndexer5.ts classOverloadForFunction.ts classWithEmptyTypeParameter.ts collisionExportsRequireAndClass.ts @@ -87,7 +86,6 @@ constEnumNoEmitReexport.ts constEnumNoPreserveDeclarationReexport.ts constEnumPreserveEmitReexport.ts contextualOverloadListFromArrayUnion.ts -controlFlowPrivateClassField.ts convertKeywordsYes.ts declarationEmitAmdModuleNameDirective.ts declarationEmitCommonSourceDirectoryDoesNotContainAllFiles.ts @@ -199,7 +197,6 @@ esModuleInterop.ts esModuleInteropImportTSLibHasImport.ts esModuleInteropNamedDefaultImports.ts esModuleInteropTslibHelpers.ts -esNextWeakRefs_IterableWeakMap.ts expandoFunctionContextualTypesNoValue.ts exportAssignClassAndModule.ts exportAssignmentImportMergeNoCrash.ts @@ -250,7 +247,6 @@ importDeclWithClassModifiers.ts importDeclWithDeclareModifierInAmbientContext.ts importHelpers.ts importHelpersAmd.ts -importHelpersES6.ts importHelpersInAmbientContext.ts importHelpersInIsolatedModules.ts importHelpersInTsx.tsx @@ -390,8 +386,6 @@ preserveUnusedImports.ts privacyCheckExternalModuleExportAssignmentOfGenericClass.ts privacyTopLevelAmbientExternalModuleImportWithExport.ts privacyTopLevelAmbientExternalModuleImportWithoutExport.ts -privateFieldAssignabilityFromUnknown.ts -privateNameWeakMapCollision.ts reExportGlobalDeclaration1.ts reExportUndefined1.ts reExportUndefined2.ts From 3c7aeb3c3ed41ce68dc0b9e01f68abb2a6b578c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 23 Apr 2021 09:07:58 +0200 Subject: [PATCH 10/12] Parse string export names by default (`moduleStringNames`) (#13195) * Parse string epxort names by default (`moduleStringNames`) * Remove remaining references --- packages/babel-parser/src/parser/statement.js | 1 - .../module-string-names/default-import/input.js | 0 .../module-string-names/default-import/output.json | 0 .../duplicate-exported-binding-check/input.js | 0 .../duplicate-exported-binding-check/output.json | 0 .../module-string-names/export-from/input.js | 0 .../module-string-names/export-from/output.json | 0 .../export-name-has-lone-surrogate/input.js | 0 .../export-name-has-lone-surrogate/output.json | 0 .../module-string-names/import-local-is-string/input.js | 0 .../module-string-names/import-local-is-string/options.json | 5 +---- .../module-string-names/mixed/input.js | 0 .../module-string-names/mixed/output.json | 0 .../module-string-names/named-export/input.js | 0 .../module-string-names/named-export/output.json | 0 .../module-string-names/named-import/input.js | 0 .../module-string-names/named-import/output.json | 0 .../module-string-names/namespace-export/input.js | 0 .../module-string-names/namespace-export/output.json | 0 .../test/fixtures/es2022/module-string-names/options.json | 3 +++ .../string-exported-binding-without-from/input.js | 0 .../string-exported-binding-without-from/output.json | 0 .../_no-plugin/module-string-names-export/input.js | 2 -- .../_no-plugin/module-string-names-export/options.json | 5 ----- .../_no-plugin/module-string-names-import/input.js | 1 - .../_no-plugin/module-string-names-import/options.json | 5 ----- .../fixtures/experimental/module-string-names/options.json | 4 ---- .../module-string-names/import-local-is-string/options.json | 5 +---- .../test/fixtures/flow/module-string-names/options.json | 2 +- packages/babel-traverse/test/introspection.js | 1 - 30 files changed, 6 insertions(+), 28 deletions(-) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/default-import/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/default-import/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/duplicate-exported-binding-check/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/duplicate-exported-binding-check/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/export-from/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/export-from/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/export-name-has-lone-surrogate/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/export-name-has-lone-surrogate/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/import-local-is-string/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/import-local-is-string/options.json (76%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/mixed/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/mixed/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/named-export/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/named-export/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/named-import/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/named-import/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/namespace-export/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/namespace-export/output.json (100%) create mode 100644 packages/babel-parser/test/fixtures/es2022/module-string-names/options.json rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/string-exported-binding-without-from/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2022}/module-string-names/string-exported-binding-without-from/output.json (100%) delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-export/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-export/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-import/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-import/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/module-string-names/options.json diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 3daf7a22cf00..21f7ea15e05a 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -2089,7 +2089,6 @@ export default class StatementParser extends ExpressionParser { // https://tc39.es/ecma262/#prod-ModuleExportName parseModuleExportName(): N.StringLiteral | N.Identifier { if (this.match(tt.string)) { - this.expectPlugin("moduleStringNames"); const result = this.parseLiteral( this.state.value, "StringLiteral", diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/default-import/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/default-import/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/default-import/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/default-import/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/default-import/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/default-import/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/default-import/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/default-import/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/duplicate-exported-binding-check/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/duplicate-exported-binding-check/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/duplicate-exported-binding-check/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/duplicate-exported-binding-check/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/duplicate-exported-binding-check/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/duplicate-exported-binding-check/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/duplicate-exported-binding-check/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/duplicate-exported-binding-check/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/export-from/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/export-from/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/export-from/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/export-from/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/export-from/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/export-from/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/export-from/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/export-from/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/export-name-has-lone-surrogate/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/export-name-has-lone-surrogate/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/export-name-has-lone-surrogate/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/export-name-has-lone-surrogate/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/export-name-has-lone-surrogate/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/import-local-is-string/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/import-local-is-string/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/import-local-is-string/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/import-local-is-string/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/import-local-is-string/options.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/import-local-is-string/options.json similarity index 76% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/import-local-is-string/options.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/import-local-is-string/options.json index 95aa9af461dc..b50ba9a673de 100644 --- a/packages/babel-parser/test/fixtures/experimental/module-string-names/import-local-is-string/options.json +++ b/packages/babel-parser/test/fixtures/es2022/module-string-names/import-local-is-string/options.json @@ -1,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "moduleStringNames" - ], "throws": "A string literal cannot be used as an imported binding.\n- Did you mean `import { \"foo\" as foo }`? (1:9)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/mixed/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/mixed/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/mixed/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/mixed/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/mixed/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/mixed/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/mixed/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/mixed/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/named-export/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/named-export/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/named-export/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/named-export/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/named-export/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/named-export/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/named-export/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/named-export/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/named-import/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/named-import/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/named-import/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/named-import/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/named-import/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/named-import/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/named-import/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/named-import/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/namespace-export/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/namespace-export/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/namespace-export/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/namespace-export/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/namespace-export/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/namespace-export/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/namespace-export/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/namespace-export/output.json diff --git a/packages/babel-parser/test/fixtures/es2022/module-string-names/options.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/options.json new file mode 100644 index 000000000000..2104ca43283f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2022/module-string-names/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/string-exported-binding-without-from/input.js b/packages/babel-parser/test/fixtures/es2022/module-string-names/string-exported-binding-without-from/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/string-exported-binding-without-from/input.js rename to packages/babel-parser/test/fixtures/es2022/module-string-names/string-exported-binding-without-from/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/string-exported-binding-without-from/output.json b/packages/babel-parser/test/fixtures/es2022/module-string-names/string-exported-binding-without-from/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/module-string-names/string-exported-binding-without-from/output.json rename to packages/babel-parser/test/fixtures/es2022/module-string-names/string-exported-binding-without-from/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-export/input.js b/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-export/input.js deleted file mode 100644 index 0eed97348183..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-export/input.js +++ /dev/null @@ -1,2 +0,0 @@ -export { foo as "some exports" }; -var foo; diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-export/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-export/options.json deleted file mode 100644 index 577ec6148c27..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-export/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'moduleStringNames' (1:16)", - "sourceType": "module", - "plugins": [] -} diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-import/input.js b/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-import/input.js deleted file mode 100644 index 79106029227c..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-import/input.js +++ /dev/null @@ -1 +0,0 @@ -import { "foo" as bar, "default" as qux } from "module-a"; diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-import/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-import/options.json deleted file mode 100644 index e6b9c1ad0636..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/module-string-names-import/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'moduleStringNames' (1:9)", - "sourceType": "module", - "plugins": [] -} diff --git a/packages/babel-parser/test/fixtures/experimental/module-string-names/options.json b/packages/babel-parser/test/fixtures/experimental/module-string-names/options.json deleted file mode 100644 index db7db2aa9480..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/module-string-names/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["moduleStringNames"] -} diff --git a/packages/babel-parser/test/fixtures/flow/module-string-names/import-local-is-string/options.json b/packages/babel-parser/test/fixtures/flow/module-string-names/import-local-is-string/options.json index a7e941c241fe..222ef84882af 100644 --- a/packages/babel-parser/test/fixtures/flow/module-string-names/import-local-is-string/options.json +++ b/packages/babel-parser/test/fixtures/flow/module-string-names/import-local-is-string/options.json @@ -1,8 +1,5 @@ { "sourceType": "module", - "plugins": [ - "moduleStringNames", - "flow" - ], + "plugins": ["flow"], "throws": "A string literal cannot be used as an imported binding.\n- Did you mean `import { \"foo\" as foo }`? (1:9)" } diff --git a/packages/babel-parser/test/fixtures/flow/module-string-names/options.json b/packages/babel-parser/test/fixtures/flow/module-string-names/options.json index bd72c92b9d9b..8e6ec258aec2 100644 --- a/packages/babel-parser/test/fixtures/flow/module-string-names/options.json +++ b/packages/babel-parser/test/fixtures/flow/module-string-names/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", - "plugins": ["flow", "moduleStringNames"] + "plugins": ["flow"] } diff --git a/packages/babel-traverse/test/introspection.js b/packages/babel-traverse/test/introspection.js index 980a88256609..bdebcf519a32 100644 --- a/packages/babel-traverse/test/introspection.js +++ b/packages/babel-traverse/test/introspection.js @@ -176,7 +176,6 @@ describe("path/introspection", function () { it('rejects the "export called *" trick', function () { const program = getPath(`import * as ns from "source"; ns["*"].nested;`, { sourceType: "module", - plugins: ["moduleStringNames"], }); const reference = program.get("body.1.expression"); expect(reference.referencesImport("source", "nested")).toBe(false); From d6e75354ef821bd0b8cb45e71326887942378a47 Mon Sep 17 00:00:00 2001 From: George Zahariev Date: Tue, 27 Apr 2021 10:27:48 -0700 Subject: [PATCH 11/12] Support parsing Flow's Optional Indexed Access Types (#13224) --- .../babel-generator/src/generators/flow.ts | 13 ++ .../babel-generator/src/node/parentheses.ts | 4 + .../optional-indexed-access-types/input.js | 9 + .../optional-indexed-access-types/output.js | 5 + .../babel-parser/src/plugins/flow/index.js | 33 ++- packages/babel-parser/src/types.js | 7 + .../indexed-access-types/{1 => base}/input.js | 0 .../{1 => base}/output.json | 0 .../indexed-access-types/optional/input.js | 7 + .../indexed-access-types/optional/output.json | 190 ++++++++++++++++++ .../src/path/generated/asserts.ts | 3 + .../src/path/generated/validators.ts | 3 + .../src/asserts/generated/index.ts | 6 + .../src/ast-types/generated/index.ts | 16 +- .../src/builders/generated/index.ts | 6 + .../src/builders/generated/uppercase.js | 1 + packages/babel-types/src/definitions/flow.ts | 11 + .../src/validators/generated/index.ts | 25 ++- 18 files changed, 327 insertions(+), 12 deletions(-) create mode 100644 packages/babel-generator/test/fixtures/flow/optional-indexed-access-types/input.js create mode 100644 packages/babel-generator/test/fixtures/flow/optional-indexed-access-types/output.js rename packages/babel-parser/test/fixtures/flow/indexed-access-types/{1 => base}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/indexed-access-types/{1 => base}/output.json (100%) create mode 100644 packages/babel-parser/test/fixtures/flow/indexed-access-types/optional/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/indexed-access-types/optional/output.json diff --git a/packages/babel-generator/src/generators/flow.ts b/packages/babel-generator/src/generators/flow.ts index b4373bffe3fe..3668d07c0c27 100644 --- a/packages/babel-generator/src/generators/flow.ts +++ b/packages/babel-generator/src/generators/flow.ts @@ -745,3 +745,16 @@ export function IndexedAccessType(this: Printer, node: t.IndexedAccessType) { this.print(node.indexType, node); this.token("]"); } + +export function OptionalIndexedAccessType( + this: Printer, + node: t.OptionalIndexedAccessType, +) { + this.print(node.objectType, node); + if (node.optional) { + this.token("?."); + } + this.token("["); + this.print(node.indexType, node); + this.token("]"); +} diff --git a/packages/babel-generator/src/node/parentheses.ts b/packages/babel-generator/src/node/parentheses.ts index 867419aa467d..3f7019a82e3d 100644 --- a/packages/babel-generator/src/node/parentheses.ts +++ b/packages/babel-generator/src/node/parentheses.ts @@ -135,6 +135,10 @@ export function UnionTypeAnnotation(node: any, parent: any): boolean { export { UnionTypeAnnotation as IntersectionTypeAnnotation }; +export function OptionalIndexedAccessType(node: any, parent: any): boolean { + return t.isIndexedAccessType(parent, { objectType: node }); +} + export function TSAsExpression() { return true; } diff --git a/packages/babel-generator/test/fixtures/flow/optional-indexed-access-types/input.js b/packages/babel-generator/test/fixtures/flow/optional-indexed-access-types/input.js new file mode 100644 index 000000000000..797020e7b1de --- /dev/null +++ b/packages/babel-generator/test/fixtures/flow/optional-indexed-access-types/input.js @@ -0,0 +1,9 @@ +type A = Obj?.['a']; + +type B = Array?.[number]; + +type C = Obj?.['bar']['baz']; + +type D = (Obj?.['bar'])['baz']; + +type E = Obj?.['bar'][]; diff --git a/packages/babel-generator/test/fixtures/flow/optional-indexed-access-types/output.js b/packages/babel-generator/test/fixtures/flow/optional-indexed-access-types/output.js new file mode 100644 index 000000000000..19cfff300aa8 --- /dev/null +++ b/packages/babel-generator/test/fixtures/flow/optional-indexed-access-types/output.js @@ -0,0 +1,5 @@ +type A = Obj?.['a']; +type B = Array?.[number]; +type C = Obj?.['bar']['baz']; +type D = (Obj?.['bar'])['baz']; +type E = Obj?.['bar'][]; diff --git a/packages/babel-parser/src/plugins/flow/index.js b/packages/babel-parser/src/plugins/flow/index.js index 256590452db2..a237acffa5bb 100644 --- a/packages/babel-parser/src/plugins/flow/index.js +++ b/packages/babel-parser/src/plugins/flow/index.js @@ -1619,13 +1619,19 @@ export default (superClass: Class): Class => } flowParsePostfixType(): N.FlowTypeAnnotation { - const startPos = this.state.start, - startLoc = this.state.startLoc; + const startPos = this.state.start; + const startLoc = this.state.startLoc; let type = this.flowParsePrimaryType(); - while (this.match(tt.bracketL) && !this.canInsertSemicolon()) { + let seenOptionalIndexedAccess = false; + while ( + (this.match(tt.bracketL) || this.match(tt.questionDot)) && + !this.canInsertSemicolon() + ) { const node = this.startNodeAt(startPos, startLoc); + const optional = this.eat(tt.questionDot); + seenOptionalIndexedAccess = seenOptionalIndexedAccess || optional; this.expect(tt.bracketL); - if (this.match(tt.bracketR)) { + if (!optional && this.match(tt.bracketR)) { node.elementType = type; this.next(); // eat `]` type = this.finishNode(node, "ArrayTypeAnnotation"); @@ -1633,10 +1639,18 @@ export default (superClass: Class): Class => node.objectType = type; node.indexType = this.flowParseType(); this.expect(tt.bracketR); - type = this.finishNode( - node, - "IndexedAccessType", - ); + if (seenOptionalIndexedAccess) { + node.optional = optional; + type = this.finishNode( + node, + "OptionalIndexedAccessType", + ); + } else { + type = this.finishNode( + node, + "IndexedAccessType", + ); + } } } return type; @@ -2216,6 +2230,9 @@ export default (superClass: Class): Class => ) { return this.finishOp(tt.relational, 1); } else if (this.state.inType && code === charCodes.questionMark) { + if (next === charCodes.dot) { + return this.finishOp(tt.questionDot, 2); + } // allow double nullable types in Flow: ??string return this.finishOp(tt.question, 1); } else if (isIteratorStart(code, next)) { diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index c0c996389981..fa716fd62ff2 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -1058,6 +1058,13 @@ export type FlowIndexedAccessType = Node & { indexType: FlowType, }; +export type FlowOptionalIndexedAccessType = Node & { + type: "OptionalIndexedAccessType", + objectType: FlowType, + indexType: FlowType, + optional: boolean, +}; + // ESTree export type EstreeProperty = NodeBase & { diff --git a/packages/babel-parser/test/fixtures/flow/indexed-access-types/1/input.js b/packages/babel-parser/test/fixtures/flow/indexed-access-types/base/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/indexed-access-types/1/input.js rename to packages/babel-parser/test/fixtures/flow/indexed-access-types/base/input.js diff --git a/packages/babel-parser/test/fixtures/flow/indexed-access-types/1/output.json b/packages/babel-parser/test/fixtures/flow/indexed-access-types/base/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/flow/indexed-access-types/1/output.json rename to packages/babel-parser/test/fixtures/flow/indexed-access-types/base/output.json diff --git a/packages/babel-parser/test/fixtures/flow/indexed-access-types/optional/input.js b/packages/babel-parser/test/fixtures/flow/indexed-access-types/optional/input.js new file mode 100644 index 000000000000..f184ba3b1982 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/indexed-access-types/optional/input.js @@ -0,0 +1,7 @@ +type A = Obj?.['a']; + +type B = Obj['a']?.['b']; + +type C = Obj?.['a']['b']; + +type D = Obj?.['a']?.['b']; diff --git a/packages/babel-parser/test/fixtures/flow/indexed-access-types/optional/output.json b/packages/babel-parser/test/fixtures/flow/indexed-access-types/optional/output.json new file mode 100644 index 000000000000..1ae1dfa76178 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/indexed-access-types/optional/output.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":27}}, + "program": { + "type": "Program", + "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":27}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":20}}, + "id": { + "type": "Identifier", + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "OptionalIndexedAccessType", + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"Obj"}, + "name": "Obj" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + }, + "optional": true + } + }, + { + "type": "TypeAlias", + "start":22,"end":47,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":25}}, + "id": { + "type": "Identifier", + "start":27,"end":28,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"B"}, + "name": "B" + }, + "typeParameters": null, + "right": { + "type": "OptionalIndexedAccessType", + "start":31,"end":46,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":24}}, + "objectType": { + "type": "IndexedAccessType", + "start":31,"end":39,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":17}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":31,"end":34,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":12}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":31,"end":34,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":12},"identifierName":"Obj"}, + "name": "Obj" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":35,"end":38,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":16}}, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":42,"end":45,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":23}}, + "extra": { + "rawValue": "b", + "raw": "'b'" + }, + "value": "b" + }, + "optional": true + } + }, + { + "type": "TypeAlias", + "start":49,"end":74,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":25}}, + "id": { + "type": "Identifier", + "start":54,"end":55,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6},"identifierName":"C"}, + "name": "C" + }, + "typeParameters": null, + "right": { + "type": "OptionalIndexedAccessType", + "start":58,"end":73,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":24}}, + "objectType": { + "type": "OptionalIndexedAccessType", + "start":58,"end":68,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":19}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":58,"end":61,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":12}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":58,"end":61,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":12},"identifierName":"Obj"}, + "name": "Obj" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":64,"end":67,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":18}}, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + }, + "optional": true + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":69,"end":72,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":23}}, + "extra": { + "rawValue": "b", + "raw": "'b'" + }, + "value": "b" + }, + "optional": false + } + }, + { + "type": "TypeAlias", + "start":76,"end":103,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":27}}, + "id": { + "type": "Identifier", + "start":81,"end":82,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":6},"identifierName":"D"}, + "name": "D" + }, + "typeParameters": null, + "right": { + "type": "OptionalIndexedAccessType", + "start":85,"end":102,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":26}}, + "objectType": { + "type": "OptionalIndexedAccessType", + "start":85,"end":95,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":19}}, + "objectType": { + "type": "GenericTypeAnnotation", + "start":85,"end":88,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":12}}, + "typeParameters": null, + "id": { + "type": "Identifier", + "start":85,"end":88,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":12},"identifierName":"Obj"}, + "name": "Obj" + } + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":91,"end":94,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":18}}, + "extra": { + "rawValue": "a", + "raw": "'a'" + }, + "value": "a" + }, + "optional": true + }, + "indexType": { + "type": "StringLiteralTypeAnnotation", + "start":98,"end":101,"loc":{"start":{"line":7,"column":22},"end":{"line":7,"column":25}}, + "extra": { + "rawValue": "b", + "raw": "'b'" + }, + "value": "b" + }, + "optional": true + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-traverse/src/path/generated/asserts.ts b/packages/babel-traverse/src/path/generated/asserts.ts index ac9c5bd4895e..bd66907898ad 100755 --- a/packages/babel-traverse/src/path/generated/asserts.ts +++ b/packages/babel-traverse/src/path/generated/asserts.ts @@ -390,6 +390,9 @@ export interface NodePathAssetions { assertOptionalCallExpression( opts?: object, ): asserts this is NodePath; + assertOptionalIndexedAccessType( + opts?: object, + ): asserts this is NodePath; assertOptionalMemberExpression( opts?: object, ): asserts this is NodePath; diff --git a/packages/babel-traverse/src/path/generated/validators.ts b/packages/babel-traverse/src/path/generated/validators.ts index 271f5e5595fa..75c8badee01a 100755 --- a/packages/babel-traverse/src/path/generated/validators.ts +++ b/packages/babel-traverse/src/path/generated/validators.ts @@ -234,6 +234,9 @@ export interface NodePathValidators { isOptionalCallExpression( opts?: object, ): this is NodePath; + isOptionalIndexedAccessType( + opts?: object, + ): this is NodePath; isOptionalMemberExpression( opts?: object, ): this is NodePath; diff --git a/packages/babel-types/src/asserts/generated/index.ts b/packages/babel-types/src/asserts/generated/index.ts index ea97792a1e1c..82a09be6b0eb 100755 --- a/packages/babel-types/src/asserts/generated/index.ts +++ b/packages/babel-types/src/asserts/generated/index.ts @@ -884,6 +884,12 @@ export function assertIndexedAccessType( ): asserts node is t.IndexedAccessType { assert("IndexedAccessType", node, opts); } +export function assertOptionalIndexedAccessType( + node: object | null | undefined, + opts?: object | null, +): asserts node is t.OptionalIndexedAccessType { + assert("OptionalIndexedAccessType", node, opts); +} export function assertJSXAttribute( node: object | null | undefined, opts?: object | null, diff --git a/packages/babel-types/src/ast-types/generated/index.ts b/packages/babel-types/src/ast-types/generated/index.ts index a5f105c87cda..3476f1c2a097 100755 --- a/packages/babel-types/src/ast-types/generated/index.ts +++ b/packages/babel-types/src/ast-types/generated/index.ts @@ -208,6 +208,7 @@ export type Node = | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression + | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | Pattern @@ -1395,6 +1396,13 @@ export interface IndexedAccessType extends BaseNode { indexType: FlowType; } +export interface OptionalIndexedAccessType extends BaseNode { + type: "OptionalIndexedAccessType"; + objectType: FlowType; + indexType: FlowType; + optional: boolean; +} + export interface JSXAttribute extends BaseNode { type: "JSXAttribute"; name: JSXIdentifier | JSXNamespacedName; @@ -2361,7 +2369,9 @@ export type Flow = | TypeParameterInstantiation | UnionTypeAnnotation | Variance - | VoidTypeAnnotation; + | VoidTypeAnnotation + | IndexedAccessType + | OptionalIndexedAccessType; export type FlowType = | AnyTypeAnnotation | ArrayTypeAnnotation @@ -2386,7 +2396,9 @@ export type FlowType = | TupleTypeAnnotation | TypeofTypeAnnotation | UnionTypeAnnotation - | VoidTypeAnnotation; + | VoidTypeAnnotation + | IndexedAccessType + | OptionalIndexedAccessType; export type FlowBaseAnnotation = | AnyTypeAnnotation | BooleanTypeAnnotation diff --git a/packages/babel-types/src/builders/generated/index.ts b/packages/babel-types/src/builders/generated/index.ts index a0adb832b1cc..68c33b7205ab 100755 --- a/packages/babel-types/src/builders/generated/index.ts +++ b/packages/babel-types/src/builders/generated/index.ts @@ -860,6 +860,12 @@ export function indexedAccessType( ): t.IndexedAccessType { return builder("IndexedAccessType", ...arguments); } +export function optionalIndexedAccessType( + objectType: t.FlowType, + indexType: t.FlowType, +): t.OptionalIndexedAccessType { + return builder("OptionalIndexedAccessType", ...arguments); +} export function jsxAttribute( name: t.JSXIdentifier | t.JSXNamespacedName, value?: diff --git a/packages/babel-types/src/builders/generated/uppercase.js b/packages/babel-types/src/builders/generated/uppercase.js index 464b86423ce3..11ac2fb74514 100755 --- a/packages/babel-types/src/builders/generated/uppercase.js +++ b/packages/babel-types/src/builders/generated/uppercase.js @@ -154,6 +154,7 @@ export { enumStringMember as EnumStringMember, enumDefaultedMember as EnumDefaultedMember, indexedAccessType as IndexedAccessType, + optionalIndexedAccessType as OptionalIndexedAccessType, jsxAttribute as JSXAttribute, jsxClosingElement as JSXClosingElement, jsxElement as JSXElement, diff --git a/packages/babel-types/src/definitions/flow.ts b/packages/babel-types/src/definitions/flow.ts index 91ce3405a811..4c73176ef0fa 100644 --- a/packages/babel-types/src/definitions/flow.ts +++ b/packages/babel-types/src/definitions/flow.ts @@ -562,8 +562,19 @@ defineType("EnumDefaultedMember", { defineType("IndexedAccessType", { visitor: ["objectType", "indexType"], + aliases: ["Flow", "FlowType"], + fields: { + objectType: validateType("FlowType"), + indexType: validateType("FlowType"), + }, +}); + +defineType("OptionalIndexedAccessType", { + visitor: ["objectType", "indexType"], + aliases: ["Flow", "FlowType"], fields: { objectType: validateType("FlowType"), indexType: validateType("FlowType"), + optional: validate(assertValueType("boolean")), }, }); diff --git a/packages/babel-types/src/validators/generated/index.ts b/packages/babel-types/src/validators/generated/index.ts index e86131e2182b..00a7f76c43fa 100755 --- a/packages/babel-types/src/validators/generated/index.ts +++ b/packages/babel-types/src/validators/generated/index.ts @@ -2470,6 +2470,23 @@ export function isIndexedAccessType( return false; } +export function isOptionalIndexedAccessType( + node: object | null | undefined, + opts?: object | null, +): node is t.OptionalIndexedAccessType { + if (!node) return false; + + const nodeType = (node as t.Node).type; + if (nodeType === "OptionalIndexedAccessType") { + if (typeof opts === "undefined") { + return true; + } else { + return shallowEqual(node, opts); + } + } + + return false; +} export function isJSXAttribute( node: object | null | undefined, opts?: object | null, @@ -5101,7 +5118,9 @@ export function isFlow( "TypeParameterInstantiation" === nodeType || "UnionTypeAnnotation" === nodeType || "Variance" === nodeType || - "VoidTypeAnnotation" === nodeType + "VoidTypeAnnotation" === nodeType || + "IndexedAccessType" === nodeType || + "OptionalIndexedAccessType" === nodeType ) { if (typeof opts === "undefined") { return true; @@ -5143,7 +5162,9 @@ export function isFlowType( "TupleTypeAnnotation" === nodeType || "TypeofTypeAnnotation" === nodeType || "UnionTypeAnnotation" === nodeType || - "VoidTypeAnnotation" === nodeType + "VoidTypeAnnotation" === nodeType || + "IndexedAccessType" === nodeType || + "OptionalIndexedAccessType" === nodeType ) { if (typeof opts === "undefined") { return true; From 52a59b1ac9359c2fd85ae0df37f15e7f636d6061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 27 Apr 2021 22:51:15 +0200 Subject: [PATCH 12/12] [ts] Enforce order for the `override` modifier (#13209) * [ts] Enforce order for the `override` modifier * generator * Add more checks * Update TS tests --- Makefile | 2 +- .../src/generators/typescript.ts | 8 +- .../class-modifier-override/input.js | 4 +- .../class-modifier-override/output.js | 9 +- .../src/plugins/typescript/index.js | 73 ++- .../class/modifiers-incompatible/input.ts | 7 + .../class/modifiers-incompatible/output.json | 118 +++++ .../class/modifiers-invalid-order/input.ts | 28 ++ .../class/modifiers-invalid-order/output.json | 437 ++++++++++++++++++ .../class/modifiers-override-errors/input.ts | 7 - .../modifiers-override-errors/output.json | 135 +----- .../class/modifiers-override/input.ts | 2 - .../class/modifiers-override/output.json | 114 ++--- scripts/parser-tests/typescript/allowlist.txt | 4 +- 14 files changed, 682 insertions(+), 266 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/output.json diff --git a/Makefile b/Makefile index 74e37474c9cf..737874b67097 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ FLOW_COMMIT = a1f9a4c709dcebb27a5084acf47755fbae699c25 TEST262_COMMIT = eca69e2c95972a4c5780ef58fe1f1e53e871b9b1 -TYPESCRIPT_COMMIT = dd1ef88d016dc40a145eafc0a1169e7f0a4a9ebe +TYPESCRIPT_COMMIT = 3de706a8525c2ded782fc032fa4afe2e485100d3 # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true diff --git a/packages/babel-generator/src/generators/typescript.ts b/packages/babel-generator/src/generators/typescript.ts index 742cefa1dfaa..5b2c572d6971 100644 --- a/packages/babel-generator/src/generators/typescript.ts +++ b/packages/babel-generator/src/generators/typescript.ts @@ -649,10 +649,6 @@ export function tsPrintClassMemberModifiers(this: Printer, node: any, isField) { this.word("declare"); this.space(); } - if (node.override) { - this.word("override"); - this.space(); - } if (node.accessibility) { this.word(node.accessibility); this.space(); @@ -661,6 +657,10 @@ export function tsPrintClassMemberModifiers(this: Printer, node: any, isField) { this.word("static"); this.space(); } + if (node.override) { + this.word("override"); + this.space(); + } if (node.abstract) { this.word("abstract"); this.space(); diff --git a/packages/babel-generator/test/fixtures/typescript/class-modifier-override/input.js b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/input.js index d70119f8f51d..0d39fc58c990 100644 --- a/packages/babel-generator/test/fixtures/typescript/class-modifier-override/input.js +++ b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/input.js @@ -1,8 +1,6 @@ class MyClass extends BaseClass { override show() {} - override public show() {} public override show() {} override size = 5; - override readonly size = 5; - readonly override size = 5; + public static override readonly size = 5; } diff --git a/packages/babel-generator/test/fixtures/typescript/class-modifier-override/output.js b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/output.js index 2be71cd1f582..305f5ebb5f93 100644 --- a/packages/babel-generator/test/fixtures/typescript/class-modifier-override/output.js +++ b/packages/babel-generator/test/fixtures/typescript/class-modifier-override/output.js @@ -1,11 +1,8 @@ class MyClass extends BaseClass { override show() {} - override public show() {} - - override public show() {} + public override show() {} override size = 5; - override readonly size = 5; - override readonly size = 5; -} + public static override readonly size = 5; +} \ No newline at end of file diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index d888f8b1ceb3..6a0756107d8f 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -253,6 +253,20 @@ export default (superClass: Class): Class => disallowedModifiers?: TsModifier[], errorTemplate?: ErrorTemplate, ): void { + const enforceOrder = (pos, modifier, before, after) => { + if (modifier === before && modified[after]) { + this.raise(pos, TSErrors.InvalidModifiersOrder, before, after); + } + }; + const incompatible = (pos, modifier, mod1, mod2) => { + if ( + (modified[mod1] && modifier === mod2) || + (modified[mod2] && modifier === mod1) + ) { + this.raise(pos, TSErrors.IncompatibleModifiers, mod1, mod2); + } + }; + for (;;) { const startPos = this.state.start; const modifier: ?TsModifier = this.tsParseModifier( @@ -265,28 +279,22 @@ export default (superClass: Class): Class => if (modified.accessibility) { this.raise(startPos, TSErrors.DuplicateAccessibilityModifier); } else { + enforceOrder(startPos, modifier, modifier, "override"); + enforceOrder(startPos, modifier, modifier, "static"); + modified.accessibility = modifier; } } else { if (Object.hasOwnProperty.call(modified, modifier)) { this.raise(startPos, TSErrors.DuplicateModifier, modifier); - } else if (modified.readonly && modifier === "static") { - this.raise( - startPos, - TSErrors.InvalidModifiersOrder, - "static", - "readonly", - ); - } else if ( - (modified.declare && modifier === "override") || - (modified.override && modifier === "declare") - ) { - this.raise( - startPos, - TSErrors.IncompatibleModifiers, - "declare", - "override", - ); + } else { + enforceOrder(startPos, modifier, "static", "readonly"); + enforceOrder(startPos, modifier, "static", "override"); + enforceOrder(startPos, modifier, "override", "readonly"); + enforceOrder(startPos, modifier, "abstract", "override"); + + incompatible(startPos, modifier, "declare", "override"); + incompatible(startPos, modifier, "static", "abstract"); } modified[modifier] = true; } @@ -2320,10 +2328,18 @@ export default (superClass: Class): Class => "public", "protected", "override", + "static", + "abstract", + "readonly", ]); const callParseClassMember = () => { - super.parseClassMember(classBody, member, state); + this.parseClassMemberWithIsStatic( + classBody, + member, + state, + !!member.static, + ); }; if (member.declare) { this.tsInDeclareContext(callParseClassMember); @@ -2338,18 +2354,6 @@ export default (superClass: Class): Class => state: N.ParseClassMemberState, isStatic: boolean, ): void { - this.tsParseModifiers(member, [ - "abstract", - "readonly", - "declare", - "static", - "override", - ]); - - if (isStatic) { - member.static = true; - } - const idx = this.tsTryParseIndexSignature(member); if (idx) { classBody.body.push(idx); @@ -2379,14 +2383,7 @@ export default (superClass: Class): Class => } if ((member: any).override) { - if (isStatic) { - this.raise( - member.start, - TSErrors.IncompatibleModifiers, - "static", - "override", - ); - } else if (!state.hadSuperClass) { + if (!state.hadSuperClass) { this.raise(member.start, TSErrors.OverrideNotInSubClass); } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/input.ts b/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/input.ts new file mode 100644 index 000000000000..256313f8368f --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/input.ts @@ -0,0 +1,7 @@ +abstract class A extends Base { + static abstract m1(); + abstract static m1(); + + declare override prop1: any; + override declare prop2: any; +} diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/output.json new file mode 100644 index 000000000000..a0ffbf7b019e --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-incompatible/output.json @@ -0,0 +1,118 @@ +{ + "type": "File", + "start":0,"end":144,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "errors": [ + "SyntaxError: 'static' modifier cannot be used with 'abstract' modifier. (2:9)", + "SyntaxError: 'static' modifier cannot be used with 'abstract' modifier. (3:11)", + "SyntaxError: 'declare' modifier cannot be used with 'override' modifier. (5:10)", + "SyntaxError: 'declare' modifier cannot be used with 'override' modifier. (6:11)" + ], + "program": { + "type": "Program", + "start":0,"end":144,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":144,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "abstract": true, + "id": { + "type": "Identifier", + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29},"identifierName":"Base"}, + "name": "Base" + }, + "body": { + "type": "ClassBody", + "start":30,"end":144,"loc":{"start":{"line":1,"column":30},"end":{"line":7,"column":1}}, + "body": [ + { + "type": "TSDeclareMethod", + "start":34,"end":55,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, + "static": true, + "abstract": true, + "key": { + "type": "Identifier", + "start":50,"end":52,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20},"identifierName":"m1"}, + "name": "m1" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [] + }, + { + "type": "TSDeclareMethod", + "start":58,"end":79,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":23}}, + "abstract": true, + "static": true, + "key": { + "type": "Identifier", + "start":74,"end":76,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20},"identifierName":"m1"}, + "name": "m1" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [] + }, + { + "type": "ClassProperty", + "start":83,"end":111,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":30}}, + "declare": true, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":100,"end":105,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":24},"identifierName":"prop1"}, + "name": "prop1" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":105,"end":110,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":29}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":107,"end":110,"loc":{"start":{"line":5,"column":26},"end":{"line":5,"column":29}} + } + }, + "value": null + }, + { + "type": "ClassProperty", + "start":114,"end":142,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":30}}, + "override": true, + "declare": true, + "static": false, + "key": { + "type": "Identifier", + "start":131,"end":136,"loc":{"start":{"line":6,"column":19},"end":{"line":6,"column":24},"identifierName":"prop2"}, + "name": "prop2" + }, + "computed": false, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start":136,"end":141,"loc":{"start":{"line":6,"column":24},"end":{"line":6,"column":29}}, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start":138,"end":141,"loc":{"start":{"line":6,"column":26},"end":{"line":6,"column":29}} + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/input.ts b/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/input.ts new file mode 100644 index 000000000000..87368f121bf7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/input.ts @@ -0,0 +1,28 @@ +abstract class A extends B { + static override m1() {} + override static m2() {} + + override readonly p4; + readonly override p3; + + public override m5() {} + override public m6() {} + + protected override m7() {} + override protected m8() {} + + private override m9() {} + override private m10() {} + + abstract override m12(); + override abstract m11(); + + public static m14() {} + static public m13() {} + + protected static m16() {} + static protected m15() {} + + private static m18() {} + static private m17() {} +} diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/output.json new file mode 100644 index 000000000000..858e2bba559b --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-invalid-order/output.json @@ -0,0 +1,437 @@ +{ + "type": "File", + "start":0,"end":515,"loc":{"start":{"line":1,"column":0},"end":{"line":28,"column":1}}, + "errors": [ + "SyntaxError: 'static' modifier must precede 'override' modifier. (3:11)", + "SyntaxError: 'override' modifier must precede 'readonly' modifier. (6:11)", + "SyntaxError: 'public' modifier must precede 'override' modifier. (9:11)", + "SyntaxError: 'protected' modifier must precede 'override' modifier. (12:11)", + "SyntaxError: 'private' modifier must precede 'override' modifier. (15:11)", + "SyntaxError: 'abstract' modifier must precede 'override' modifier. (18:11)", + "SyntaxError: 'public' modifier must precede 'static' modifier. (21:9)", + "SyntaxError: 'protected' modifier must precede 'static' modifier. (24:9)", + "SyntaxError: 'private' modifier must precede 'static' modifier. (27:9)" + ], + "program": { + "type": "Program", + "start":0,"end":515,"loc":{"start":{"line":1,"column":0},"end":{"line":28,"column":1}}, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start":0,"end":515,"loc":{"start":{"line":1,"column":0},"end":{"line":28,"column":1}}, + "abstract": true, + "id": { + "type": "Identifier", + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"B"}, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start":27,"end":515,"loc":{"start":{"line":1,"column":27},"end":{"line":28,"column":1}}, + "body": [ + { + "type": "ClassMethod", + "start":31,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":25}}, + "static": true, + "override": true, + "key": { + "type": "Identifier", + "start":47,"end":49,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20},"identifierName":"m1"}, + "name": "m1" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":52,"end":54,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":57,"end":80,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":25}}, + "override": true, + "static": true, + "key": { + "type": "Identifier", + "start":73,"end":75,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20},"identifierName":"m2"}, + "name": "m2" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":78,"end":80,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":25}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassProperty", + "start":84,"end":105,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":23}}, + "override": true, + "readonly": true, + "static": false, + "key": { + "type": "Identifier", + "start":102,"end":104,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":22},"identifierName":"p4"}, + "name": "p4" + }, + "computed": false, + "value": null + }, + { + "type": "ClassProperty", + "start":108,"end":129,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":23}}, + "readonly": true, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":126,"end":128,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":22},"identifierName":"p3"}, + "name": "p3" + }, + "computed": false, + "value": null + }, + { + "type": "ClassMethod", + "start":133,"end":156,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":25}}, + "accessibility": "public", + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":149,"end":151,"loc":{"start":{"line":8,"column":18},"end":{"line":8,"column":20},"identifierName":"m5"}, + "name": "m5" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":154,"end":156,"loc":{"start":{"line":8,"column":23},"end":{"line":8,"column":25}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":159,"end":182,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":25}}, + "override": true, + "accessibility": "public", + "static": false, + "key": { + "type": "Identifier", + "start":175,"end":177,"loc":{"start":{"line":9,"column":18},"end":{"line":9,"column":20},"identifierName":"m6"}, + "name": "m6" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":180,"end":182,"loc":{"start":{"line":9,"column":23},"end":{"line":9,"column":25}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":186,"end":212,"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":28}}, + "accessibility": "protected", + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":205,"end":207,"loc":{"start":{"line":11,"column":21},"end":{"line":11,"column":23},"identifierName":"m7"}, + "name": "m7" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":210,"end":212,"loc":{"start":{"line":11,"column":26},"end":{"line":11,"column":28}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":215,"end":241,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":28}}, + "override": true, + "accessibility": "protected", + "static": false, + "key": { + "type": "Identifier", + "start":234,"end":236,"loc":{"start":{"line":12,"column":21},"end":{"line":12,"column":23},"identifierName":"m8"}, + "name": "m8" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":239,"end":241,"loc":{"start":{"line":12,"column":26},"end":{"line":12,"column":28}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":245,"end":269,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":26}}, + "accessibility": "private", + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":262,"end":264,"loc":{"start":{"line":14,"column":19},"end":{"line":14,"column":21},"identifierName":"m9"}, + "name": "m9" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":267,"end":269,"loc":{"start":{"line":14,"column":24},"end":{"line":14,"column":26}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":272,"end":297,"loc":{"start":{"line":15,"column":2},"end":{"line":15,"column":27}}, + "override": true, + "accessibility": "private", + "static": false, + "key": { + "type": "Identifier", + "start":289,"end":292,"loc":{"start":{"line":15,"column":19},"end":{"line":15,"column":22},"identifierName":"m10"}, + "name": "m10" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":295,"end":297,"loc":{"start":{"line":15,"column":25},"end":{"line":15,"column":27}}, + "body": [], + "directives": [] + } + }, + { + "type": "TSDeclareMethod", + "start":301,"end":325,"loc":{"start":{"line":17,"column":2},"end":{"line":17,"column":26}}, + "abstract": true, + "override": true, + "static": false, + "key": { + "type": "Identifier", + "start":319,"end":322,"loc":{"start":{"line":17,"column":20},"end":{"line":17,"column":23},"identifierName":"m12"}, + "name": "m12" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [] + }, + { + "type": "TSDeclareMethod", + "start":328,"end":352,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":26}}, + "override": true, + "abstract": true, + "static": false, + "key": { + "type": "Identifier", + "start":346,"end":349,"loc":{"start":{"line":18,"column":20},"end":{"line":18,"column":23},"identifierName":"m11"}, + "name": "m11" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [] + }, + { + "type": "ClassMethod", + "start":356,"end":378,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":24}}, + "accessibility": "public", + "static": true, + "key": { + "type": "Identifier", + "start":370,"end":373,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":19},"identifierName":"m14"}, + "name": "m14" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":376,"end":378,"loc":{"start":{"line":20,"column":22},"end":{"line":20,"column":24}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":381,"end":403,"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":24}}, + "static": true, + "accessibility": "public", + "key": { + "type": "Identifier", + "start":395,"end":398,"loc":{"start":{"line":21,"column":16},"end":{"line":21,"column":19},"identifierName":"m13"}, + "name": "m13" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":401,"end":403,"loc":{"start":{"line":21,"column":22},"end":{"line":21,"column":24}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":407,"end":432,"loc":{"start":{"line":23,"column":2},"end":{"line":23,"column":27}}, + "accessibility": "protected", + "static": true, + "key": { + "type": "Identifier", + "start":424,"end":427,"loc":{"start":{"line":23,"column":19},"end":{"line":23,"column":22},"identifierName":"m16"}, + "name": "m16" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":430,"end":432,"loc":{"start":{"line":23,"column":25},"end":{"line":23,"column":27}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":435,"end":460,"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":27}}, + "static": true, + "accessibility": "protected", + "key": { + "type": "Identifier", + "start":452,"end":455,"loc":{"start":{"line":24,"column":19},"end":{"line":24,"column":22},"identifierName":"m15"}, + "name": "m15" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":458,"end":460,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":27}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":464,"end":487,"loc":{"start":{"line":26,"column":2},"end":{"line":26,"column":25}}, + "accessibility": "private", + "static": true, + "key": { + "type": "Identifier", + "start":479,"end":482,"loc":{"start":{"line":26,"column":17},"end":{"line":26,"column":20},"identifierName":"m18"}, + "name": "m18" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":485,"end":487,"loc":{"start":{"line":26,"column":23},"end":{"line":26,"column":25}}, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start":490,"end":513,"loc":{"start":{"line":27,"column":2},"end":{"line":27,"column":25}}, + "static": true, + "accessibility": "private", + "key": { + "type": "Identifier", + "start":505,"end":508,"loc":{"start":{"line":27,"column":17},"end":{"line":27,"column":20},"identifierName":"m17"}, + "name": "m17" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start":511,"end":513,"loc":{"start":{"line":27,"column":23},"end":{"line":27,"column":25}}, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/input.ts b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/input.ts index 346b74aaf281..b7520b92e311 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/input.ts @@ -1,13 +1,6 @@ class MyClass2 extends BaseClass { override constructor() {} override [x: string]: any; - override static size = 5; - static override size = 5; -} - -declare class MyClass3 extends BaseClass { - declare override prop1: any - override declare prop2: any } class MyClass4 { diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json index 85c86638186c..a0182a9984d9 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override-errors/output.json @@ -1,24 +1,20 @@ { "type": "File", - "start":0,"end":296,"loc":{"start":{"line":1,"column":0},"end":{"line":15,"column":1}}, + "start":0,"end":134,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "errors": [ "SyntaxError: 'override' modifier cannot appear on a constructor declaration. (2:11)", "SyntaxError: 'override' modifier cannot appear on an index signature. (3:2)", - "SyntaxError: 'static' modifier cannot be used with 'override' modifier. (4:2)", - "SyntaxError: 'static' modifier cannot be used with 'override' modifier. (5:2)", - "SyntaxError: 'declare' modifier cannot be used with 'override' modifier. (9:10)", - "SyntaxError: 'declare' modifier cannot be used with 'override' modifier. (10:11)", - "SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. (14:2)" + "SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. (7:2)" ], "program": { "type": "Program", - "start":0,"end":296,"loc":{"start":{"line":1,"column":0},"end":{"line":15,"column":1}}, + "start":0,"end":134,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start":0,"end":149,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, + "start":0,"end":93,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14},"identifierName":"MyClass2"}, @@ -31,7 +27,7 @@ }, "body": { "type": "ClassBody", - "start":33,"end":149,"loc":{"start":{"line":1,"column":33},"end":{"line":6,"column":1}}, + "start":33,"end":93,"loc":{"start":{"line":1,"column":33},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", @@ -83,147 +79,40 @@ "start":87,"end":90,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":27}} } } - }, - { - "type": "ClassProperty", - "start":94,"end":119,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":27}}, - "override": true, - "static": true, - "key": { - "type": "Identifier", - "start":110,"end":114,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":22},"identifierName":"size"}, - "name": "size" - }, - "computed": false, - "value": { - "type": "NumericLiteral", - "start":117,"end":118,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":26}}, - "extra": { - "rawValue": 5, - "raw": "5" - }, - "value": 5 - } - }, - { - "type": "ClassProperty", - "start":122,"end":147,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}}, - "override": true, - "static": true, - "key": { - "type": "Identifier", - "start":138,"end":142,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":22},"identifierName":"size"}, - "name": "size" - }, - "computed": false, - "value": { - "type": "NumericLiteral", - "start":145,"end":146,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":26}}, - "extra": { - "rawValue": 5, - "raw": "5" - }, - "value": 5 - } - } - ] - } - }, - { - "type": "ClassDeclaration", - "start":151,"end":255,"loc":{"start":{"line":8,"column":0},"end":{"line":11,"column":1}}, - "declare": true, - "id": { - "type": "Identifier", - "start":165,"end":173,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":22},"identifierName":"MyClass3"}, - "name": "MyClass3" - }, - "superClass": { - "type": "Identifier", - "start":182,"end":191,"loc":{"start":{"line":8,"column":31},"end":{"line":8,"column":40},"identifierName":"BaseClass"}, - "name": "BaseClass" - }, - "body": { - "type": "ClassBody", - "start":192,"end":255,"loc":{"start":{"line":8,"column":41},"end":{"line":11,"column":1}}, - "body": [ - { - "type": "ClassProperty", - "start":196,"end":223,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":29}}, - "declare": true, - "override": true, - "static": false, - "key": { - "type": "Identifier", - "start":213,"end":218,"loc":{"start":{"line":9,"column":19},"end":{"line":9,"column":24},"identifierName":"prop1"}, - "name": "prop1" - }, - "computed": false, - "typeAnnotation": { - "type": "TSTypeAnnotation", - "start":218,"end":223,"loc":{"start":{"line":9,"column":24},"end":{"line":9,"column":29}}, - "typeAnnotation": { - "type": "TSAnyKeyword", - "start":220,"end":223,"loc":{"start":{"line":9,"column":26},"end":{"line":9,"column":29}} - } - }, - "value": null - }, - { - "type": "ClassProperty", - "start":226,"end":253,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":29}}, - "override": true, - "declare": true, - "static": false, - "key": { - "type": "Identifier", - "start":243,"end":248,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":24},"identifierName":"prop2"}, - "name": "prop2" - }, - "computed": false, - "typeAnnotation": { - "type": "TSTypeAnnotation", - "start":248,"end":253,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":29}}, - "typeAnnotation": { - "type": "TSAnyKeyword", - "start":250,"end":253,"loc":{"start":{"line":10,"column":26},"end":{"line":10,"column":29}} - } - }, - "value": null } ] } }, { "type": "ClassDeclaration", - "start":257,"end":296,"loc":{"start":{"line":13,"column":0},"end":{"line":15,"column":1}}, + "start":95,"end":134,"loc":{"start":{"line":6,"column":0},"end":{"line":8,"column":1}}, "id": { "type": "Identifier", - "start":263,"end":271,"loc":{"start":{"line":13,"column":6},"end":{"line":13,"column":14},"identifierName":"MyClass4"}, + "start":101,"end":109,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":14},"identifierName":"MyClass4"}, "name": "MyClass4" }, "superClass": null, "body": { "type": "ClassBody", - "start":272,"end":296,"loc":{"start":{"line":13,"column":15},"end":{"line":15,"column":1}}, + "start":110,"end":134,"loc":{"start":{"line":6,"column":15},"end":{"line":8,"column":1}}, "body": [ { "type": "ClassProperty", - "start":276,"end":294,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":20}}, + "start":114,"end":132,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":20}}, "override": true, "static": false, "key": { "type": "Identifier", - "start":285,"end":289,"loc":{"start":{"line":14,"column":11},"end":{"line":14,"column":15},"identifierName":"prop"}, + "start":123,"end":127,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":15},"identifierName":"prop"}, "name": "prop" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start":289,"end":294,"loc":{"start":{"line":14,"column":15},"end":{"line":14,"column":20}}, + "start":127,"end":132,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":20}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start":291,"end":294,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":20}} + "start":129,"end":132,"loc":{"start":{"line":7,"column":17},"end":{"line":7,"column":20}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts index b532036d7e90..df2255f6042a 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/input.ts @@ -1,10 +1,8 @@ class MyClass extends BaseClass { override show() {} - override public show() {} public override show() {} override size = 5; override readonly size = 5; - readonly override size = 5; override get text() {} override set text(value) {} diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json index 293d14d661e2..0308713d4a6d 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-override/output.json @@ -1,15 +1,15 @@ { "type": "File", - "start":0,"end":390,"loc":{"start":{"line":1,"column":0},"end":{"line":20,"column":1}}, + "start":0,"end":332,"loc":{"start":{"line":1,"column":0},"end":{"line":18,"column":1}}, "program": { "type": "Program", - "start":0,"end":390,"loc":{"start":{"line":1,"column":0},"end":{"line":20,"column":1}}, + "start":0,"end":332,"loc":{"start":{"line":1,"column":0},"end":{"line":18,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start":0,"end":318,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":1}}, + "start":0,"end":260,"loc":{"start":{"line":1,"column":0},"end":{"line":14,"column":1}}, "id": { "type": "Identifier", "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"MyClass"}, @@ -22,7 +22,7 @@ }, "body": { "type": "ClassBody", - "start":32,"end":318,"loc":{"start":{"line":1,"column":32},"end":{"line":16,"column":1}}, + "start":32,"end":260,"loc":{"start":{"line":1,"column":32},"end":{"line":14,"column":1}}, "body": [ { "type": "ClassMethod", @@ -50,8 +50,8 @@ { "type": "ClassMethod", "start":57,"end":82,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":27}}, - "override": true, "accessibility": "public", + "override": true, "static": false, "key": { "type": "Identifier", @@ -71,44 +71,20 @@ "directives": [] } }, - { - "type": "ClassMethod", - "start":85,"end":110,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":27}}, - "accessibility": "public", - "override": true, - "static": false, - "key": { - "type": "Identifier", - "start":101,"end":105,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":22},"identifierName":"show"}, - "name": "show" - }, - "computed": false, - "kind": "method", - "id": null, - "generator": false, - "async": false, - "params": [], - "body": { - "type": "BlockStatement", - "start":108,"end":110,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":27}}, - "body": [], - "directives": [] - } - }, { "type": "ClassProperty", - "start":113,"end":131,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":20}}, + "start":85,"end":103,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":20}}, "override": true, "static": false, "key": { "type": "Identifier", - "start":122,"end":126,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":15},"identifierName":"size"}, + "start":94,"end":98,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15},"identifierName":"size"}, "name": "size" }, "computed": false, "value": { "type": "NumericLiteral", - "start":129,"end":130,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":19}}, + "start":101,"end":102,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":19}}, "extra": { "rawValue": 5, "raw": "5" @@ -118,41 +94,19 @@ }, { "type": "ClassProperty", - "start":134,"end":161,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":29}}, + "start":106,"end":133,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":29}}, "override": true, "readonly": true, "static": false, "key": { "type": "Identifier", - "start":152,"end":156,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":24},"identifierName":"size"}, - "name": "size" - }, - "computed": false, - "value": { - "type": "NumericLiteral", - "start":159,"end":160,"loc":{"start":{"line":6,"column":27},"end":{"line":6,"column":28}}, - "extra": { - "rawValue": 5, - "raw": "5" - }, - "value": 5 - } - }, - { - "type": "ClassProperty", - "start":164,"end":191,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":29}}, - "readonly": true, - "override": true, - "static": false, - "key": { - "type": "Identifier", - "start":182,"end":186,"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":24},"identifierName":"size"}, + "start":124,"end":128,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":24},"identifierName":"size"}, "name": "size" }, "computed": false, "value": { "type": "NumericLiteral", - "start":189,"end":190,"loc":{"start":{"line":7,"column":27},"end":{"line":7,"column":28}}, + "start":131,"end":132,"loc":{"start":{"line":5,"column":27},"end":{"line":5,"column":28}}, "extra": { "rawValue": 5, "raw": "5" @@ -162,12 +116,12 @@ }, { "type": "ClassMethod", - "start":195,"end":217,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":24}}, + "start":137,"end":159,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":24}}, "override": true, "static": false, "key": { "type": "Identifier", - "start":208,"end":212,"loc":{"start":{"line":9,"column":15},"end":{"line":9,"column":19},"identifierName":"text"}, + "start":150,"end":154,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":19},"identifierName":"text"}, "name": "text" }, "computed": false, @@ -178,19 +132,19 @@ "params": [], "body": { "type": "BlockStatement", - "start":215,"end":217,"loc":{"start":{"line":9,"column":22},"end":{"line":9,"column":24}}, + "start":157,"end":159,"loc":{"start":{"line":7,"column":22},"end":{"line":7,"column":24}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start":220,"end":247,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":29}}, + "start":162,"end":189,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":29}}, "override": true, "static": false, "key": { "type": "Identifier", - "start":233,"end":237,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":19},"identifierName":"text"}, + "start":175,"end":179,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":19},"identifierName":"text"}, "name": "text" }, "computed": false, @@ -201,25 +155,25 @@ "params": [ { "type": "Identifier", - "start":238,"end":243,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":25},"identifierName":"value"}, + "start":180,"end":185,"loc":{"start":{"line":8,"column":20},"end":{"line":8,"column":25},"identifierName":"value"}, "name": "value" } ], "body": { "type": "BlockStatement", - "start":245,"end":247,"loc":{"start":{"line":10,"column":27},"end":{"line":10,"column":29}}, + "start":187,"end":189,"loc":{"start":{"line":8,"column":27},"end":{"line":8,"column":29}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start":251,"end":276,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":27}}, + "start":193,"end":218,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":27}}, "override": true, "static": false, "key": { "type": "Identifier", - "start":266,"end":271,"loc":{"start":{"line":12,"column":17},"end":{"line":12,"column":22},"identifierName":"fetch"}, + "start":208,"end":213,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":22},"identifierName":"fetch"}, "name": "fetch" }, "computed": false, @@ -230,25 +184,25 @@ "params": [], "body": { "type": "BlockStatement", - "start":274,"end":276,"loc":{"start":{"line":12,"column":25},"end":{"line":12,"column":27}}, + "start":216,"end":218,"loc":{"start":{"line":10,"column":25},"end":{"line":10,"column":27}}, "body": [], "directives": [] } }, { "type": "ClassProperty", - "start":280,"end":296,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":18}}, + "start":222,"end":238,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":18}}, "override": true, "static": false, "computed": true, "key": { "type": "Identifier", - "start":290,"end":291,"loc":{"start":{"line":14,"column":12},"end":{"line":14,"column":13},"identifierName":"x"}, + "start":232,"end":233,"loc":{"start":{"line":12,"column":12},"end":{"line":12,"column":13},"identifierName":"x"}, "name": "x" }, "value": { "type": "NumericLiteral", - "start":295,"end":296,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":18}}, + "start":237,"end":238,"loc":{"start":{"line":12,"column":17},"end":{"line":12,"column":18}}, "extra": { "rawValue": 2, "raw": "2" @@ -258,13 +212,13 @@ }, { "type": "ClassMethod", - "start":299,"end":316,"loc":{"start":{"line":15,"column":2},"end":{"line":15,"column":19}}, + "start":241,"end":258,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":19}}, "override": true, "static": false, "computed": true, "key": { "type": "Identifier", - "start":309,"end":310,"loc":{"start":{"line":15,"column":12},"end":{"line":15,"column":13},"identifierName":"x"}, + "start":251,"end":252,"loc":{"start":{"line":13,"column":12},"end":{"line":13,"column":13},"identifierName":"x"}, "name": "x" }, "kind": "method", @@ -274,7 +228,7 @@ "params": [], "body": { "type": "BlockStatement", - "start":314,"end":316,"loc":{"start":{"line":15,"column":17},"end":{"line":15,"column":19}}, + "start":256,"end":258,"loc":{"start":{"line":13,"column":17},"end":{"line":13,"column":19}}, "body": [], "directives": [] } @@ -284,30 +238,30 @@ }, { "type": "ClassDeclaration", - "start":320,"end":390,"loc":{"start":{"line":18,"column":0},"end":{"line":20,"column":1}}, + "start":262,"end":332,"loc":{"start":{"line":16,"column":0},"end":{"line":18,"column":1}}, "declare": true, "id": { "type": "Identifier", - "start":334,"end":347,"loc":{"start":{"line":18,"column":14},"end":{"line":18,"column":27},"identifierName":"DeclaredClass"}, + "start":276,"end":289,"loc":{"start":{"line":16,"column":14},"end":{"line":16,"column":27},"identifierName":"DeclaredClass"}, "name": "DeclaredClass" }, "superClass": { "type": "Identifier", - "start":356,"end":365,"loc":{"start":{"line":18,"column":36},"end":{"line":18,"column":45},"identifierName":"BaseClass"}, + "start":298,"end":307,"loc":{"start":{"line":16,"column":36},"end":{"line":16,"column":45},"identifierName":"BaseClass"}, "name": "BaseClass" }, "body": { "type": "ClassBody", - "start":366,"end":390,"loc":{"start":{"line":18,"column":46},"end":{"line":20,"column":1}}, + "start":308,"end":332,"loc":{"start":{"line":16,"column":46},"end":{"line":18,"column":1}}, "body": [ { "type": "ClassMethod", - "start":370,"end":388,"loc":{"start":{"line":19,"column":2},"end":{"line":19,"column":20}}, + "start":312,"end":330,"loc":{"start":{"line":17,"column":2},"end":{"line":17,"column":20}}, "override": true, "static": false, "key": { "type": "Identifier", - "start":379,"end":383,"loc":{"start":{"line":19,"column":11},"end":{"line":19,"column":15},"identifierName":"test"}, + "start":321,"end":325,"loc":{"start":{"line":17,"column":11},"end":{"line":17,"column":15},"identifierName":"test"}, "name": "test" }, "computed": false, @@ -318,7 +272,7 @@ "params": [], "body": { "type": "BlockStatement", - "start":386,"end":388,"loc":{"start":{"line":19,"column":18},"end":{"line":19,"column":20}}, + "start":328,"end":330,"loc":{"start":{"line":17,"column":18},"end":{"line":17,"column":20}}, "body": [], "directives": [] } diff --git a/scripts/parser-tests/typescript/allowlist.txt b/scripts/parser-tests/typescript/allowlist.txt index dd8f1b29553a..c6b12a718071 100644 --- a/scripts/parser-tests/typescript/allowlist.txt +++ b/scripts/parser-tests/typescript/allowlist.txt @@ -232,6 +232,7 @@ functionCall15.ts functionDeclarationWithResolutionOfTypeNamedArguments01.ts functionExpressionInWithBlock.ts functionExpressionWithResolutionOfTypeNamedArguments01.ts +getterErrorMessageNotDuplicated.ts gettersAndSettersErrors.ts giant.ts globalThisDeclarationEmit.ts @@ -407,8 +408,7 @@ shorthandPropertyAssignmentInES6Module.ts sourceMap-LineBreaks.ts sourceMapValidationDecorators.ts sourceMapValidationStatements.ts -staticAsIdentifier.ts -staticModifierAlreadySeen.ts +stackDepthLimitCastingType.ts strictModeReservedWord.ts superCallFromClassThatHasNoBaseType1.ts symbolLinkDeclarationEmitModuleNames.ts