From c0230cf1525b5a596359e4c524663d4eaf1ab381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Aug 2019 10:32:15 +0200 Subject: [PATCH 01/29] Add error recovery support to @babel/parser --- packages/babel-parser/src/options.js | 4 ++++ packages/babel-parser/src/parser/index.js | 5 ++++- packages/babel-parser/src/parser/location.js | 10 ++++++++-- packages/babel-parser/src/tokenizer/state.js | 2 ++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/babel-parser/src/options.js b/packages/babel-parser/src/options.js index 8b030847f970..eb4dd6789605 100755 --- a/packages/babel-parser/src/options.js +++ b/packages/babel-parser/src/options.js @@ -21,6 +21,7 @@ export type Options = { ranges: boolean, tokens: boolean, createParenthesizedExpressions: boolean, + errorRecovery: boolean, }; export const defaultOptions: Options = { @@ -62,6 +63,9 @@ export const defaultOptions: Options = { // Whether to create ParenthesizedExpression AST nodes (if false // the parser sets extra.parenthesized on the expression nodes instead). createParenthesizedExpressions: false, + // When enabled, errors are attached to the AST instead of being directly thrown. + // Some errors will still throw, because @babel/parser can't always recover. + errorRecovery: false, }; // Interpret and default an options object diff --git a/packages/babel-parser/src/parser/index.js b/packages/babel-parser/src/parser/index.js index 9e75bf6044d3..2c96336f1c13 100644 --- a/packages/babel-parser/src/parser/index.js +++ b/packages/babel-parser/src/parser/index.js @@ -39,7 +39,10 @@ export default class Parser extends StatementParser { const file = this.startNode(); const program = this.startNode(); this.nextToken(); - return this.parseTopLevel(file, program); + file.errors = null; + this.parseTopLevel(file, program); + file.errors = this.state.errors; + return file; } } diff --git a/packages/babel-parser/src/parser/location.js b/packages/babel-parser/src/parser/location.js index 1839f359ae4c..d3a0bf47c244 100644 --- a/packages/babel-parser/src/parser/location.js +++ b/packages/babel-parser/src/parser/location.js @@ -31,7 +31,7 @@ export default class LocationParser extends CommentsParser { missingPluginNames?: Array, code?: string, } = {}, - ): empty { + ): Error | empty { const loc = this.getLocationForPosition(pos); message += ` (${loc.line}:${loc.column})`; @@ -47,6 +47,12 @@ export default class LocationParser extends CommentsParser { if (code !== undefined) { err.code = code; } - throw err; + + if (this.options.errorRecovery) { + this.state.errors.push(err); + return err; + } else { + throw err; + } } } diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index 4ee937e1d292..e41504d9d1cf 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -38,6 +38,8 @@ export default class State { this.startLoc = this.endLoc = this.curPosition(); } + errors: Error[] = []; + // Used to signify the start of a potential arrow function potentialArrowAt: number = -1; From 031a33728e6f38e562c7d0887c12d7065bc2f0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Aug 2019 11:00:48 +0200 Subject: [PATCH 02/29] Update @babel/parser tests to always recover from errors --- .../test/helpers/runFixtureTests.js | 44 +++++++++++++++---- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/packages/babel-parser/test/helpers/runFixtureTests.js b/packages/babel-parser/test/helpers/runFixtureTests.js index 9e97ee46f727..f08ed2312101 100644 --- a/packages/babel-parser/test/helpers/runFixtureTests.js +++ b/packages/babel-parser/test/helpers/runFixtureTests.js @@ -107,11 +107,19 @@ export function runThrowTestsWithEstree(fixturesPath, parseFunction) { } function save(test, ast) { - // Ensure that RegExp are serialized as strings - const toJSON = RegExp.prototype.toJSON; - RegExp.prototype.toJSON = RegExp.prototype.toString; - require("fs").writeFileSync(test.expect.loc, JSON.stringify(ast, null, " ")); - RegExp.prototype.toJSON = toJSON; + // Ensure that RegExp and Errors are serialized as strings + forceToString(RegExp, () => + forceToString(Error, () => + fs.writeFileSync(test.expect.loc, JSON.stringify(ast, null, " ")), + ), + ); +} + +function forceToString(obj, cb) { + const { toJSON } = obj.prototype; + obj.prototype.toJSON = obj.prototype.toString; + cb(); + obj.prototype.toJSON = toJSON; } function runTest(test, parseFunction) { @@ -125,7 +133,7 @@ function runTest(test, parseFunction) { let ast; try { - ast = parseFunction(test.actual.code, opts); + ast = parseFunction(test.actual.code, { errorRecovery: true, ...opts }); } catch (err) { if (opts.throws) { if (err.message === opts.throws) { @@ -152,6 +160,7 @@ function runTest(test, parseFunction) { } if (ast.comments && !ast.comments.length) delete ast.comments; + if (ast.errors && !ast.errors.length) delete ast.errors; if (!test.expect.code && !opts.throws && !process.env.CI) { test.expect.loc += "on"; @@ -159,6 +168,20 @@ function runTest(test, parseFunction) { } if (opts.throws) { + if (process.env.OVERWRITE) { + const fn = path.dirname(test.expect.loc) + "/options.json"; + test.options = test.options || {}; + delete test.options.throws; + const contents = JSON.stringify(test.options, null, " "); + if (contents === "{}") { + fs.unlinkSync(fn); + } else { + fs.writeFileSync(fn, JSON.stringify(test.options, null, " ")); + } + test.expect.loc += "on"; + return save(test, ast); + } + throw new Error( "Expected error message: " + opts.throws + ". But parsing succeeded.", ); @@ -175,7 +198,7 @@ function runTest(test, parseFunction) { } function ppJSON(v) { - v = v instanceof RegExp ? v.toString() : v; + v = v instanceof RegExp || v instanceof Error ? v.toString() : v; return JSON.stringify(v, null, 2); } @@ -188,7 +211,12 @@ function addPath(str, pt) { } function misMatch(exp, act) { - if (exp instanceof RegExp || act instanceof RegExp) { + if ( + exp instanceof RegExp || + act instanceof RegExp || + exp instanceof Error || + act instanceof Error + ) { const left = ppJSON(exp); const right = ppJSON(act); if (left !== right) return left + " !== " + right; From ff376e206bf233783bf0c27300964cfeebddb08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Aug 2019 11:01:02 +0200 Subject: [PATCH 03/29] Update this.raise usage in @babel/parser: - expression.js - lval.js - statement.js - estree.js - flow.js - jsx/index.js - tokenizer/index.js --- .../babel-parser/src/parser/expression.js | 45 ++++---- packages/babel-parser/src/parser/lval.js | 4 +- packages/babel-parser/src/parser/statement.js | 26 ++--- packages/babel-parser/src/plugins/estree.js | 16 ++- packages/babel-parser/src/plugins/flow.js | 100 +++++++++++++----- .../babel-parser/src/plugins/jsx/index.js | 13 ++- .../src/plugins/typescript/index.js | 18 ++-- packages/babel-parser/src/tokenizer/index.js | 84 ++++++++++----- 8 files changed, 198 insertions(+), 108 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index eb7952a3e8d9..5f4b4868337d 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -108,6 +108,7 @@ export default class ExpressionParser extends LValParser { this.unexpected(); } expr.comments = this.state.comments; + expr.errors = this.state.errors; return expr; } @@ -783,9 +784,10 @@ export default class ExpressionParser extends LValParser { node: T, optional: boolean, ): T { - if (node.callee.type === "Import") { + validate: if (node.callee.type === "Import") { if (node.arguments.length !== 1) { this.raise(node.start, "import() requires exactly one argument"); + break validate; } const importArg = node.arguments[0]; @@ -1106,15 +1108,16 @@ export default class ExpressionParser extends LValParser { } this.next(); - if (this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) { - this.registerTopicReference(); - return this.finishNode(node, "PipelinePrimaryTopicReference"); - } else { - throw this.raise( + + if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) { + this.raise( node.start, `Topic reference was used in a lexical context without topic binding`, ); } + + this.registerTopicReference(); + return this.finishNode(node, "PipelinePrimaryTopicReference"); } } @@ -1199,6 +1202,15 @@ export default class ExpressionParser extends LValParser { if (this.isContextual("meta")) { this.expectPlugin("importMeta"); + + if (!this.inModule) { + this.raise( + id.start, + `import.meta may appear only with 'sourceType: "module"'`, + { code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" }, + ); + } + this.sawUnambiguousESM = true; } else if (!this.hasPlugin("importMeta")) { this.raise( id.start, @@ -1206,15 +1218,6 @@ export default class ExpressionParser extends LValParser { ); } - if (!this.inModule) { - this.raise( - id.start, - `import.meta may appear only with 'sourceType: "module"'`, - { code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED" }, - ); - } - this.sawUnambiguousESM = true; - return this.parseMetaProperty(node, id, "meta"); } @@ -2219,7 +2222,7 @@ export default class ExpressionParser extends LValParser { "await is not allowed in async function parameters", ); } - if (this.match(tt.star)) { + if (this.eat(tt.star)) { this.raise( node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead.", @@ -2291,7 +2294,7 @@ export default class ExpressionParser extends LValParser { if (left.type === "SequenceExpression") { // Ensure that the pipeline head is not a comma-delimited // sequence expression. - throw this.raise( + this.raise( leftStartPos, `Pipeline head should not be a comma-separated sequence expression`, ); @@ -2336,7 +2339,7 @@ export default class ExpressionParser extends LValParser { pipelineStyle === "PipelineTopicExpression" && childExpression.type === "SequenceExpression" ) { - throw this.raise( + this.raise( startPos, `Pipeline body may not be a comma-separated sequence expression`, ); @@ -2362,7 +2365,7 @@ export default class ExpressionParser extends LValParser { break; case "PipelineTopicExpression": if (!this.topicReferenceWasUsedInCurrentTopicContext()) { - throw this.raise( + this.raise( startPos, `Pipeline is in topic style but does not use topic reference`, ); @@ -2370,7 +2373,9 @@ export default class ExpressionParser extends LValParser { bodyNode.expression = childExpression; break; default: - throw this.raise(startPos, `Unknown pipeline style ${pipelineStyle}`); + throw new Error( + `Internal @babel/parser error: Unknown pipeline style (${pipelineStyle})`, + ); } return this.finishNode(bodyNode, pipelineStyle); } diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index 050bb1eda6c1..e11c027f257b 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -37,6 +37,8 @@ export default class LValParser extends NodeUtils { // Convert existing expression atom to assignable pattern // if possible. + // NOTE: There is a corresponding "isAssignable" method in flow.js. + // When this one is updated, please check if also that one needs to be updated. toAssignable( node: Node, @@ -489,7 +491,7 @@ export default class LValParser extends NodeUtils { } raiseRestNotLast(pos: number) { - this.raise(pos, `Rest element must be last element`); + throw this.raise(pos, `Rest element must be last element`); } raiseTrailingCommaAfterRest(pos: number) { diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 9d87c3d27ed2..20c291db4405 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -203,7 +203,7 @@ export default class StatementParser extends ExpressionParser { case tt._var: kind = kind || this.state.value; if (context && kind !== "var") { - this.unexpected( + this.raise( this.state.start, "Lexical declaration cannot appear in a single-statement context", ); @@ -269,8 +269,8 @@ export default class StatementParser extends ExpressionParser { default: { if (this.isAsyncFunction()) { if (context) { - this.unexpected( - null, + this.raise( + this.state.start, "Async functions can only be declared at the top level or inside a block", ); } @@ -351,7 +351,7 @@ export default class StatementParser extends ExpressionParser { ); } } else if (!this.canHaveLeadingDecorator()) { - this.raise( + throw this.raise( this.state.start, "Leading decorators must be attached to a class declaration", ); @@ -1036,7 +1036,7 @@ export default class StatementParser extends ExpressionParser { this.initFunction(node, isAsync); if (this.match(tt.star) && isHangingStatement) { - this.unexpected( + this.raise( this.state.start, "Generators can only be declared at the top level or inside a block", ); @@ -1077,7 +1077,7 @@ export default class StatementParser extends ExpressionParser { this.scope.exit(); if (isStatement && !isHangingStatement) { - // We need to validate this _after_ parsing the function body + // We need to register this _after_ parsing the function body // because of TypeScript body-less function declarations, // which shouldn't be added to the scope. this.checkFunctionStatementId(node); @@ -1191,7 +1191,7 @@ export default class StatementParser extends ExpressionParser { while (!this.eat(tt.braceR)) { if (this.eat(tt.semi)) { if (decorators.length > 0) { - this.raise( + throw this.raise( this.state.lastTokEnd, "Decorators must not be followed by a semicolon", ); @@ -1229,7 +1229,7 @@ export default class StatementParser extends ExpressionParser { }); if (decorators.length) { - this.raise( + throw this.raise( this.state.start, "You have trailing decorators with no method", ); @@ -1797,7 +1797,7 @@ export default class StatementParser extends ExpressionParser { this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport") ) { - this.unexpected( + this.raise( this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + @@ -1807,7 +1807,7 @@ export default class StatementParser extends ExpressionParser { this.parseDecorators(false); return this.parseClass(expr, true, true); } else if (this.match(tt._const) || this.match(tt._var) || this.isLet()) { - return this.raise( + throw this.raise( this.state.start, "Only expressions, functions or classes are allowed as the `default` export.", ); @@ -1977,7 +1977,7 @@ export default class StatementParser extends ExpressionParser { name: string, ): void { if (this.state.exportedIdentifiers.indexOf(name) > -1) { - throw this.raise( + this.raise( node.start, name === "default" ? "Only one default export allowed per module." @@ -2098,8 +2098,8 @@ export default class StatementParser extends ExpressionParser { } else { // Detect an attempt to deep destructure if (this.eat(tt.colon)) { - this.unexpected( - null, + throw this.raise( + this.state.start, "ES2015 named imports do not destructure. " + "Use another statement for destructuring after the import.", ); diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js index 014a1a54067d..b89e29ee92c9 100644 --- a/packages/babel-parser/src/plugins/estree.js +++ b/packages/babel-parser/src/plugins/estree.js @@ -89,14 +89,17 @@ export default (superClass: Class): Class => const start = prop.start; if (prop.value.params.length !== paramCount) { if (prop.kind === "get") { - this.raise(start, "getter must not have any formal parameters"); + throw this.raise(start, "getter must not have any formal parameters"); } else { - this.raise(start, "setter must have exactly one formal parameter"); + throw this.raise( + start, + "setter must have exactly one formal parameter", + ); } } if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { - this.raise( + throw this.raise( start, "setter function argument must not be a rest parameter", ); @@ -382,12 +385,15 @@ export default (superClass: Class): Class => isLast: boolean, ) { if (prop.kind === "get" || prop.kind === "set") { - this.raise( + throw this.raise( prop.key.start, "Object pattern can't contain getter or setter", ); } else if (prop.method) { - this.raise(prop.key.start, "Object pattern can't contain methods"); + throw this.raise( + prop.key.start, + "Object pattern can't contain methods", + ); } else { super.toAssignableObjectExpressionProp(prop, isBinding, isLast); } diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index fcdd16df61d2..2cd3983020d6 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -263,7 +263,7 @@ export default (superClass: Class): Class => return this.flowParseDeclareModuleExports(node); } else { if (insideModule) { - this.unexpected( + this.raise( this.state.lastTokStart, "`declare module` cannot be used inside another `declare module`", ); @@ -313,7 +313,7 @@ export default (superClass: Class): Class => if (this.match(tt._import)) { this.next(); if (!this.isContextual("type") && !this.match(tt._typeof)) { - this.unexpected( + this.raise( this.state.lastTokStart, "Imports within a `declare module` body must always be `import type` or `import typeof`", ); @@ -345,17 +345,17 @@ export default (superClass: Class): Class => body.forEach(bodyElement => { if (isEsModuleType(bodyElement)) { if (kind === "CommonJS") { - this.unexpected(bodyElement.start, errorMessage); + this.raise(bodyElement.start, errorMessage); } kind = "ES"; } else if (bodyElement.type === "DeclareModuleExports") { if (hasModuleExport) { - this.unexpected( + this.raise( bodyElement.start, "Duplicate `declare module.exports` statement", ); } - if (kind === "ES") this.unexpected(bodyElement.start, errorMessage); + if (kind === "ES") this.raise(bodyElement.start, errorMessage); kind = "CommonJS"; hasModuleExport = true; } @@ -548,8 +548,8 @@ export default (superClass: Class): Class => checkNotUnderscore(word: string) { if (word === "_") { - throw this.unexpected( - null, + this.raise( + this.state.start, "`_` is only allowed as a type argument to call or new", ); } @@ -632,7 +632,7 @@ export default (superClass: Class): Class => node.default = this.flowParseType(); } else { if (requireDefault) { - this.unexpected( + this.raise( nodeStart, // eslint-disable-next-line max-len "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.", @@ -992,8 +992,8 @@ export default (superClass: Class): Class => ): (N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty) | null { if (this.match(tt.ellipsis)) { if (!allowSpread) { - this.unexpected( - null, + this.raise( + this.state.start, "Spread operator cannot appear in class or interface definitions", ); } @@ -1001,20 +1001,19 @@ export default (superClass: Class): Class => this.unexpected(protoStart); } if (variance) { - this.unexpected( - variance.start, - "Spread properties cannot have variance", - ); + this.raise(variance.start, "Spread properties cannot have variance"); } this.expect(tt.ellipsis); const isInexactToken = this.eat(tt.comma) || this.eat(tt.semi); if (this.match(tt.braceR)) { - if (allowInexact) return null; - this.unexpected( - null, - "Explicit inexact syntax is only allowed inside inexact objects", - ); + if (!allowInexact) { + this.raise( + this.state.start, + "Explicit inexact syntax is only allowed inside inexact objects", + ); + } + return null; } if (this.match(tt.braceBarR)) { @@ -1400,8 +1399,8 @@ export default (superClass: Class): Class => ); } - this.unexpected( - null, + throw this.raise( + this.state.start, `Unexpected token, expected "number" or "bigint"`, ); } @@ -1720,7 +1719,7 @@ export default (superClass: Class): Class => ): N.Expression { if (!this.match(tt.question)) return expr; - // only do the expensive clone if there is a question mark + // only use the expensive "tryParse" method if there is a question mark // and if we come from inside parens if (refNeedsArrowPos) { const state = this.state.clone(); @@ -2025,6 +2024,49 @@ export default (superClass: Class): Class => } } + isAssignable(node: Node, isBinding?: boolean): boolean { + switch (node.type) { + case "Identifier": + case "ObjectPattern": + case "ArrayPattern": + case "AssignmentPattern": + return true; + + case "ObjectExpression": { + const last = node.properties.length - 1; + return node.properties.every((prop, i) => { + return ( + prop.type !== "ObjectMethod" && + (i === last || prop.type === "SpreadElement") && + this.isAssignable(prop) + ); + }); + } + + case "ObjectProperty": + return this.isAssignable(node.value); + + case "SpreadElement": + return this.isAssignable(node.argument); + + case "ArrayExpression": + return node.elements.every(element => this.isAssignable(element)); + + case "AssignmentExpression": + return node.operator === "="; + + case "ParenthesizedExpression": + return this.isAssignable(node.expression); + + case "MemberExpression": + case "OptionalMemberExpression": + return !isBinding; + + default: + return false; + } + } + toAssignable( node: N.Node, isBinding: ?boolean, @@ -2253,13 +2295,13 @@ export default (superClass: Class): Class => parseAssignableListItemTypes(param: N.Pattern): N.Pattern { if (this.eat(tt.question)) { if (param.type !== "Identifier") { - throw this.raise( + this.raise( param.start, "A binding pattern parameter cannot be optional in an implementation signature.", ); } - param.optional = true; + ((param: any): N.Identifier).optional = true; } if (this.match(tt.colon)) { param.typeAnnotation = this.flowParseTypeAnnotation(); @@ -2549,7 +2591,7 @@ export default (superClass: Class): Class => } else if (jsxError != null) { throw jsxError; } else { - this.raise( + throw this.raise( typeParameters.start, "Expected an arrow function after this type parameter declaration", ); @@ -2811,7 +2853,7 @@ export default (superClass: Class): Class => parseTopLevel(file: N.File, program: N.Program): N.File { const fileNode = super.parseTopLevel(file, program); if (this.state.hasFlowComment) { - this.unexpected(null, "Unterminated flow-comment"); + this.raise(this.state.pos, "Unterminated flow-comment"); } return fileNode; } @@ -2832,7 +2874,9 @@ export default (superClass: Class): Class => if (this.state.hasFlowComment) { const end = this.input.indexOf("*-/", (this.state.pos += 2)); - if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); + if (end === -1) { + throw this.raise(this.state.pos - 2, "Unterminated comment"); + } this.state.pos = end + 3; return; } @@ -2874,7 +2918,7 @@ export default (superClass: Class): Class => hasFlowCommentCompletion(): void { const end = this.input.indexOf("*/", this.state.pos); if (end === -1) { - this.raise(this.state.pos, "Unterminated comment"); + throw this.raise(this.state.pos, "Unterminated comment"); } } diff --git a/packages/babel-parser/src/plugins/jsx/index.js b/packages/babel-parser/src/plugins/jsx/index.js index 4daa31ef545d..fc2324ce6f2e 100644 --- a/packages/babel-parser/src/plugins/jsx/index.js +++ b/packages/babel-parser/src/plugins/jsx/index.js @@ -82,7 +82,7 @@ export default (superClass: Class): Class => let chunkStart = this.state.pos; for (;;) { if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated JSX contents"); + throw this.raise(this.state.start, "Unterminated JSX contents"); } const ch = this.input.charCodeAt(this.state.pos); @@ -142,7 +142,7 @@ export default (superClass: Class): Class => let chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated string constant"); + throw this.raise(this.state.start, "Unterminated string constant"); } const ch = this.input.charCodeAt(this.state.pos); @@ -279,13 +279,12 @@ export default (superClass: Class): Class => this.next(); node = this.jsxParseExpressionContainer(node); if (node.expression.type === "JSXEmptyExpression") { - throw this.raise( + this.raise( node.start, "JSX attributes must only be assigned a non-empty expression", ); - } else { - return node; } + return node; case tt.jsxTagStart: case tt.string: @@ -466,7 +465,7 @@ export default (superClass: Class): Class => getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name) ) { - this.raise( + throw this.raise( // $FlowIgnore closingElement.start, "Expected corresponding JSX closing tag for <" + @@ -486,7 +485,7 @@ export default (superClass: Class): Class => } node.children = children; if (this.match(tt.relational) && this.state.value === "<") { - this.raise( + throw this.raise( this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag. " + "Did you want a JSX fragment <>...?", diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 4dc707be7cb9..056826392540 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -234,8 +234,8 @@ export default (superClass: Class): Class => this.expect(tt._import); this.expect(tt.parenL); if (!this.match(tt.string)) { - throw this.unexpected( - null, + this.raise( + this.state.start, "Argument in a type import must be a string literal", ); } @@ -371,13 +371,13 @@ export default (superClass: Class): Class => pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern" ) { - throw this.unexpected( + this.raise( pattern.start, "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," + `instead got ${pattern.type}`, ); } - return pattern; + return (pattern: any); }, ); } @@ -642,7 +642,7 @@ export default (superClass: Class): Class => const node: N.TsLiteralType = this.startNode(); const templateNode = this.parseTemplate(false); if (templateNode.expressions.length > 0) { - throw this.raise( + this.raise( templateNode.expressions[0].start, "Template literal types cannot have any substitution", ); @@ -1558,12 +1558,12 @@ export default (superClass: Class): Class => if (accessibility) pp.accessibility = accessibility; if (readonly) pp.readonly = readonly; if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") { - throw this.raise( + this.raise( pp.start, "A parameter property may not be declared using a binding pattern.", ); } - pp.parameter = elt; + pp.parameter = ((elt: any): N.Identifier | N.AssignmentPattern); return this.finishNode(pp, "TSParameterProperty"); } @@ -2277,13 +2277,13 @@ export default (superClass: Class): Class => parseAssignableListItemTypes(param: N.Pattern) { if (this.eat(tt.question)) { if (param.type !== "Identifier") { - throw this.raise( + this.raise( param.start, "A binding pattern parameter cannot be optional in an implementation signature.", ); } - param.optional = true; + ((param: any): N.Identifier).optional = true; } const type = this.tsTryParseTypeAnnotation(); if (type) param.typeAnnotation = type; diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index ab0dbe5b9237..a3cd44efe1ee 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -248,7 +248,7 @@ export default class Tokenizer extends LocationParser { const startLoc = this.state.curPosition(); const start = this.state.pos; const end = this.input.indexOf("*/", this.state.pos + 2); - if (end === -1) this.raise(start, "Unterminated comment"); + if (end === -1) throw this.raise(start, "Unterminated comment"); this.state.pos = end + 2; lineBreakG.lastIndex = start; @@ -384,7 +384,7 @@ export default class Tokenizer extends LocationParser { const nextPos = this.state.pos + 1; const next = this.input.charCodeAt(nextPos); if (next >= charCodes.digit0 && next <= charCodes.digit9) { - this.raise(this.state.pos, "Unexpected digit after hash token"); + throw this.raise(this.state.pos, "Unexpected digit after hash token"); } if ( @@ -400,7 +400,7 @@ export default class Tokenizer extends LocationParser { ) { this.finishOp(tt.hash, 1); } else { - this.raise(this.state.pos, "Unexpected character '#'"); + throw this.raise(this.state.pos, "Unexpected character '#'"); } } @@ -808,7 +808,7 @@ export default class Tokenizer extends LocationParser { } } - this.raise( + throw this.raise( this.state.pos, `Unexpected character '${String.fromCodePoint(code)}'`, ); @@ -825,11 +825,11 @@ export default class Tokenizer extends LocationParser { let escaped, inClass; for (;;) { if (this.state.pos >= this.length) { - this.raise(start, "Unterminated regular expression"); + throw this.raise(start, "Unterminated regular expression"); } const ch = this.input.charAt(this.state.pos); if (lineBreak.test(ch)) { - this.raise(start, "Unterminated regular expression"); + throw this.raise(start, "Unterminated regular expression"); } if (escaped) { escaped = false; @@ -858,9 +858,6 @@ export default class Tokenizer extends LocationParser { if (mods.indexOf(char) > -1) { this.raise(this.state.pos + 1, "Duplicate regular expression flag"); } - - ++this.state.pos; - mods += char; } else if ( isIdentifierChar(charCode) || charCode === charCodes.backslash @@ -869,6 +866,9 @@ export default class Tokenizer extends LocationParser { } else { break; } + + ++this.state.pos; + mods += char; } this.finishToken(tt.regexp, { @@ -880,10 +880,16 @@ export default class Tokenizer extends LocationParser { // Read an integer in the given radix. Return null if zero digits // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. + // When `forceLen` is `true`, it means that we already know that in case + // of a malformed number we have to skip `len` characters anyway, instead + // of bailing out early. For example, in "\u{123Z}" we want to read up to } + // anyway, while in "\u00Z" we will stop at Z instead of consuming four + // characters (and thus the closing quote). readInt( radix: number, len?: number, + forceLen?: boolean, allowNumSeparator: boolean = true, ): number | null { const start = this.state.pos; @@ -900,6 +906,7 @@ export default class Tokenizer extends LocationParser { ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin; + let invalid = false; let total = 0; for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) { @@ -911,15 +918,19 @@ export default class Tokenizer extends LocationParser { const prev = this.input.charCodeAt(this.state.pos - 1); const next = this.input.charCodeAt(this.state.pos + 1); if (allowedSiblings.indexOf(next) === -1) { - this.raise(this.state.pos, "Invalid or unexpected token"); - } - - if ( + this.raise( + this.state.pos, + "A numeric separator is only allowed between two digits", + ); + } else if ( forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next) ) { - this.raise(this.state.pos, "Invalid or unexpected token"); + this.raise( + this.state.pos, + "A numeric separator is only allowed between two digits", + ); } if (!allowNumSeparator) { @@ -944,13 +955,30 @@ export default class Tokenizer extends LocationParser { } else { val = Infinity; } - if (val >= radix) break; + if (val >= radix) { + // If we are in "errorRecovery" mode and we found a digit which is too big, + // don't break the loop. + + if (this.options.errorRecovery && val <= 9) { + val = 0; + this.raise( + this.state.start + i + 2, + "Expected number in radix " + radix, + ); + } else if (forceLen) { + val = 0; + invalid = true; + } else { + break; + } + } ++this.state.pos; total = total * radix + val; } if ( this.state.pos === start || - (len != null && this.state.pos - start !== len) + (len != null && this.state.pos - start !== len) || + invalid ) { return null; } @@ -976,7 +1004,7 @@ export default class Tokenizer extends LocationParser { } if (isIdentifierStart(this.input.codePointAt(this.state.pos))) { - this.raise(this.state.pos, "Identifier directly after number"); + throw this.raise(this.state.pos, "Identifier directly after number"); } if (isBigInt) { @@ -1062,7 +1090,7 @@ export default class Tokenizer extends LocationParser { } if (isIdentifierStart(this.input.codePointAt(this.state.pos))) { - this.raise(this.state.pos, "Identifier directly after number"); + throw this.raise(this.state.pos, "Identifier directly after number"); } // remove "_" for numeric literal separator, and "n" for BigInts @@ -1087,6 +1115,7 @@ export default class Tokenizer extends LocationParser { const codePos = ++this.state.pos; code = this.readHexChar( this.input.indexOf("}", this.state.pos) - this.state.pos, + true, throwOnInvalid, ); ++this.state.pos; @@ -1102,7 +1131,7 @@ export default class Tokenizer extends LocationParser { } } } else { - code = this.readHexChar(4, throwOnInvalid); + code = this.readHexChar(4, false, throwOnInvalid); } return code; } @@ -1112,7 +1141,7 @@ export default class Tokenizer extends LocationParser { chunkStart = ++this.state.pos; for (;;) { if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated string constant"); + throw this.raise(this.state.start, "Unterminated string constant"); } const ch = this.input.charCodeAt(this.state.pos); if (ch === quote) break; @@ -1128,7 +1157,7 @@ export default class Tokenizer extends LocationParser { ++this.state.pos; ++this.state.curLine; } else if (isNewLine(ch)) { - this.raise(this.state.start, "Unterminated string constant"); + throw this.raise(this.state.start, "Unterminated string constant"); } else { ++this.state.pos; } @@ -1145,7 +1174,7 @@ export default class Tokenizer extends LocationParser { containsInvalid = false; for (;;) { if (this.state.pos >= this.length) { - this.raise(this.state.start, "Unterminated template"); + throw this.raise(this.state.start, "Unterminated template"); } const ch = this.input.charCodeAt(this.state.pos); if ( @@ -1214,7 +1243,7 @@ export default class Tokenizer extends LocationParser { case charCodes.lowercaseR: return "\r"; case charCodes.lowercaseX: { - const code = this.readHexChar(2, throwOnInvalid); + const code = this.readHexChar(2, false, throwOnInvalid); return code === null ? null : String.fromCharCode(code); } case charCodes.lowercaseU: { @@ -1288,9 +1317,13 @@ export default class Tokenizer extends LocationParser { // Used to read character escape sequences ('\x', '\u'). - readHexChar(len: number, throwOnInvalid: boolean): number | null { + readHexChar( + len: number, + forceLen: boolean, + throwOnInvalid: boolean, + ): number | null { const codePos = this.state.pos; - const n = this.readInt(16, len, false); + const n = this.readInt(16, len, forceLen, false); if (n === null) { if (throwOnInvalid) { this.raise(codePos, "Bad character escape sequence"); @@ -1333,6 +1366,7 @@ export default class Tokenizer extends LocationParser { this.state.pos, "Expecting Unicode escape sequence \\uXXXX", ); + continue; } ++this.state.pos; From b422ffa3ca38aff8e3796a6b31eb33cae8bbfd08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Aug 2019 11:03:10 +0200 Subject: [PATCH 04/29] Update @babel/parser fixtures with recovered errors --- .../fail/7/options.json | 3 - .../fail/7/output.json | 128 ++++ .../fail/8/options.json | 5 +- .../fail/8/output.json | 20 + .../invalid-fn-decl-inside-loop/options.json | 3 - .../invalid-fn-decl-inside-loop/output.json | 125 ++++ .../options.json | 3 - .../output.json | 189 ++++++ .../core/escape-keyword/invalid/options.json | 3 - .../core/escape-keyword/invalid/output.json | 160 +++++ .../non-octal-eight/options.json | 3 - .../non-octal-eight/output.json | 91 +++ .../non-octal-nine/options.json | 3 - .../non-octal-nine/output.json | 91 +++ .../non-octal-float-strict-mode/options.json | 5 +- .../non-octal-float-strict-mode/output.json | 73 +++ .../dupl-bind-2nd-lvl-lex-nested/options.json | 3 - .../dupl-bind-2nd-lvl-lex-nested/output.json | 247 ++++++++ .../scope/dupl-bind-2nd-lvl-lex/options.json | 3 - .../scope/dupl-bind-2nd-lvl-lex/output.json | 229 ++++++++ .../dupl-bind-2nd-lvl-var-nested/options.json | 3 - .../dupl-bind-2nd-lvl-var-nested/output.json | 247 ++++++++ .../scope/dupl-bind-2nd-lvl-var/options.json | 3 - .../scope/dupl-bind-2nd-lvl-var/output.json | 229 ++++++++ .../dupl-bind-catch-arr-destr/options.json | 3 - .../dupl-bind-catch-arr-destr/output.json | 154 +++++ .../dupl-bind-catch-dbl-let/options.json | 3 - .../scope/dupl-bind-catch-dbl-let/output.json | 222 +++++++ .../scope/dupl-bind-catch-func/options.json | 3 - .../scope/dupl-bind-catch-func/output.json | 173 ++++++ .../scope/dupl-bind-catch-let/options.json | 3 - .../scope/dupl-bind-catch-let/output.json | 172 ++++++ .../dupl-bind-catch-obj-destr/options.json | 3 - .../dupl-bind-catch-obj-destr/output.json | 293 +++++++++ .../options.json | 3 - .../dupl-bind-catch-var-arr-destr/output.json | 189 ++++++ .../options.json | 3 - .../dupl-bind-catch-var-obj-destr/output.json | 227 +++++++ .../scope/dupl-bind-class-class/options.json | 3 - .../scope/dupl-bind-class-class/output.json | 166 ++++++ .../scope/dupl-bind-class-const/options.json | 3 - .../scope/dupl-bind-class-const/output.json | 172 ++++++ .../scope/dupl-bind-class-func/options.json | 3 - .../scope/dupl-bind-class-func/output.json | 169 ++++++ .../scope/dupl-bind-class-let/options.json | 3 - .../scope/dupl-bind-class-let/output.json | 172 ++++++ .../scope/dupl-bind-class-var/options.json | 3 - .../scope/dupl-bind-class-var/output.json | 153 +++++ .../scope/dupl-bind-const-const/options.json | 3 - .../scope/dupl-bind-const-const/output.json | 160 +++++ .../scope/dupl-bind-func-gen/options.json | 3 - .../core/scope/dupl-bind-func-gen/output.json | 160 +++++ .../dupl-bind-func-module-sloppy/options.json | 5 +- .../dupl-bind-func-module-sloppy/output.json | 160 +++++ .../scope/dupl-bind-func-module/options.json | 5 +- .../scope/dupl-bind-func-module/output.json | 142 +++++ .../dupl-bind-func-var-sloppy/options.json | 3 - .../dupl-bind-func-var-sloppy/output.json | 178 ++++++ .../scope/dupl-bind-gen-func/options.json | 3 - .../core/scope/dupl-bind-gen-func/output.json | 160 +++++ .../core/scope/dupl-bind-let-let/options.json | 3 - .../core/scope/dupl-bind-let-let/output.json | 122 ++++ .../dupl-bind-nested-let-var/options.json | 3 - .../dupl-bind-nested-let-var/output.json | 176 ++++++ .../fixtures/core/scope/for-var/options.json | 3 - .../fixtures/core/scope/for-var/output.json | 194 ++++++ .../undecl-export-as-default/options.json | 5 +- .../undecl-export-as-default/output.json | 106 ++++ .../core/scope/undecl-export-as/options.json | 5 +- .../core/scope/undecl-export-as/output.json | 158 +++++ .../scope/undecl-export-block/options.json | 5 +- .../scope/undecl-export-block/output.json | 176 ++++++ .../undecl-export-builtin-as/options.json | 5 +- .../undecl-export-builtin-as/output.json | 106 ++++ .../scope/undecl-export-builtin/options.json | 5 +- .../scope/undecl-export-builtin/output.json | 106 ++++ .../core/scope/undecl-export-if/options.json | 5 +- .../core/scope/undecl-export-if/output.json | 191 ++++++ .../core/scope/undecl-export/options.json | 5 +- .../core/scope/undecl-export/output.json | 106 ++++ .../core/uncategorised/108/options.json | 3 - .../core/uncategorised/108/output.json | 112 ++++ .../core/uncategorised/347/options.json | 4 +- .../core/uncategorised/349/options.json | 3 - .../core/uncategorised/349/output.json | 73 +++ .../core/uncategorised/350/options.json | 3 - .../core/uncategorised/350/output.json | 73 +++ .../core/uncategorised/351/options.json | 3 - .../core/uncategorised/351/output.json | 73 +++ .../core/uncategorised/354/options.json | 3 - .../core/uncategorised/354/output.json | 73 +++ .../core/uncategorised/361/options.json | 3 - .../core/uncategorised/361/output.json | 70 +++ .../core/uncategorised/362/options.json | 3 - .../core/uncategorised/362/output.json | 70 +++ .../core/uncategorised/363/options.json | 3 - .../core/uncategorised/363/output.json | 70 +++ .../core/uncategorised/366/options.json | 3 - .../core/uncategorised/366/output.json | 109 ++++ .../core/uncategorised/367/options.json | 3 - .../core/uncategorised/367/output.json | 110 ++++ .../core/uncategorised/368/options.json | 3 - .../core/uncategorised/368/output.json | 123 ++++ .../core/uncategorised/369/options.json | 3 - .../core/uncategorised/369/output.json | 150 +++++ .../core/uncategorised/370/options.json | 3 - .../core/uncategorised/370/output.json | 90 +++ .../core/uncategorised/371/options.json | 3 - .../core/uncategorised/371/output.json | 90 +++ .../core/uncategorised/372/options.json | 3 - .../core/uncategorised/372/output.json | 90 +++ .../core/uncategorised/373/options.json | 3 - .../core/uncategorised/373/output.json | 90 +++ .../core/uncategorised/374/options.json | 3 - .../core/uncategorised/374/output.json | 197 +++++++ .../core/uncategorised/382/options.json | 3 - .../core/uncategorised/382/output.json | 108 ++++ .../core/uncategorised/383/options.json | 3 - .../core/uncategorised/383/output.json | 143 +++++ .../core/uncategorised/384/options.json | 3 - .../core/uncategorised/384/output.json | 124 ++++ .../core/uncategorised/397/options.json | 3 - .../core/uncategorised/397/output.json | 108 ++++ .../core/uncategorised/398/options.json | 3 - .../core/uncategorised/398/output.json | 108 ++++ .../core/uncategorised/399/options.json | 3 - .../core/uncategorised/399/output.json | 108 ++++ .../core/uncategorised/400/options.json | 3 - .../core/uncategorised/400/output.json | 108 ++++ .../core/uncategorised/401/options.json | 3 - .../core/uncategorised/401/output.json | 90 +++ .../core/uncategorised/402/options.json | 3 - .../core/uncategorised/402/output.json | 90 +++ .../core/uncategorised/403/options.json | 3 - .../core/uncategorised/403/output.json | 90 +++ .../core/uncategorised/404/options.json | 3 - .../core/uncategorised/404/output.json | 90 +++ .../core/uncategorised/409/options.json | 3 - .../core/uncategorised/409/output.json | 54 ++ .../core/uncategorised/411/options.json | 3 - .../core/uncategorised/411/output.json | 54 ++ .../core/uncategorised/417/options.json | 3 - .../core/uncategorised/417/output.json | 138 +++++ .../core/uncategorised/418/options.json | 3 - .../core/uncategorised/418/output.json | 119 ++++ .../core/uncategorised/425/options.json | 3 - .../core/uncategorised/425/output.json | 72 +++ .../core/uncategorised/427/options.json | 3 - .../core/uncategorised/427/output.json | 106 ++++ .../core/uncategorised/446/options.json | 3 - .../core/uncategorised/446/output.json | 71 +++ .../core/uncategorised/447/options.json | 3 - .../core/uncategorised/447/output.json | 70 +++ .../core/uncategorised/448/options.json | 3 - .../core/uncategorised/448/output.json | 70 +++ .../core/uncategorised/449/options.json | 3 - .../core/uncategorised/449/output.json | 70 +++ .../core/uncategorised/453/options.json | 4 +- .../core/uncategorised/454/options.json | 3 - .../core/uncategorised/454/output.json | 54 ++ .../core/uncategorised/455/options.json | 3 - .../core/uncategorised/455/output.json | 54 ++ .../core/uncategorised/456/options.json | 3 - .../core/uncategorised/456/output.json | 54 ++ .../core/uncategorised/457/options.json | 3 - .../core/uncategorised/457/output.json | 106 ++++ .../core/uncategorised/459/options.json | 3 - .../core/uncategorised/459/output.json | 119 ++++ .../core/uncategorised/460/options.json | 3 - .../core/uncategorised/460/output.json | 119 ++++ .../core/uncategorised/461/options.json | 3 - .../core/uncategorised/461/output.json | 207 +++++++ .../core/uncategorised/462/options.json | 3 - .../core/uncategorised/462/output.json | 207 +++++++ .../core/uncategorised/463/options.json | 3 - .../core/uncategorised/463/output.json | 191 ++++++ .../core/uncategorised/464/options.json | 3 - .../core/uncategorised/464/output.json | 191 ++++++ .../core/uncategorised/465/options.json | 3 - .../core/uncategorised/465/output.json | 199 +++++++ .../core/uncategorised/466/options.json | 3 - .../core/uncategorised/466/output.json | 195 ++++++ .../core/uncategorised/467/options.json | 3 - .../core/uncategorised/467/output.json | 193 ++++++ .../core/uncategorised/468/options.json | 3 - .../core/uncategorised/468/output.json | 197 +++++++ .../core/uncategorised/469/options.json | 3 - .../core/uncategorised/469/output.json | 197 +++++++ .../core/uncategorised/470/options.json | 3 - .../core/uncategorised/470/output.json | 209 +++++++ .../core/uncategorised/471/options.json | 3 - .../core/uncategorised/471/output.json | 209 +++++++ .../core/uncategorised/472/options.json | 3 - .../core/uncategorised/472/output.json | 195 ++++++ .../core/uncategorised/473/options.json | 3 - .../core/uncategorised/473/output.json | 195 ++++++ .../core/uncategorised/474/options.json | 3 - .../core/uncategorised/474/output.json | 176 ++++++ .../core/uncategorised/475/options.json | 3 - .../core/uncategorised/475/output.json | 176 ++++++ .../core/uncategorised/476/options.json | 3 - .../core/uncategorised/476/output.json | 176 ++++++ .../core/uncategorised/477/options.json | 3 - .../core/uncategorised/477/output.json | 176 ++++++ .../core/uncategorised/478/options.json | 3 - .../core/uncategorised/478/output.json | 176 ++++++ .../core/uncategorised/479/options.json | 3 - .../core/uncategorised/479/output.json | 176 ++++++ .../core/uncategorised/480/options.json | 3 - .../core/uncategorised/480/output.json | 176 ++++++ .../core/uncategorised/481/options.json | 3 - .../core/uncategorised/481/output.json | 176 ++++++ .../core/uncategorised/482/options.json | 3 - .../core/uncategorised/482/output.json | 180 ++++++ .../core/uncategorised/483/options.json | 3 - .../core/uncategorised/483/output.json | 180 ++++++ .../core/uncategorised/484/options.json | 3 - .../core/uncategorised/484/output.json | 126 ++++ .../core/uncategorised/485/options.json | 3 - .../core/uncategorised/485/output.json | 126 ++++ .../core/uncategorised/486/options.json | 3 - .../core/uncategorised/486/output.json | 214 +++++++ .../core/uncategorised/487/options.json | 3 - .../core/uncategorised/487/output.json | 214 +++++++ .../core/uncategorised/488/options.json | 3 - .../core/uncategorised/488/output.json | 161 +++++ .../core/uncategorised/489/options.json | 3 - .../core/uncategorised/489/output.json | 161 +++++ .../core/uncategorised/490/options.json | 3 - .../core/uncategorised/490/output.json | 250 ++++++++ .../core/uncategorised/491/options.json | 3 - .../core/uncategorised/491/output.json | 161 +++++ .../core/uncategorised/492/options.json | 3 - .../core/uncategorised/492/output.json | 292 +++++++++ .../core/uncategorised/493/options.json | 3 - .../core/uncategorised/493/output.json | 237 ++++++++ .../core/uncategorised/494/options.json | 3 - .../core/uncategorised/494/output.json | 268 +++++++++ .../core/uncategorised/495/options.json | 3 - .../core/uncategorised/495/output.json | 144 +++++ .../core/uncategorised/496/options.json | 3 - .../core/uncategorised/496/output.json | 144 +++++ .../core/uncategorised/497/options.json | 3 - .../core/uncategorised/497/output.json | 197 +++++++ .../core/uncategorised/498/options.json | 3 - .../core/uncategorised/498/output.json | 197 +++++++ .../core/uncategorised/499/options.json | 3 - .../core/uncategorised/499/output.json | 162 +++++ .../core/uncategorised/500/options.json | 3 - .../core/uncategorised/500/output.json | 163 +++++ .../core/uncategorised/501/options.json | 3 - .../core/uncategorised/501/output.json | 221 +++++++ .../core/uncategorised/502/options.json | 3 - .../core/uncategorised/502/output.json | 221 +++++++ .../core/uncategorised/503/options.json | 3 - .../core/uncategorised/503/output.json | 215 +++++++ .../core/uncategorised/504/options.json | 3 - .../core/uncategorised/504/output.json | 179 ++++++ .../core/uncategorised/505/options.json | 3 - .../core/uncategorised/505/output.json | 179 ++++++ .../core/uncategorised/506/options.json | 3 - .../core/uncategorised/506/output.json | 179 ++++++ .../core/uncategorised/507/options.json | 3 - .../core/uncategorised/507/output.json | 179 ++++++ .../core/uncategorised/508/options.json | 3 - .../core/uncategorised/508/output.json | 179 ++++++ .../core/uncategorised/509/options.json | 3 - .../core/uncategorised/509/output.json | 179 ++++++ .../core/uncategorised/510/options.json | 3 - .../core/uncategorised/510/output.json | 179 ++++++ .../core/uncategorised/511/options.json | 3 - .../core/uncategorised/511/output.json | 144 +++++ .../core/uncategorised/512/options.json | 3 - .../core/uncategorised/512/output.json | 126 ++++ .../core/uncategorised/513/options.json | 3 - .../core/uncategorised/513/output.json | 128 ++++ .../core/uncategorised/514/options.json | 3 - .../core/uncategorised/514/output.json | 161 +++++ .../core/uncategorised/515/options.json | 3 - .../core/uncategorised/515/output.json | 144 +++++ .../core/uncategorised/516/options.json | 3 - .../core/uncategorised/516/output.json | 144 +++++ .../core/uncategorised/517/options.json | 3 - .../core/uncategorised/517/output.json | 229 ++++++++ .../core/uncategorised/518/options.json | 3 - .../core/uncategorised/518/output.json | 180 ++++++ .../core/uncategorised/519/options.json | 3 - .../core/uncategorised/519/output.json | 233 ++++++++ .../core/uncategorised/520/options.json | 3 - .../core/uncategorised/520/output.json | 163 +++++ .../core/uncategorised/521/options.json | 3 - .../core/uncategorised/521/output.json | 163 +++++ .../core/uncategorised/522/options.json | 3 - .../core/uncategorised/522/output.json | 285 +++++++++ .../core/uncategorised/523/options.json | 3 - .../core/uncategorised/523/output.json | 108 ++++ .../core/uncategorised/524/options.json | 3 - .../core/uncategorised/524/output.json | 73 +++ .../core/uncategorised/544/options.json | 3 - .../core/uncategorised/544/output.json | 213 +++++++ .../core/uncategorised/545/options.json | 5 +- .../core/uncategorised/545/output.json | 177 ++++++ .../core/uncategorised/547/options.json | 3 - .../core/uncategorised/547/output.json | 213 +++++++ .../core/uncategorised/548/options.json | 5 +- .../core/uncategorised/548/output.json | 177 ++++++ .../core/uncategorised/550/options.json | 3 - .../core/uncategorised/550/output.json | 144 +++++ .../core/uncategorised/552/options.json | 3 - .../core/uncategorised/552/output.json | 144 +++++ .../core/uncategorised/556/options.json | 5 +- .../core/uncategorised/556/output.json | 228 +++++++ .../core/uncategorised/558/options.json | 5 +- .../core/uncategorised/558/output.json | 134 +++++ .../comma-after-rest/options.json | 3 - .../comma-after-rest/output.json | 137 +++++ .../comma-after-spread-for-in/options.json | 3 - .../comma-after-spread-for-in/output.json | 136 +++++ .../comma-after-spread-nested/options.json | 3 - .../comma-after-spread-nested/output.json | 154 +++++ .../comma-after-rest-param/options.json | 4 +- .../options.json | 3 - .../direct-super-in-object-method/output.json | 340 +++++++++++ .../options.json | 3 - .../output.json | 191 ++++++ .../options.json | 3 - .../output.json | 179 ++++++ .../options.json | 3 - .../output.json | 144 +++++ .../disallow-static-prototype/options.json | 3 - .../disallow-static-prototype/output.json | 144 +++++ .../getter-signature/options.json | 3 - .../getter-signature/output.json | 162 +++++ .../es2015/class/extends-strict/options.json | 3 - .../es2015/class/extends-strict/output.json | 237 ++++++++ .../destructuring/binding-this/options.json | 3 - .../destructuring/binding-this/output.json | 145 +++++ .../error-operator-for-default/options.json | 3 - .../error-operator-for-default/output.json | 158 +++++ .../parenthesized-lhs-array/options.json | 3 - .../parenthesized-lhs-array/output.json | 127 ++++ .../parenthesized-lhs-object/options.json | 3 - .../parenthesized-lhs-object/output.json | 165 ++++++ .../for-in/bare-initializer/options.json | 3 - .../for-in/bare-initializer/output.json | 187 ++++++ .../for-in/const-initializer/options.json | 3 - .../for-in/const-initializer/output.json | 154 +++++ .../for-in/let-initializer/options.json | 3 - .../es2015/for-in/let-initializer/output.json | 154 +++++ .../for-in/strict-initializer/options.json | 3 - .../for-in/strict-initializer/output.json | 190 ++++++ .../options.json | 3 - .../output.json | 171 ++++++ .../options.json | 3 - .../output.json | 209 +++++++ .../for-of/bare-initializer/options.json | 3 - .../for-of/bare-initializer/output.json | 188 ++++++ .../invalid-escape-yield/options.json | 4 +- .../generators/invalid-hanging/options.json | 3 - .../generators/invalid-hanging/output.json | 126 ++++ .../invalid-escape-seq-const/options.json | 3 - .../invalid-escape-seq-const/output.json | 108 ++++ .../invalid-escape-seq-export/options.json | 3 - .../invalid-escape-seq-export/output.json | 108 ++++ .../invalid-escape-seq-if/options.json | 3 - .../invalid-escape-seq-if/output.json | 87 +++ .../invalid-escape-seq-import/options.json | 3 - .../invalid-escape-seq-import/output.json | 108 ++++ .../invalid-escape-seq-null/options.json | 3 - .../invalid-escape-seq-null/output.json | 70 +++ .../invalid-escape-seq-true/options.json | 3 - .../invalid-escape-seq-true/output.json | 70 +++ .../options.json | 3 - .../let-as-identifier-strict-fail/output.json | 142 +++++ .../let-at-binding-list-fail-1/options.json | 3 - .../let-at-binding-list-fail-1/output.json | 159 +++++ .../let-at-binding-list-fail-2/options.json | 3 - .../let-at-binding-list-fail-2/output.json | 159 +++++ .../let-at-binding-list-fail-3/options.json | 3 - .../let-at-binding-list-fail-3/output.json | 121 ++++ .../let-at-binding-list-fail-4/options.json | 3 - .../let-at-binding-list-fail-4/output.json | 121 ++++ .../let-at-binding-list-fail-5/options.json | 3 - .../let-at-binding-list-fail-5/output.json | 89 +++ .../let-at-binding-list-fail-6/options.json | 3 - .../let-at-binding-list-fail-6/output.json | 108 ++++ .../let/let-at-catch-block/options.json | 3 - .../es2015/let/let-at-catch-block/output.json | 172 ++++++ .../invalid-arrow-function/options.json | 3 - .../invalid-arrow-function/output.json | 189 ++++++ .../new-invalid-prop/options.json | 3 - .../new-invalid-prop/output.json | 103 ++++ .../options.json | 3 - .../output.json | 156 +++++ .../options.json | 3 - .../output.json | 155 +++++ .../new-target-invalid/options.json | 3 - .../new-target-invalid/output.json | 102 ++++ .../options.json | 4 +- .../output.json | 173 ++++++ .../duplicate-export-default/options.json | 4 +- .../duplicate-export-default/output.json | 135 +++++ .../options.json | 4 +- .../output.json | 187 ++++++ .../options.json | 5 +- .../output.json | 280 +++++++++ .../options.json | 3 - .../output.json | 331 +++++++++++ .../options.json | 3 - .../output.json | 521 ++++++++++++++++ .../options.json | 3 - .../output.json | 504 ++++++++++++++++ .../options.json | 3 - .../output.json | 556 ++++++++++++++++++ .../options.json | 3 - .../output.json | 262 +++++++++ .../options.json | 3 - .../output.json | 262 +++++++++ .../options.json | 3 - .../output.json | 259 ++++++++ .../options.json | 3 - .../output.json | 259 ++++++++ .../options.json | 3 - .../output.json | 293 +++++++++ .../options.json | 3 - .../output.json | 311 ++++++++++ .../options.json | 3 - .../output.json | 262 +++++++++ .../options.json | 3 - .../output.json | 262 +++++++++ .../options.json | 3 - .../output.json | 224 +++++++ .../options.json | 3 - .../output.json | 224 +++++++ .../options.json | 3 - .../output.json | 279 +++++++++ .../options.json | 3 - .../output.json | 279 +++++++++ .../options.json | 3 - .../output.json | 259 ++++++++ .../options.json | 3 - .../output.json | 221 +++++++ .../options.json | 4 +- .../output.json | 190 ++++++ .../options.json | 4 +- .../output.json | 190 ++++++ .../duplicate-named-export/options.json | 4 +- .../duplicate-named-export/output.json | 176 ++++++ .../import-invalid-keyword-flow/options.json | 8 +- .../import-invalid-keyword-flow/output.json | 126 ++++ .../options.json | 8 +- .../output.json | 126 ++++ .../options.json | 4 +- .../import-invalid-keyword-typeof/output.json | 124 ++++ .../import-invalid-keyword/options.json | 4 +- .../import-invalid-keyword/output.json | 124 ++++ .../options.json | 3 - .../output.json | 165 ++++++ .../es2015/regex/duplicate-flags/options.json | 3 - .../es2015/regex/duplicate-flags/output.json | 73 +++ .../fixtures/es2015/shorthand/1/options.json | 3 - .../fixtures/es2015/shorthand/1/output.json | 164 ++++++ .../fixtures/es2015/shorthand/2/options.json | 3 - .../fixtures/es2015/shorthand/2/output.json | 240 ++++++++ .../label-invalid-const/options.json | 3 - .../label-invalid-const/output.json | 135 +++++ .../label-invalid-func-async/options.json | 3 - .../label-invalid-func-async/output.json | 122 ++++ .../label-invalid-func-generator/options.json | 3 - .../label-invalid-func-generator/output.json | 122 ++++ .../label-invalid-func-strict/options.json | 3 - .../label-invalid-func-strict/output.json | 211 +++++++ .../es2015/uncategorised/109/options.json | 3 - .../es2015/uncategorised/109/output.json | 207 +++++++ .../es2015/uncategorised/123/options.json | 3 - .../es2015/uncategorised/123/output.json | 246 ++++++++ .../es2015/uncategorised/125/input.js | 2 +- .../es2015/uncategorised/125/options.json | 3 - .../es2015/uncategorised/125/output.json | 203 +++++++ .../es2015/uncategorised/126/options.json | 3 - .../es2015/uncategorised/126/output.json | 144 +++++ .../es2015/uncategorised/127/options.json | 3 - .../es2015/uncategorised/127/output.json | 144 +++++ .../es2015/uncategorised/166/options.json | 3 - .../es2015/uncategorised/166/output.json | 180 ++++++ .../es2015/uncategorised/198/options.json | 3 - .../es2015/uncategorised/198/output.json | 73 +++ .../es2015/uncategorised/200/options.json | 3 - .../es2015/uncategorised/200/output.json | 73 +++ .../es2015/uncategorised/201/options.json | 3 - .../es2015/uncategorised/201/output.json | 73 +++ .../es2015/uncategorised/202/options.json | 3 - .../es2015/uncategorised/202/output.json | 73 +++ .../es2015/uncategorised/204/options.json | 3 - .../es2015/uncategorised/204/output.json | 73 +++ .../es2015/uncategorised/205/options.json | 3 - .../es2015/uncategorised/205/output.json | 73 +++ .../es2015/uncategorised/206/options.json | 3 - .../es2015/uncategorised/206/output.json | 73 +++ .../es2015/uncategorised/208/options.json | 3 - .../es2015/uncategorised/208/output.json | 73 +++ .../es2015/uncategorised/209/options.json | 3 - .../es2015/uncategorised/209/output.json | 73 +++ .../es2015/uncategorised/210/options.json | 3 - .../es2015/uncategorised/210/output.json | 73 +++ .../es2015/uncategorised/211/options.json | 3 - .../es2015/uncategorised/211/output.json | 73 +++ .../es2015/uncategorised/213/options.json | 3 - .../es2015/uncategorised/213/output.json | 73 +++ .../es2015/uncategorised/214/options.json | 3 - .../es2015/uncategorised/214/output.json | 73 +++ .../es2015/uncategorised/215/options.json | 3 - .../es2015/uncategorised/215/output.json | 73 +++ .../es2015/uncategorised/216/options.json | 4 +- .../es2015/uncategorised/217/options.json | 3 - .../es2015/uncategorised/217/output.json | 73 +++ .../es2015/uncategorised/218/options.json | 3 - .../es2015/uncategorised/218/output.json | 73 +++ .../es2015/uncategorised/219/options.json | 3 - .../es2015/uncategorised/219/output.json | 73 +++ .../es2015/uncategorised/220/options.json | 3 - .../es2015/uncategorised/220/output.json | 120 ++++ .../es2015/uncategorised/221/options.json | 3 - .../es2015/uncategorised/221/output.json | 127 ++++ .../es2015/uncategorised/222/options.json | 3 - .../es2015/uncategorised/222/output.json | 167 ++++++ .../es2015/uncategorised/223/options.json | 3 - .../es2015/uncategorised/223/output.json | 168 ++++++ .../es2015/uncategorised/226/options.json | 3 - .../es2015/uncategorised/226/output.json | 90 +++ .../es2015/uncategorised/227/options.json | 3 - .../es2015/uncategorised/227/output.json | 292 +++++++++ .../es2015/uncategorised/228/options.json | 3 - .../es2015/uncategorised/228/output.json | 254 ++++++++ .../es2015/uncategorised/229/options.json | 3 - .../es2015/uncategorised/229/output.json | 89 +++ .../es2015/uncategorised/230/options.json | 3 - .../es2015/uncategorised/230/output.json | 89 +++ .../es2015/uncategorised/231/options.json | 3 - .../es2015/uncategorised/231/output.json | 89 +++ .../es2015/uncategorised/232/input.js | 2 +- .../es2015/uncategorised/232/options.json | 3 - .../es2015/uncategorised/232/output.json | 108 ++++ .../es2015/uncategorised/233/options.json | 3 - .../es2015/uncategorised/233/output.json | 196 ++++++ .../es2015/uncategorised/234/options.json | 3 - .../es2015/uncategorised/234/output.json | 196 ++++++ .../es2015/uncategorised/235/options.json | 3 - .../es2015/uncategorised/235/output.json | 206 +++++++ .../es2015/uncategorised/236/options.json | 3 - .../es2015/uncategorised/236/output.json | 207 +++++++ .../es2015/uncategorised/242/options.json | 3 - .../es2015/uncategorised/242/output.json | 182 ++++++ .../es2015/uncategorised/243/options.json | 3 - .../es2015/uncategorised/243/output.json | 146 +++++ .../es2015/uncategorised/244/options.json | 3 - .../es2015/uncategorised/244/output.json | 146 +++++ .../es2015/uncategorised/245/options.json | 3 - .../es2015/uncategorised/245/output.json | 163 +++++ .../es2015/uncategorised/246/options.json | 3 - .../es2015/uncategorised/246/output.json | 163 +++++ .../es2015/uncategorised/247/options.json | 3 - .../es2015/uncategorised/247/output.json | 198 +++++++ .../es2015/uncategorised/248/options.json | 3 - .../es2015/uncategorised/248/output.json | 163 +++++ .../es2015/uncategorised/249/options.json | 3 - .../es2015/uncategorised/249/output.json | 146 +++++ .../es2015/uncategorised/251/options.json | 3 - .../es2015/uncategorised/251/output.json | 114 ++++ .../es2015/uncategorised/252/options.json | 3 - .../es2015/uncategorised/252/output.json | 136 +++++ .../es2015/uncategorised/280/options.json | 3 - .../es2015/uncategorised/280/output.json | 216 +++++++ .../es2015/uncategorised/281/options.json | 3 - .../es2015/uncategorised/281/output.json | 392 ++++++++++++ .../es2015/uncategorised/284/options.json | 3 - .../es2015/uncategorised/284/output.json | 128 ++++ .../es2015/uncategorised/289/options.json | 3 - .../es2015/uncategorised/289/output.json | 184 ++++++ .../es2015/uncategorised/290/options.json | 3 - .../es2015/uncategorised/290/output.json | 165 ++++++ .../es2015/uncategorised/291/options.json | 3 - .../es2015/uncategorised/291/output.json | 111 ++++ .../es2015/uncategorised/296/options.json | 3 - .../es2015/uncategorised/296/output.json | 146 +++++ .../es2015/uncategorised/297/options.json | 3 - .../es2015/uncategorised/297/output.json | 179 ++++++ .../es2015/uncategorised/298/options.json | 3 - .../es2015/uncategorised/298/output.json | 167 ++++++ .../es2015/uncategorised/324/options.json | 3 - .../es2015/uncategorised/324/output.json | 106 ++++ .../es2015/uncategorised/325/options.json | 3 - .../es2015/uncategorised/325/output.json | 106 ++++ .../es2015/uncategorised/329/options.json | 3 - .../es2015/uncategorised/329/output.json | 126 ++++ .../es2015/uncategorised/332/options.json | 3 - .../es2015/uncategorised/332/output.json | 171 ++++++ .../es2015/uncategorised/333/options.json | 3 - .../es2015/uncategorised/333/output.json | 231 ++++++++ .../es2015/uncategorised/334/options.json | 5 +- .../es2015/uncategorised/334/output.json | 135 +++++ .../es2015/uncategorised/339/options.json | 3 - .../es2015/uncategorised/339/output.json | 91 +++ .../es2015/uncategorised/344/options.json | 4 +- .../es2015/uncategorised/347/options.json | 3 - .../es2015/uncategorised/347/output.json | 179 ++++++ .../es2015/uncategorised/348/options.json | 3 - .../es2015/uncategorised/348/output.json | 184 ++++++ .../es2015/uncategorised/349/options.json | 3 - .../es2015/uncategorised/349/output.json | 187 ++++++ .../es2015/uncategorised/357/options.json | 5 +- .../es2015/uncategorised/357/output.json | 121 ++++ .../es2015/uncategorised/359/options.json | 5 +- .../es2015/uncategorised/359/output.json | 123 ++++ .../es2015/uncategorised/361/options.json | 5 +- .../es2015/uncategorised/361/output.json | 178 ++++++ .../es2015/uncategorised/363/options.json | 5 +- .../es2015/uncategorised/363/output.json | 165 ++++++ .../es2015/uncategorised/365/options.json | 5 +- .../es2015/uncategorised/365/output.json | 93 +++ .../es2015/uncategorised/367/options.json | 5 +- .../es2015/uncategorised/367/output.json | 89 +++ .../es2015/uncategorised/368/options.json | 5 +- .../es2015/uncategorised/368/output.json | 119 ++++ .../es2015/uncategorised/369/options.json | 5 +- .../es2015/uncategorised/369/output.json | 120 ++++ .../es2015/uncategorised/37/options.json | 3 - .../es2015/uncategorised/37/output.json | 161 +++++ .../es2015/uncategorised/370/options.json | 5 +- .../es2015/uncategorised/370/output.json | 121 ++++ .../es2015/uncategorised/371/options.json | 5 +- .../es2015/uncategorised/371/output.json | 122 ++++ .../es2015/uncategorised/372/options.json | 5 +- .../es2015/uncategorised/372/output.json | 176 ++++++ .../es2015/uncategorised/373/options.json | 5 +- .../es2015/uncategorised/373/output.json | 177 ++++++ .../es2015/uncategorised/374/options.json | 5 +- .../es2015/uncategorised/374/output.json | 163 +++++ .../es2015/uncategorised/375/options.json | 5 +- .../es2015/uncategorised/375/output.json | 164 ++++++ .../es2015/uncategorised/376/options.json | 5 +- .../es2015/uncategorised/376/output.json | 90 +++ .../es2015/uncategorised/377/options.json | 5 +- .../es2015/uncategorised/377/output.json | 92 +++ .../es2015/uncategorised/378/options.json | 5 +- .../es2015/uncategorised/378/output.json | 88 +++ .../es2015/uncategorised/379/options.json | 5 +- .../es2015/uncategorised/379/output.json | 88 +++ .../es2015/uncategorised/395/options.json | 5 +- .../es2015/uncategorised/395/output.json | 161 +++++ .../options.json | 3 - .../output.json | 143 +++++ .../options.json | 3 - .../output.json | 122 ++++ .../function-name-strict-body/options.json | 3 - .../function-name-strict-body/output.json | 126 ++++ .../yield/function-name-strict/options.json | 3 - .../yield/function-name-strict/output.json | 128 ++++ .../yield/in-class-heritage/options.json | 4 +- .../yield/in-iterator-stmt/options.json | 4 +- .../options.json | 3 - .../output.json | 192 ++++++ .../options.json | 3 - .../output.json | 331 +++++++++++ .../options.json | 3 - .../output.json | 208 +++++++ .../options.json | 3 - .../output.json | 261 ++++++++ .../options.json | 3 - .../output.json | 231 ++++++++ .../options.json | 3 - .../output.json | 196 ++++++ .../options.json | 3 - .../output.json | 182 ++++++ .../options.json | 3 - .../output.json | 141 +++++ .../parameter-default-strict/options.json | 3 - .../parameter-default-strict/output.json | 176 ++++++ .../options.json | 3 - .../output.json | 162 +++++ .../options.json | 3 - .../output.json | 178 ++++++ .../options.json | 3 - .../output.json | 196 ++++++ .../options.json | 3 - .../output.json | 148 +++++ .../parameter-name-generator/options.json | 3 - .../parameter-name-generator/output.json | 108 ++++ .../parameter-name-strict-body/options.json | 3 - .../parameter-name-strict-body/output.json | 144 +++++ .../yield/parameter-name-strict/options.json | 3 - .../yield/parameter-name-strict/output.json | 145 +++++ .../options.json | 3 - .../output.json | 158 +++++ .../exponentiation-operator/10/options.json | 3 - .../exponentiation-operator/10/output.json | 126 ++++ .../exponentiation-operator/11/options.json | 3 - .../exponentiation-operator/11/output.json | 128 ++++ .../exponentiation-operator/12/options.json | 3 - .../exponentiation-operator/12/output.json | 130 ++++ .../exponentiation-operator/15/options.json | 5 +- .../exponentiation-operator/15/output.json | 141 +++++ .../exponentiation-operator/16/options.json | 5 +- .../exponentiation-operator/16/output.json | 141 +++++ .../array-pattern-default/options.json | 3 - .../array-pattern-default/output.json | 209 +++++++ .../array-pattern/options.json | 3 - .../array-pattern/output.json | 178 ++++++ .../arrow-function/options.json | 3 - .../arrow-function/output.json | 209 +++++++ .../async-arrow-function/options.json | 3 - .../async-arrow-function/output.json | 209 +++++++ .../async-function/options.json | 3 - .../async-function/output.json | 175 ++++++ .../default/options.json | 3 - .../simple-parameter-list/default/output.json | 175 ++++++ .../generator-function/options.json | 3 - .../generator-function/output.json | 175 ++++++ .../generator-method/options.json | 3 - .../generator-method/output.json | 246 ++++++++ .../simple-parameter-list/method/options.json | 3 - .../simple-parameter-list/method/output.json | 246 ++++++++ .../object-pattern-default/options.json | 3 - .../object-pattern-default/output.json | 285 +++++++++ .../object-pattern/options.json | 3 - .../object-pattern/output.json | 254 ++++++++ .../simple-parameter-list/rest/options.json | 3 - .../simple-parameter-list/rest/output.json | 159 +++++ .../es2017/async-functions/2/options.json | 3 - .../es2017/async-functions/2/output.json | 154 +++++ .../options.json | 3 - .../output.json | 109 ++++ .../options.json | 3 - .../output.json | 231 ++++++++ .../options.json | 3 - .../output.json | 143 +++++ .../options.json | 3 - .../output.json | 277 +++++++++ .../options.json | 3 - .../output.json | 210 +++++++ .../options.json | 3 - .../output.json | 210 +++++++ .../await-inside-parameters/options.json | 3 - .../await-inside-parameters/output.json | 159 +++++ .../invalid-escape-await/options.json | 4 +- .../invalid-inside-loop/options.json | 3 - .../invalid-inside-loop/output.json | 125 ++++ .../no-constructor/options.json | 3 - .../no-constructor/output.json | 144 +++++ .../options.json | 3 - .../output.json | 122 ++++ .../es2018/object-rest-spread/11/options.json | 5 +- .../es2018/object-rest-spread/11/output.json | 297 ++++++++++ .../es2018/object-rest-spread/12/options.json | 5 +- .../es2018/object-rest-spread/12/output.json | 297 ++++++++++ .../es2018/object-rest-spread/13/options.json | 5 +- .../es2018/object-rest-spread/13/output.json | 349 +++++++++++ .../es2018/object-rest-spread/14/options.json | 5 +- .../es2018/object-rest-spread/14/output.json | 331 +++++++++++ .../es2018/object-rest-spread/15/options.json | 5 +- .../es2018/object-rest-spread/15/output.json | 348 +++++++++++ .../es2018/object-rest-spread/18/options.json | 3 - .../es2018/object-rest-spread/18/output.json | 137 +++++ .../es2018/object-rest-spread/21/options.json | 3 - .../es2018/object-rest-spread/21/output.json | 173 ++++++ .../es2018/object-rest-spread/24/options.json | 3 - .../es2018/object-rest-spread/24/output.json | 137 +++++ .../es2018/object-rest-spread/8/options.json | 3 - .../es2018/object-rest-spread/8/output.json | 250 ++++++++ .../dupe-param/options.json | 3 - .../dupe-param/output.json | 161 +++++ .../invalid-dup-param/options.json | 3 - .../invalid-dup-param/output.json | 193 ++++++ .../dupe-param-1/options.json | 3 - .../dupe-param-1/output.json | 178 ++++++ .../dupe-param-2/options.json | 3 - .../dupe-param-2/output.json | 193 ++++++ .../dupe-param-3/options.json | 3 - .../dupe-param-3/output.json | 248 ++++++++ .../options.json | 3 - .../output.json | 159 +++++ .../invalid-duplicated-params/options.json | 3 - .../invalid-duplicated-params/output.json | 124 ++++ .../invalid-param-strict-mode/options.json | 3 - .../invalid-param-strict-mode/output.json | 143 +++++ .../options.json | 3 - .../output.json | 199 +++++++ .../options.json | 3 - .../output.json | 167 ++++++ .../options.json | 3 - .../output.json | 539 +++++++++++++++++ .../invalid-lhs-01/options.json | 3 - .../invalid-lhs-01/output.json | 161 +++++ .../invalid-lhs-02/options.json | 3 - .../invalid-lhs-02/output.json | 161 +++++ .../invalid-pattern-with-method/options.json | 3 - .../invalid-pattern-with-method/output.json | 168 ++++++ .../invalid-group-assignment/options.json | 3 - .../invalid-group-assignment/output.json | 180 ++++++ .../invalid-export-named-default/options.json | 5 +- .../invalid-export-named-default/output.json | 107 ++++ .../invalid-const-init/options.json | 3 - .../invalid-const-init/output.json | 156 +++++ .../invalid-let-init/options.json | 3 - .../invalid-let-init/output.json | 156 +++++ .../invalid-lhs-init/options.json | 3 - .../invalid-lhs-init/output.json | 102 ++++ .../invalid-var-init/options.json | 3 - .../invalid-var-init/output.json | 156 +++++ .../options.json | 3 - .../output.json | 90 +++ .../invalid_expression_await/options.json | 3 - .../invalid_expression_await/output.json | 158 +++++ .../invalid_var_await/options.json | 3 - .../invalid_var_await/output.json | 106 ++++ .../options.json | 3 - .../output.json | 88 +++ .../invalid_const_forin/options.json | 3 - .../invalid_const_forin/output.json | 157 +++++ .../invalid_let_forin/options.json | 3 - .../invalid_let_forin/output.json | 157 +++++ .../invalid-new-target/options.json | 3 - .../invalid-new-target/output.json | 137 +++++ .../unknown-property/options.json | 3 - .../unknown-property/output.json | 189 ++++++ .../options.json | 3 - .../output.json | 234 ++++++++ .../options.json | 3 - .../output.json | 177 ++++++ .../invalid-proto-identifiers/options.json | 3 - .../invalid-proto-identifiers/output.json | 174 ++++++ .../options.json | 3 - .../output.json | 177 ++++++ .../invalid-proto-literals/options.json | 3 - .../invalid-proto-literals/output.json | 180 ++++++ .../options.json | 3 - .../output.json | 252 ++++++++ .../options.json | 3 - .../output.json | 120 ++++ .../invalid-escape/options.json | 3 - .../invalid-escape/output.json | 91 +++ .../options.json | 3 - .../output.json | 211 +++++++ .../options.json | 3 - .../output.json | 165 ++++++ .../options.json | 3 - .../output.json | 216 +++++++ .../options.json | 3 - .../invalid-yield-generator-catch/output.json | 173 ++++++ .../options.json | 3 - .../output.json | 143 +++++ .../options.json | 5 +- .../output.json | 107 ++++ .../options.json | 3 - .../output.json | 109 ++++ .../options.json | 3 - .../output.json | 111 ++++ .../options.json | 3 - .../output.json | 143 +++++ .../options.json | 3 - .../output.json | 143 +++++ .../options.json | 3 - .../output.json | 142 +++++ .../options.json | 3 - .../output.json | 108 ++++ .../invalid-yield-generator-rest/options.json | 3 - .../invalid-yield-generator-rest/output.json | 174 ++++++ .../options.json | 3 - .../output.json | 230 ++++++++ .../options.json | 3 - .../output.json | 232 ++++++++ .../options.json | 3 - .../output.json | 142 +++++ .../options.json | 3 - .../output.json | 161 +++++ .../options.json | 3 - .../output.json | 175 ++++++ .../options.json | 3 - .../output.json | 147 +++++ .../options.json | 3 - .../output.json | 194 ++++++ .../options.json | 3 - .../output.json | 157 +++++ .../options.json | 3 - .../output.json | 145 +++++ .../options.json | 3 - .../output.json | 126 ++++ .../options.json | 3 - .../output.json | 145 +++++ .../options.json | 3 - .../output.json | 159 +++++ .../options.json | 3 - .../output.json | 145 +++++ .../options.json | 3 - .../output.json | 160 +++++ .../options.json | 3 - .../output.json | 126 ++++ .../options.json | 3 - .../yield-generator-arrow-default/output.json | 192 ++++++ .../migrated_0012/input.js | 2 +- .../migrated_0012/options.json | 3 - .../migrated_0012/output.json | 70 +++ .../invalid-syntax/GH-1106-00/options.json | 3 - .../invalid-syntax/GH-1106-00/output.json | 73 +++ .../invalid-syntax/GH-1106-01/options.json | 3 - .../invalid-syntax/GH-1106-01/output.json | 73 +++ .../invalid-syntax/GH-1106-02/options.json | 3 - .../invalid-syntax/GH-1106-02/output.json | 73 +++ .../invalid-syntax/GH-1106-03/options.json | 3 - .../invalid-syntax/GH-1106-03/output.json | 73 +++ .../invalid-syntax/GH-1106-04/options.json | 3 - .../invalid-syntax/GH-1106-04/output.json | 73 +++ .../invalid-syntax/GH-1106-05/options.json | 3 - .../invalid-syntax/GH-1106-05/output.json | 73 +++ .../invalid-syntax/GH-1106-06/options.json | 3 - .../invalid-syntax/GH-1106-06/output.json | 73 +++ .../invalid-syntax/GH-1106-07/options.json | 3 - .../invalid-syntax/GH-1106-07/output.json | 73 +++ .../invalid-syntax/migrated_0002/options.json | 4 +- .../invalid-syntax/migrated_0004/options.json | 3 - .../invalid-syntax/migrated_0004/output.json | 73 +++ .../invalid-syntax/migrated_0005/options.json | 3 - .../invalid-syntax/migrated_0005/output.json | 73 +++ .../invalid-syntax/migrated_0006/options.json | 3 - .../invalid-syntax/migrated_0006/output.json | 73 +++ .../invalid-syntax/migrated_0009/options.json | 3 - .../invalid-syntax/migrated_0009/output.json | 73 +++ .../invalid-syntax/migrated_0012/options.json | 3 - .../invalid-syntax/migrated_0012/output.json | 73 +++ .../invalid-syntax/migrated_0013/options.json | 3 - .../invalid-syntax/migrated_0013/output.json | 73 +++ .../invalid-syntax/migrated_0014/options.json | 3 - .../invalid-syntax/migrated_0014/output.json | 73 +++ .../invalid-syntax/migrated_0015/options.json | 3 - .../invalid-syntax/migrated_0015/output.json | 73 +++ .../invalid-syntax/migrated_0017/options.json | 3 - .../invalid-syntax/migrated_0017/output.json | 73 +++ .../invalid-syntax/migrated_0019/options.json | 3 - .../invalid-syntax/migrated_0019/output.json | 73 +++ .../invalid-syntax/migrated_0020/options.json | 3 - .../invalid-syntax/migrated_0020/output.json | 73 +++ .../invalid-syntax/migrated_0021/options.json | 3 - .../invalid-syntax/migrated_0021/output.json | 73 +++ .../invalid-syntax/migrated_0022/options.json | 3 - .../invalid-syntax/migrated_0022/output.json | 73 +++ .../invalid-syntax/migrated_0024/options.json | 3 - .../invalid-syntax/migrated_0024/output.json | 73 +++ .../invalid-syntax/migrated_0025/options.json | 3 - .../invalid-syntax/migrated_0025/output.json | 73 +++ .../invalid-syntax/migrated_0026/options.json | 3 - .../invalid-syntax/migrated_0026/output.json | 73 +++ .../invalid-syntax/migrated_0027/options.json | 3 - .../invalid-syntax/migrated_0027/output.json | 73 +++ .../invalid-syntax/migrated_0028/options.json | 3 - .../invalid-syntax/migrated_0028/output.json | 73 +++ .../invalid-syntax/migrated_0032/options.json | 3 - .../invalid-syntax/migrated_0032/output.json | 70 +++ .../invalid-syntax/migrated_0033/options.json | 3 - .../invalid-syntax/migrated_0033/output.json | 71 +++ .../invalid-syntax/migrated_0034/options.json | 3 - .../invalid-syntax/migrated_0034/output.json | 71 +++ .../invalid-syntax/migrated_0036/options.json | 3 - .../invalid-syntax/migrated_0036/output.json | 72 +++ .../invalid-syntax/migrated_0037/options.json | 3 - .../invalid-syntax/migrated_0037/output.json | 72 +++ .../invalid-syntax/migrated_0041/options.json | 3 - .../invalid-syntax/migrated_0041/output.json | 110 ++++ .../invalid-syntax/migrated_0042/options.json | 3 - .../invalid-syntax/migrated_0042/output.json | 110 ++++ .../invalid-syntax/migrated_0043/options.json | 3 - .../invalid-syntax/migrated_0043/output.json | 112 ++++ .../invalid-syntax/migrated_0044/options.json | 3 - .../invalid-syntax/migrated_0044/output.json | 115 ++++ .../invalid-syntax/migrated_0045/options.json | 3 - .../invalid-syntax/migrated_0045/output.json | 110 ++++ .../invalid-syntax/migrated_0046/options.json | 3 - .../invalid-syntax/migrated_0046/output.json | 123 ++++ .../invalid-syntax/migrated_0047/options.json | 3 - .../invalid-syntax/migrated_0047/output.json | 150 +++++ .../invalid-syntax/migrated_0048/input.js | 2 +- .../invalid-syntax/migrated_0048/options.json | 4 +- .../invalid-syntax/migrated_0049/input.js | 2 +- .../invalid-syntax/migrated_0049/options.json | 3 - .../invalid-syntax/migrated_0049/output.json | 71 +++ .../invalid-syntax/migrated_0050/input.js | 2 +- .../invalid-syntax/migrated_0050/options.json | 3 - .../invalid-syntax/migrated_0050/output.json | 71 +++ .../invalid-syntax/migrated_0051/input.js | 2 +- .../invalid-syntax/migrated_0051/options.json | 3 - .../invalid-syntax/migrated_0051/output.json | 71 +++ .../invalid-syntax/migrated_0052/options.json | 3 - .../invalid-syntax/migrated_0052/output.json | 90 +++ .../invalid-syntax/migrated_0053/options.json | 3 - .../invalid-syntax/migrated_0053/output.json | 90 +++ .../invalid-syntax/migrated_0054/options.json | 3 - .../invalid-syntax/migrated_0054/output.json | 90 +++ .../invalid-syntax/migrated_0055/options.json | 3 - .../invalid-syntax/migrated_0055/output.json | 90 +++ .../invalid-syntax/migrated_0056/options.json | 3 - .../invalid-syntax/migrated_0056/output.json | 197 +++++++ .../invalid-syntax/migrated_0064/options.json | 3 - .../invalid-syntax/migrated_0064/output.json | 108 ++++ .../invalid-syntax/migrated_0066/options.json | 3 - .../invalid-syntax/migrated_0066/output.json | 143 +++++ .../invalid-syntax/migrated_0067/options.json | 3 - .../invalid-syntax/migrated_0067/output.json | 124 ++++ .../invalid-syntax/migrated_0075/options.json | 7 +- .../invalid-syntax/migrated_0087/options.json | 3 - .../invalid-syntax/migrated_0087/output.json | 182 ++++++ .../invalid-syntax/migrated_0088/options.json | 3 - .../invalid-syntax/migrated_0088/output.json | 146 +++++ .../invalid-syntax/migrated_0089/options.json | 3 - .../invalid-syntax/migrated_0089/output.json | 146 +++++ .../invalid-syntax/migrated_0090/options.json | 3 - .../invalid-syntax/migrated_0090/output.json | 163 +++++ .../invalid-syntax/migrated_0091/options.json | 3 - .../invalid-syntax/migrated_0091/output.json | 163 +++++ .../invalid-syntax/migrated_0092/options.json | 3 - .../invalid-syntax/migrated_0092/output.json | 127 ++++ .../invalid-syntax/migrated_0093/options.json | 3 - .../invalid-syntax/migrated_0093/output.json | 163 +++++ .../invalid-syntax/migrated_0094/options.json | 3 - .../invalid-syntax/migrated_0094/output.json | 146 +++++ .../invalid-syntax/migrated_0098/options.json | 3 - .../invalid-syntax/migrated_0098/output.json | 114 ++++ .../invalid-syntax/migrated_0099/options.json | 3 - .../invalid-syntax/migrated_0099/output.json | 136 +++++ .../invalid-syntax/migrated_0100/options.json | 3 - .../invalid-syntax/migrated_0100/output.json | 146 +++++ .../invalid-syntax/migrated_0101/options.json | 3 - .../invalid-syntax/migrated_0101/output.json | 179 ++++++ .../invalid-syntax/migrated_0116/options.json | 3 - .../invalid-syntax/migrated_0116/output.json | 54 ++ .../invalid-syntax/migrated_0118/options.json | 3 - .../invalid-syntax/migrated_0118/output.json | 54 ++ .../invalid-syntax/migrated_0125/options.json | 3 - .../invalid-syntax/migrated_0125/output.json | 138 +++++ .../invalid-syntax/migrated_0126/options.json | 3 - .../invalid-syntax/migrated_0126/output.json | 119 ++++ .../invalid-syntax/migrated_0133/options.json | 3 - .../invalid-syntax/migrated_0133/output.json | 72 +++ .../invalid-syntax/migrated_0137/options.json | 3 - .../invalid-syntax/migrated_0137/output.json | 106 ++++ .../invalid-syntax/migrated_0142/options.json | 3 - .../invalid-syntax/migrated_0142/output.json | 140 +++++ .../invalid-syntax/migrated_0143/options.json | 3 - .../invalid-syntax/migrated_0143/output.json | 106 ++++ .../invalid-syntax/migrated_0162/options.json | 3 - .../invalid-syntax/migrated_0162/output.json | 71 +++ .../invalid-syntax/migrated_0163/options.json | 3 - .../invalid-syntax/migrated_0163/output.json | 71 +++ .../invalid-syntax/migrated_0164/options.json | 3 - .../invalid-syntax/migrated_0164/output.json | 70 +++ .../invalid-syntax/migrated_0165/options.json | 3 - .../invalid-syntax/migrated_0165/output.json | 71 +++ .../invalid-syntax/migrated_0166/options.json | 3 - .../invalid-syntax/migrated_0166/output.json | 102 ++++ .../invalid-syntax/migrated_0167/options.json | 3 - .../invalid-syntax/migrated_0167/output.json | 102 ++++ .../invalid-syntax/migrated_0171/options.json | 3 - .../invalid-syntax/migrated_0171/output.json | 54 ++ .../invalid-syntax/migrated_0172/options.json | 3 - .../invalid-syntax/migrated_0172/output.json | 54 ++ .../invalid-syntax/migrated_0173/options.json | 3 - .../invalid-syntax/migrated_0173/output.json | 54 ++ .../invalid-syntax/migrated_0174/options.json | 3 - .../invalid-syntax/migrated_0174/output.json | 106 ++++ .../invalid-syntax/migrated_0176/options.json | 3 - .../invalid-syntax/migrated_0176/output.json | 119 ++++ .../invalid-syntax/migrated_0177/options.json | 3 - .../invalid-syntax/migrated_0177/output.json | 119 ++++ .../invalid-syntax/migrated_0178/options.json | 3 - .../invalid-syntax/migrated_0178/output.json | 207 +++++++ .../invalid-syntax/migrated_0179/options.json | 3 - .../invalid-syntax/migrated_0179/output.json | 207 +++++++ .../invalid-syntax/migrated_0180/options.json | 3 - .../invalid-syntax/migrated_0180/output.json | 191 ++++++ .../invalid-syntax/migrated_0181/options.json | 3 - .../invalid-syntax/migrated_0181/output.json | 191 ++++++ .../invalid-syntax/migrated_0182/options.json | 3 - .../invalid-syntax/migrated_0182/output.json | 199 +++++++ .../invalid-syntax/migrated_0183/options.json | 3 - .../invalid-syntax/migrated_0183/output.json | 195 ++++++ .../invalid-syntax/migrated_0184/options.json | 3 - .../invalid-syntax/migrated_0184/output.json | 193 ++++++ .../invalid-syntax/migrated_0185/options.json | 3 - .../invalid-syntax/migrated_0185/output.json | 197 +++++++ .../invalid-syntax/migrated_0186/options.json | 3 - .../invalid-syntax/migrated_0186/output.json | 197 +++++++ .../invalid-syntax/migrated_0187/options.json | 3 - .../invalid-syntax/migrated_0187/output.json | 209 +++++++ .../invalid-syntax/migrated_0188/options.json | 3 - .../invalid-syntax/migrated_0188/output.json | 209 +++++++ .../invalid-syntax/migrated_0189/options.json | 3 - .../invalid-syntax/migrated_0189/output.json | 195 ++++++ .../invalid-syntax/migrated_0190/options.json | 3 - .../invalid-syntax/migrated_0190/output.json | 195 ++++++ .../invalid-syntax/migrated_0191/options.json | 3 - .../invalid-syntax/migrated_0191/output.json | 176 ++++++ .../invalid-syntax/migrated_0192/options.json | 3 - .../invalid-syntax/migrated_0192/output.json | 176 ++++++ .../invalid-syntax/migrated_0193/options.json | 3 - .../invalid-syntax/migrated_0193/output.json | 176 ++++++ .../invalid-syntax/migrated_0194/options.json | 3 - .../invalid-syntax/migrated_0194/output.json | 176 ++++++ .../invalid-syntax/migrated_0195/options.json | 3 - .../invalid-syntax/migrated_0195/output.json | 176 ++++++ .../invalid-syntax/migrated_0196/options.json | 3 - .../invalid-syntax/migrated_0196/output.json | 176 ++++++ .../invalid-syntax/migrated_0197/options.json | 3 - .../invalid-syntax/migrated_0197/output.json | 176 ++++++ .../invalid-syntax/migrated_0198/options.json | 3 - .../invalid-syntax/migrated_0198/output.json | 176 ++++++ .../invalid-syntax/migrated_0199/options.json | 3 - .../invalid-syntax/migrated_0199/output.json | 180 ++++++ .../invalid-syntax/migrated_0200/options.json | 3 - .../invalid-syntax/migrated_0200/output.json | 180 ++++++ .../invalid-syntax/migrated_0201/options.json | 3 - .../invalid-syntax/migrated_0201/output.json | 126 ++++ .../invalid-syntax/migrated_0202/options.json | 3 - .../invalid-syntax/migrated_0202/output.json | 126 ++++ .../invalid-syntax/migrated_0203/options.json | 3 - .../invalid-syntax/migrated_0203/output.json | 214 +++++++ .../invalid-syntax/migrated_0204/options.json | 3 - .../invalid-syntax/migrated_0204/output.json | 214 +++++++ .../invalid-syntax/migrated_0205/options.json | 3 - .../invalid-syntax/migrated_0205/output.json | 161 +++++ .../invalid-syntax/migrated_0206/options.json | 3 - .../invalid-syntax/migrated_0206/output.json | 161 +++++ .../invalid-syntax/migrated_0207/options.json | 3 - .../invalid-syntax/migrated_0207/output.json | 250 ++++++++ .../invalid-syntax/migrated_0208/options.json | 3 - .../invalid-syntax/migrated_0208/output.json | 161 +++++ .../invalid-syntax/migrated_0209/options.json | 3 - .../invalid-syntax/migrated_0209/output.json | 292 +++++++++ .../invalid-syntax/migrated_0210/options.json | 3 - .../invalid-syntax/migrated_0210/output.json | 237 ++++++++ .../invalid-syntax/migrated_0211/options.json | 3 - .../invalid-syntax/migrated_0211/output.json | 268 +++++++++ .../invalid-syntax/migrated_0212/options.json | 3 - .../invalid-syntax/migrated_0212/output.json | 144 +++++ .../invalid-syntax/migrated_0213/options.json | 3 - .../invalid-syntax/migrated_0213/output.json | 144 +++++ .../invalid-syntax/migrated_0214/options.json | 3 - .../invalid-syntax/migrated_0214/output.json | 197 +++++++ .../invalid-syntax/migrated_0215/options.json | 3 - .../invalid-syntax/migrated_0215/output.json | 197 +++++++ .../invalid-syntax/migrated_0216/options.json | 3 - .../invalid-syntax/migrated_0216/output.json | 108 ++++ .../invalid-syntax/migrated_0217/options.json | 3 - .../invalid-syntax/migrated_0217/output.json | 162 +++++ .../invalid-syntax/migrated_0218/options.json | 3 - .../invalid-syntax/migrated_0218/output.json | 163 +++++ .../invalid-syntax/migrated_0219/options.json | 3 - .../invalid-syntax/migrated_0219/output.json | 221 +++++++ .../invalid-syntax/migrated_0220/options.json | 3 - .../invalid-syntax/migrated_0220/output.json | 221 +++++++ .../invalid-syntax/migrated_0221/options.json | 3 - .../invalid-syntax/migrated_0221/output.json | 161 +++++ .../invalid-syntax/migrated_0222/options.json | 3 - .../invalid-syntax/migrated_0222/output.json | 197 +++++++ .../invalid-syntax/migrated_0223/options.json | 3 - .../invalid-syntax/migrated_0223/output.json | 215 +++++++ .../invalid-syntax/migrated_0224/options.json | 3 - .../invalid-syntax/migrated_0224/output.json | 179 ++++++ .../invalid-syntax/migrated_0225/options.json | 3 - .../invalid-syntax/migrated_0225/output.json | 179 ++++++ .../invalid-syntax/migrated_0226/options.json | 3 - .../invalid-syntax/migrated_0226/output.json | 179 ++++++ .../invalid-syntax/migrated_0227/options.json | 3 - .../invalid-syntax/migrated_0227/output.json | 179 ++++++ .../invalid-syntax/migrated_0228/options.json | 3 - .../invalid-syntax/migrated_0228/output.json | 179 ++++++ .../invalid-syntax/migrated_0229/options.json | 3 - .../invalid-syntax/migrated_0229/output.json | 179 ++++++ .../invalid-syntax/migrated_0230/options.json | 3 - .../invalid-syntax/migrated_0230/output.json | 179 ++++++ .../invalid-syntax/migrated_0231/options.json | 3 - .../invalid-syntax/migrated_0231/output.json | 179 ++++++ .../invalid-syntax/migrated_0232/options.json | 3 - .../invalid-syntax/migrated_0232/output.json | 179 ++++++ .../invalid-syntax/migrated_0233/options.json | 3 - .../invalid-syntax/migrated_0233/output.json | 144 +++++ .../invalid-syntax/migrated_0234/options.json | 3 - .../invalid-syntax/migrated_0234/output.json | 126 ++++ .../invalid-syntax/migrated_0235/options.json | 3 - .../invalid-syntax/migrated_0235/output.json | 144 +++++ .../invalid-syntax/migrated_0236/options.json | 3 - .../invalid-syntax/migrated_0236/output.json | 144 +++++ .../invalid-syntax/migrated_0239/options.json | 3 - .../invalid-syntax/migrated_0239/output.json | 128 ++++ .../invalid-syntax/migrated_0240/options.json | 3 - .../invalid-syntax/migrated_0240/output.json | 161 +++++ .../invalid-syntax/migrated_0241/options.json | 3 - .../invalid-syntax/migrated_0241/output.json | 144 +++++ .../invalid-syntax/migrated_0242/options.json | 3 - .../invalid-syntax/migrated_0242/output.json | 144 +++++ .../invalid-syntax/migrated_0243/options.json | 3 - .../invalid-syntax/migrated_0243/output.json | 229 ++++++++ .../invalid-syntax/migrated_0244/options.json | 3 - .../invalid-syntax/migrated_0244/output.json | 180 ++++++ .../invalid-syntax/migrated_0245/options.json | 3 - .../invalid-syntax/migrated_0245/output.json | 233 ++++++++ .../invalid-syntax/migrated_0246/options.json | 3 - .../invalid-syntax/migrated_0246/output.json | 163 +++++ .../invalid-syntax/migrated_0247/options.json | 3 - .../invalid-syntax/migrated_0247/output.json | 163 +++++ .../invalid-syntax/migrated_0248/options.json | 3 - .../invalid-syntax/migrated_0248/output.json | 137 +++++ .../invalid-syntax/migrated_0249/options.json | 3 - .../invalid-syntax/migrated_0249/output.json | 161 +++++ .../invalid-syntax/migrated_0250/options.json | 3 - .../invalid-syntax/migrated_0250/output.json | 213 +++++++ .../invalid-syntax/migrated_0270/options.json | 3 - .../invalid-syntax/migrated_0270/output.json | 144 +++++ .../invalid-syntax/migrated_0271/options.json | 3 - .../invalid-syntax/migrated_0271/output.json | 147 +++++ .../invalid-syntax/migrated_0272/options.json | 3 - .../invalid-syntax/migrated_0272/output.json | 144 +++++ .../invalid-syntax/migrated_0273/options.json | 3 - .../invalid-syntax/migrated_0273/output.json | 162 +++++ .../invalid-syntax/migrated_0274/options.json | 3 - .../invalid-syntax/migrated_0274/output.json | 203 +++++++ .../invalid-syntax/migrated_0277/options.json | 3 - .../invalid-syntax/migrated_0277/output.json | 163 +++++ .../invalid-syntax/migrated_0278/options.json | 3 - .../invalid-syntax/migrated_0278/output.json | 144 +++++ .../invalid-setter-rest/options.json | 3 - .../invalid-setter-rest/output.json | 192 ++++++ .../migrated_0002/options.json | 3 - .../migrated_0002/output.json | 70 +++ .../migrated_0003/options.json | 3 - .../migrated_0003/output.json | 70 +++ .../migrated_0004/options.json | 3 - .../migrated_0004/output.json | 70 +++ .../migrated_0005/options.json | 3 - .../migrated_0005/output.json | 70 +++ .../options.json | 3 - .../complex-pattern-requires-init/output.json | 88 +++ .../bigint/invalid-decimal/options.json | 1 - .../bigint/invalid-decimal/output.json | 73 +++ .../bigint/invalid-e/options.json | 1 - .../experimental/bigint/invalid-e/output.json | 73 +++ .../options.json | 6 +- .../invalid-non-octal-decimal-int/output.json | 73 +++ .../bigint/invalid-octal-legacy/options.json | 1 - .../bigint/invalid-octal-legacy/output.json | 73 +++ .../failure-name-constructor/options.json | 7 +- .../failure-name-constructor/output.json | 158 +++++ .../failure-spaces/options.json | 1 - .../failure-spaces/output.json | 207 +++++++ .../options.json | 7 +- .../output.json | 289 +++++++++ .../failure-name-constructor/options.json | 7 +- .../failure-name-constructor/output.json | 137 +++++ .../failure-spaces/options.json | 3 +- .../failure-spaces/output.json | 137 +++++ .../super-call/options.json | 7 +- .../super-call/output.json | 306 ++++++++++ .../super-private-member-access/options.json | 5 +- .../super-private-member-access/output.json | 288 +++++++++ .../arguments-in-arrow-function/options.json | 7 +- .../arguments-in-arrow-function/output.json | 211 +++++++ .../class-properties/arguments/options.json | 7 +- .../class-properties/arguments/output.json | 192 ++++++ .../new-target-invalid/options.json | 7 +- .../new-target-invalid/output.json | 137 +++++ .../class-properties/no-ctor-2/options.json | 5 +- .../class-properties/no-ctor-2/output.json | 179 ++++++ .../class-properties/no-ctor/options.json | 5 +- .../class-properties/no-ctor/output.json | 123 ++++ .../no-static-prototype-2/options.json | 7 +- .../no-static-prototype-2/output.json | 179 ++++++ .../no-static-prototype/options.json | 7 +- .../no-static-prototype/output.json | 123 ++++ .../options.json | 7 +- .../output.json | 123 ++++ .../class-properties/super-call/options.json | 7 +- .../class-properties/super-call/output.json | 292 +++++++++ .../super-inside-function/options.json | 7 +- .../super-inside-function/output.json | 254 ++++++++ .../options.json | 14 +- .../output.json | 136 +++++ .../no-class-method-parameter/options.json | 3 - .../no-class-method-parameter/output.json | 196 ++++++ .../no-constructor-decorators/options.json | 3 - .../no-constructor-decorators/output.json | 179 ++++++ .../options.json | 3 +- .../no-export-decorators-on-class/output.json | 120 ++++ .../no-function-parameters/options.json | 3 - .../no-function-parameters/output.json | 142 +++++ .../no-object-method-parameters/options.json | 3 - .../no-object-method-parameters/output.json | 213 +++++++ .../no-object-methods/options.json | 12 +- .../no-constructor-decorators/options.json | 3 - .../no-constructor-decorators/output.json | 179 ++++++ .../direct-calls-only/options.json | 6 +- .../direct-calls-only/output.json | 172 ++++++ .../invalid-arguments-spread/options.json | 6 +- .../invalid-arguments-spread/output.json | 137 +++++ .../dynamic-import/invalid-new/options.json | 6 +- .../dynamic-import/invalid-new/output.json | 105 ++++ .../invalid-trailing-comma/options.json | 4 +- .../invalid-trailing-comma/output.json | 108 ++++ .../dynamic-import/multiple-args/options.json | 6 +- .../dynamic-import/multiple-args/output.json | 125 ++++ .../dynamic-import/no-args/options.json | 6 +- .../dynamic-import/no-args/output.json | 84 +++ .../import-meta/error-in-script/options.json | 8 +- .../import-meta/error-in-script/output.json | 137 +++++ .../no-other-prop-names/options.json | 8 +- .../no-other-prop-names/output.json | 102 ++++ .../import-meta/not-assignable/options.json | 8 +- .../import-meta/not-assignable/output.json | 135 +++++ .../numeric-separator/invalid-0/options.json | 1 - .../numeric-separator/invalid-0/output.json | 73 +++ .../numeric-separator/invalid-1/options.json | 1 - .../numeric-separator/invalid-1/output.json | 73 +++ .../numeric-separator/invalid-10/options.json | 1 - .../numeric-separator/invalid-10/output.json | 73 +++ .../invalid-100/options.json | 1 - .../numeric-separator/invalid-100/output.json | 75 +++ .../invalid-101/options.json | 1 - .../numeric-separator/invalid-101/output.json | 75 +++ .../invalid-102/options.json | 1 - .../numeric-separator/invalid-102/output.json | 76 +++ .../invalid-103/options.json | 1 - .../numeric-separator/invalid-103/output.json | 76 +++ .../invalid-104/options.json | 1 - .../numeric-separator/invalid-104/output.json | 75 +++ .../invalid-105/options.json | 1 - .../numeric-separator/invalid-105/output.json | 75 +++ .../invalid-106/options.json | 1 - .../numeric-separator/invalid-106/output.json | 75 +++ .../invalid-107/options.json | 1 - .../numeric-separator/invalid-107/output.json | 75 +++ .../invalid-108/options.json | 1 - .../numeric-separator/invalid-108/output.json | 75 +++ .../invalid-109/options.json | 1 - .../numeric-separator/invalid-109/output.json | 75 +++ .../numeric-separator/invalid-11/options.json | 1 - .../numeric-separator/invalid-11/output.json | 73 +++ .../invalid-110/options.json | 1 - .../numeric-separator/invalid-110/output.json | 75 +++ .../invalid-111/options.json | 1 - .../numeric-separator/invalid-111/output.json | 75 +++ .../invalid-112/options.json | 1 - .../numeric-separator/invalid-112/output.json | 75 +++ .../invalid-113/options.json | 1 - .../numeric-separator/invalid-113/output.json | 77 +++ .../invalid-114/options.json | 1 - .../numeric-separator/invalid-114/output.json | 77 +++ .../invalid-115/options.json | 1 - .../numeric-separator/invalid-115/output.json | 76 +++ .../invalid-116/options.json | 1 - .../numeric-separator/invalid-116/output.json | 75 +++ .../invalid-117/options.json | 1 - .../numeric-separator/invalid-117/output.json | 75 +++ .../invalid-118/options.json | 1 - .../numeric-separator/invalid-118/output.json | 76 +++ .../invalid-119/options.json | 1 - .../numeric-separator/invalid-119/output.json | 75 +++ .../numeric-separator/invalid-12/options.json | 1 - .../numeric-separator/invalid-12/output.json | 73 +++ .../invalid-120/options.json | 1 - .../numeric-separator/invalid-120/output.json | 76 +++ .../invalid-121/options.json | 1 - .../numeric-separator/invalid-121/output.json | 75 +++ .../invalid-122/options.json | 1 - .../numeric-separator/invalid-122/output.json | 75 +++ .../invalid-123/options.json | 1 - .../numeric-separator/invalid-123/output.json | 76 +++ .../invalid-124/options.json | 1 - .../numeric-separator/invalid-124/output.json | 91 +++ .../invalid-125/options.json | 1 - .../numeric-separator/invalid-125/output.json | 91 +++ .../invalid-126/options.json | 1 - .../numeric-separator/invalid-126/output.json | 92 +++ .../invalid-127/options.json | 1 - .../numeric-separator/invalid-127/output.json | 92 +++ .../invalid-128/options.json | 1 - .../numeric-separator/invalid-128/output.json | 91 +++ .../invalid-129/options.json | 1 - .../numeric-separator/invalid-129/output.json | 91 +++ .../numeric-separator/invalid-13/options.json | 1 - .../numeric-separator/invalid-13/output.json | 75 +++ .../invalid-130/options.json | 1 - .../numeric-separator/invalid-130/output.json | 91 +++ .../invalid-131/options.json | 1 - .../numeric-separator/invalid-131/output.json | 91 +++ .../invalid-132/options.json | 1 - .../numeric-separator/invalid-132/output.json | 91 +++ .../invalid-133/options.json | 1 - .../numeric-separator/invalid-133/output.json | 91 +++ .../invalid-134/options.json | 1 - .../numeric-separator/invalid-134/output.json | 91 +++ .../invalid-135/options.json | 1 - .../numeric-separator/invalid-135/output.json | 91 +++ .../invalid-136/options.json | 1 - .../numeric-separator/invalid-136/output.json | 91 +++ .../invalid-137/options.json | 1 - .../numeric-separator/invalid-137/output.json | 93 +++ .../invalid-138/options.json | 1 - .../numeric-separator/invalid-138/output.json | 93 +++ .../invalid-139/options.json | 1 - .../numeric-separator/invalid-139/output.json | 92 +++ .../numeric-separator/invalid-14/options.json | 1 - .../numeric-separator/invalid-14/output.json | 75 +++ .../invalid-140/options.json | 1 - .../numeric-separator/invalid-140/output.json | 91 +++ .../invalid-141/options.json | 1 - .../numeric-separator/invalid-141/output.json | 91 +++ .../invalid-142/options.json | 1 - .../numeric-separator/invalid-142/output.json | 92 +++ .../invalid-143/options.json | 1 - .../numeric-separator/invalid-143/output.json | 91 +++ .../invalid-144/options.json | 1 - .../numeric-separator/invalid-144/output.json | 92 +++ .../invalid-145/options.json | 1 - .../numeric-separator/invalid-145/output.json | 91 +++ .../invalid-146/options.json | 1 - .../numeric-separator/invalid-146/output.json | 91 +++ .../invalid-147/options.json | 1 - .../numeric-separator/invalid-147/output.json | 92 +++ .../numeric-separator/invalid-15/options.json | 1 - .../numeric-separator/invalid-15/output.json | 74 +++ .../numeric-separator/invalid-16/options.json | 1 - .../numeric-separator/invalid-16/output.json | 73 +++ .../numeric-separator/invalid-17/options.json | 1 - .../numeric-separator/invalid-17/output.json | 73 +++ .../numeric-separator/invalid-18/options.json | 1 - .../numeric-separator/invalid-18/output.json | 74 +++ .../numeric-separator/invalid-19/options.json | 1 - .../numeric-separator/invalid-19/output.json | 73 +++ .../numeric-separator/invalid-2/options.json | 1 - .../numeric-separator/invalid-2/output.json | 74 +++ .../numeric-separator/invalid-20/options.json | 1 - .../numeric-separator/invalid-20/output.json | 74 +++ .../numeric-separator/invalid-21/options.json | 1 - .../numeric-separator/invalid-21/output.json | 73 +++ .../numeric-separator/invalid-22/options.json | 1 - .../numeric-separator/invalid-22/output.json | 73 +++ .../numeric-separator/invalid-23/options.json | 1 - .../numeric-separator/invalid-23/output.json | 74 +++ .../numeric-separator/invalid-25/options.json | 1 - .../numeric-separator/invalid-25/output.json | 74 +++ .../numeric-separator/invalid-26/options.json | 1 - .../numeric-separator/invalid-26/output.json | 73 +++ .../numeric-separator/invalid-27/options.json | 4 +- .../numeric-separator/invalid-28/options.json | 1 - .../numeric-separator/invalid-28/output.json | 73 +++ .../numeric-separator/invalid-29/options.json | 1 - .../numeric-separator/invalid-29/output.json | 73 +++ .../numeric-separator/invalid-3/options.json | 1 - .../numeric-separator/invalid-3/output.json | 74 +++ .../numeric-separator/invalid-30/options.json | 1 - .../numeric-separator/invalid-30/output.json | 74 +++ .../numeric-separator/invalid-31/options.json | 1 - .../numeric-separator/invalid-31/output.json | 74 +++ .../numeric-separator/invalid-32/options.json | 1 - .../numeric-separator/invalid-32/output.json | 73 +++ .../numeric-separator/invalid-33/options.json | 1 - .../numeric-separator/invalid-33/output.json | 73 +++ .../numeric-separator/invalid-34/options.json | 1 - .../numeric-separator/invalid-34/output.json | 73 +++ .../numeric-separator/invalid-35/options.json | 1 - .../numeric-separator/invalid-35/output.json | 73 +++ .../numeric-separator/invalid-36/options.json | 1 - .../numeric-separator/invalid-36/output.json | 73 +++ .../numeric-separator/invalid-37/options.json | 1 - .../numeric-separator/invalid-37/output.json | 73 +++ .../numeric-separator/invalid-38/options.json | 1 - .../numeric-separator/invalid-38/output.json | 73 +++ .../numeric-separator/invalid-39/options.json | 1 - .../numeric-separator/invalid-39/output.json | 73 +++ .../numeric-separator/invalid-4/options.json | 1 - .../numeric-separator/invalid-4/output.json | 73 +++ .../numeric-separator/invalid-40/options.json | 1 - .../numeric-separator/invalid-40/output.json | 73 +++ .../numeric-separator/invalid-41/options.json | 1 - .../numeric-separator/invalid-41/output.json | 75 +++ .../numeric-separator/invalid-42/options.json | 1 - .../numeric-separator/invalid-42/output.json | 75 +++ .../numeric-separator/invalid-43/options.json | 1 - .../numeric-separator/invalid-43/output.json | 74 +++ .../numeric-separator/invalid-44/options.json | 1 - .../numeric-separator/invalid-44/output.json | 73 +++ .../numeric-separator/invalid-45/options.json | 1 - .../numeric-separator/invalid-45/output.json | 73 +++ .../numeric-separator/invalid-46/options.json | 1 - .../numeric-separator/invalid-46/output.json | 74 +++ .../numeric-separator/invalid-47/options.json | 1 - .../numeric-separator/invalid-47/output.json | 73 +++ .../numeric-separator/invalid-48/options.json | 1 - .../numeric-separator/invalid-48/output.json | 74 +++ .../numeric-separator/invalid-49/options.json | 1 - .../numeric-separator/invalid-49/output.json | 73 +++ .../numeric-separator/invalid-5/options.json | 1 - .../numeric-separator/invalid-5/output.json | 73 +++ .../numeric-separator/invalid-50/options.json | 1 - .../numeric-separator/invalid-50/output.json | 73 +++ .../numeric-separator/invalid-51/options.json | 1 - .../numeric-separator/invalid-51/output.json | 74 +++ .../numeric-separator/invalid-52/input.js | 2 +- .../numeric-separator/invalid-52/options.json | 1 - .../numeric-separator/invalid-52/output.json | 110 ++++ .../numeric-separator/invalid-53/input.js | 2 +- .../numeric-separator/invalid-53/options.json | 1 - .../numeric-separator/invalid-53/output.json | 110 ++++ .../numeric-separator/invalid-54/input.js | 2 +- .../numeric-separator/invalid-54/options.json | 1 - .../numeric-separator/invalid-54/output.json | 111 ++++ .../numeric-separator/invalid-55/input.js | 2 +- .../numeric-separator/invalid-55/options.json | 1 - .../numeric-separator/invalid-55/output.json | 111 ++++ .../numeric-separator/invalid-56/input.js | 2 +- .../numeric-separator/invalid-56/options.json | 1 - .../numeric-separator/invalid-56/output.json | 110 ++++ .../numeric-separator/invalid-57/input.js | 2 +- .../numeric-separator/invalid-57/options.json | 1 - .../numeric-separator/invalid-57/output.json | 110 ++++ .../numeric-separator/invalid-58/input.js | 2 +- .../numeric-separator/invalid-58/options.json | 1 - .../numeric-separator/invalid-58/output.json | 110 ++++ .../numeric-separator/invalid-59/input.js | 2 +- .../numeric-separator/invalid-59/options.json | 1 - .../numeric-separator/invalid-59/output.json | 110 ++++ .../numeric-separator/invalid-6/options.json | 1 - .../numeric-separator/invalid-6/output.json | 73 +++ .../numeric-separator/invalid-60/input.js | 2 +- .../numeric-separator/invalid-60/options.json | 1 - .../numeric-separator/invalid-60/output.json | 110 ++++ .../numeric-separator/invalid-61/input.js | 2 +- .../numeric-separator/invalid-61/options.json | 1 - .../numeric-separator/invalid-61/output.json | 110 ++++ .../numeric-separator/invalid-62/input.js | 2 +- .../numeric-separator/invalid-62/options.json | 1 - .../numeric-separator/invalid-62/output.json | 110 ++++ .../numeric-separator/invalid-63/input.js | 2 +- .../numeric-separator/invalid-63/options.json | 1 - .../numeric-separator/invalid-63/output.json | 110 ++++ .../numeric-separator/invalid-64/input.js | 2 +- .../numeric-separator/invalid-64/options.json | 1 - .../numeric-separator/invalid-64/output.json | 110 ++++ .../numeric-separator/invalid-65/input.js | 2 +- .../numeric-separator/invalid-65/options.json | 1 - .../numeric-separator/invalid-65/output.json | 112 ++++ .../numeric-separator/invalid-66/input.js | 2 +- .../numeric-separator/invalid-66/options.json | 1 - .../numeric-separator/invalid-66/output.json | 112 ++++ .../numeric-separator/invalid-67/input.js | 2 +- .../numeric-separator/invalid-67/options.json | 1 - .../numeric-separator/invalid-67/output.json | 111 ++++ .../numeric-separator/invalid-68/input.js | 2 +- .../numeric-separator/invalid-68/options.json | 1 - .../numeric-separator/invalid-68/output.json | 110 ++++ .../numeric-separator/invalid-69/input.js | 2 +- .../numeric-separator/invalid-69/options.json | 1 - .../numeric-separator/invalid-69/output.json | 110 ++++ .../numeric-separator/invalid-7/options.json | 1 - .../numeric-separator/invalid-7/output.json | 73 +++ .../numeric-separator/invalid-70/input.js | 2 +- .../numeric-separator/invalid-70/options.json | 1 - .../numeric-separator/invalid-70/output.json | 111 ++++ .../numeric-separator/invalid-71/input.js | 2 +- .../numeric-separator/invalid-71/options.json | 1 - .../numeric-separator/invalid-71/output.json | 110 ++++ .../numeric-separator/invalid-72/input.js | 2 +- .../numeric-separator/invalid-72/options.json | 1 - .../numeric-separator/invalid-72/output.json | 111 ++++ .../numeric-separator/invalid-73/input.js | 2 +- .../numeric-separator/invalid-73/options.json | 1 - .../numeric-separator/invalid-73/output.json | 110 ++++ .../numeric-separator/invalid-74/input.js | 2 +- .../numeric-separator/invalid-74/options.json | 1 - .../numeric-separator/invalid-74/output.json | 110 ++++ .../numeric-separator/invalid-75/input.js | 2 +- .../numeric-separator/invalid-75/options.json | 1 - .../numeric-separator/invalid-75/output.json | 111 ++++ .../numeric-separator/invalid-76/options.json | 1 - .../numeric-separator/invalid-76/output.json | 90 +++ .../numeric-separator/invalid-77/options.json | 1 - .../numeric-separator/invalid-77/output.json | 90 +++ .../numeric-separator/invalid-78/options.json | 1 - .../numeric-separator/invalid-78/output.json | 91 +++ .../numeric-separator/invalid-79/options.json | 1 - .../numeric-separator/invalid-79/output.json | 91 +++ .../numeric-separator/invalid-8/options.json | 1 - .../numeric-separator/invalid-8/output.json | 73 +++ .../numeric-separator/invalid-80/options.json | 1 - .../numeric-separator/invalid-80/output.json | 90 +++ .../numeric-separator/invalid-81/options.json | 1 - .../numeric-separator/invalid-81/output.json | 90 +++ .../numeric-separator/invalid-82/options.json | 1 - .../numeric-separator/invalid-82/output.json | 90 +++ .../numeric-separator/invalid-83/options.json | 1 - .../numeric-separator/invalid-83/output.json | 90 +++ .../numeric-separator/invalid-84/options.json | 1 - .../numeric-separator/invalid-84/output.json | 90 +++ .../numeric-separator/invalid-85/options.json | 1 - .../numeric-separator/invalid-85/output.json | 90 +++ .../numeric-separator/invalid-86/options.json | 1 - .../numeric-separator/invalid-86/output.json | 90 +++ .../numeric-separator/invalid-87/options.json | 1 - .../numeric-separator/invalid-87/output.json | 90 +++ .../numeric-separator/invalid-88/options.json | 1 - .../numeric-separator/invalid-88/output.json | 90 +++ .../numeric-separator/invalid-89/options.json | 1 - .../numeric-separator/invalid-89/output.json | 92 +++ .../numeric-separator/invalid-9/options.json | 1 - .../numeric-separator/invalid-9/output.json | 73 +++ .../numeric-separator/invalid-90/options.json | 1 - .../numeric-separator/invalid-90/output.json | 92 +++ .../numeric-separator/invalid-91/options.json | 1 - .../numeric-separator/invalid-91/output.json | 91 +++ .../numeric-separator/invalid-92/options.json | 1 - .../numeric-separator/invalid-92/output.json | 90 +++ .../numeric-separator/invalid-93/options.json | 1 - .../numeric-separator/invalid-93/output.json | 90 +++ .../numeric-separator/invalid-94/options.json | 1 - .../numeric-separator/invalid-94/output.json | 91 +++ .../numeric-separator/invalid-95/options.json | 1 - .../numeric-separator/invalid-95/output.json | 90 +++ .../numeric-separator/invalid-96/options.json | 1 - .../numeric-separator/invalid-96/output.json | 91 +++ .../numeric-separator/invalid-97/options.json | 1 - .../numeric-separator/invalid-97/output.json | 90 +++ .../numeric-separator/invalid-98/options.json | 1 - .../numeric-separator/invalid-98/output.json | 90 +++ .../numeric-separator/invalid-99/options.json | 1 - .../numeric-separator/invalid-99/output.json | 91 +++ .../invalid-hex/options.json | 7 +- .../numeric-separator/invalid-hex/output.json | 73 +++ .../invalid-leading-zero/options.json | 7 +- .../invalid-leading-zero/output.json | 73 +++ .../invalid-legacy-octal-literal/options.json | 7 +- .../invalid-legacy-octal-literal/output.json | 73 +++ .../options.json | 7 +- .../invalid-non-octal-decimal-int/output.json | 74 +++ .../invalid-unicode-2/options.json | 7 +- .../invalid-unicode-2/output.json | 73 +++ .../invalid-unicode/options.json | 7 +- .../invalid-unicode/output.json | 73 +++ .../class-contructor-call/options.json | 7 +- .../class-contructor-call/output.json | 154 +++++ .../optional-constructor/options.json | 7 +- .../optional-constructor/output.json | 86 +++ .../options.json | 7 +- .../output.json | 157 +++++ .../in-SuperCall/options.json | 7 +- .../in-SuperCall/output.json | 390 ++++++++++++ .../partial-application/in-new/options.json | 7 +- .../partial-application/in-new/output.json | 155 +++++ .../options.json | 12 +- .../output.json | 162 +++++ .../options.json | 3 +- .../output.json | 207 +++++++ .../options.json | 3 +- .../output.json | 241 ++++++++ .../options.json | 3 +- .../output.json | 205 +++++++ .../options.json | 3 +- .../output.json | 184 ++++++ .../options.json | 3 +- .../output.json | 170 ++++++ .../options.json | 12 +- .../output.json | 203 +++++++ .../options.json | 12 +- .../output.json | 155 +++++ .../options.json | 3 +- .../output.json | 151 +++++ .../options.json | 3 +- .../output.json | 151 +++++ .../options.json | 3 +- .../output.json | 134 +++++ .../options.json | 3 +- .../output.json | 172 ++++++ .../input.js | 2 +- .../options.json | 3 +- .../output.json | 266 +++++++++ .../options.json | 3 +- .../output.json | 302 ++++++++++ .../options.json | 3 +- .../output.json | 353 +++++++++++ .../options.json | 3 +- .../output.json | 214 +++++++ .../options.json | 3 +- .../output.json | 215 +++++++ .../options.json | 3 +- .../output.json | 412 +++++++++++++ .../options.json | 3 +- .../output.json | 266 +++++++++ .../options.json | 3 +- .../output.json | 196 ++++++ .../options.json | 3 +- .../output.json | 287 +++++++++ .../options.json | 3 +- .../output.json | 169 ++++++ .../options.json | 3 +- .../output.json | 215 +++++++ .../1/options.json | 3 - .../1/output.json | 91 +++ .../10/options.json | 3 - .../10/output.json | 132 +++++ .../11/options.json | 3 - .../11/output.json | 132 +++++ .../12/options.json | 3 - .../12/output.json | 172 ++++++ .../13/options.json | 3 - .../13/output.json | 91 +++ .../14/options.json | 3 - .../14/output.json | 132 +++++ .../15/options.json | 3 - .../15/output.json | 132 +++++ .../16/options.json | 3 - .../16/output.json | 172 ++++++ .../17/options.json | 3 - .../17/output.json | 91 +++ .../18/options.json | 3 - .../18/output.json | 132 +++++ .../19/options.json | 3 - .../19/output.json | 132 +++++ .../2/options.json | 3 - .../2/output.json | 132 +++++ .../20/options.json | 3 - .../20/output.json | 172 ++++++ .../21/options.json | 3 - .../21/output.json | 91 +++ .../22/options.json | 3 - .../22/output.json | 132 +++++ .../23/options.json | 3 - .../23/output.json | 132 +++++ .../24/options.json | 3 - .../24/output.json | 172 ++++++ .../25/options.json | 3 - .../25/output.json | 91 +++ .../26/options.json | 3 - .../26/output.json | 132 +++++ .../27/options.json | 3 - .../27/output.json | 132 +++++ .../28/options.json | 3 - .../28/output.json | 172 ++++++ .../29/options.json | 3 - .../29/output.json | 91 +++ .../3/options.json | 3 - .../3/output.json | 132 +++++ .../30/options.json | 3 - .../30/output.json | 132 +++++ .../31/options.json | 3 - .../31/output.json | 132 +++++ .../32/options.json | 3 - .../32/output.json | 172 ++++++ .../33/options.json | 3 - .../33/output.json | 91 +++ .../34/options.json | 3 - .../34/output.json | 132 +++++ .../35/options.json | 3 - .../35/output.json | 132 +++++ .../36/options.json | 3 - .../36/output.json | 172 ++++++ .../37/options.json | 3 - .../37/output.json | 91 +++ .../38/options.json | 3 - .../38/output.json | 132 +++++ .../39/options.json | 3 - .../39/output.json | 132 +++++ .../4/options.json | 3 - .../4/output.json | 172 ++++++ .../40/options.json | 3 - .../40/output.json | 172 ++++++ .../41/options.json | 3 - .../41/output.json | 91 +++ .../42/options.json | 3 - .../42/output.json | 132 +++++ .../43/options.json | 3 - .../43/output.json | 132 +++++ .../44/options.json | 3 - .../44/output.json | 172 ++++++ .../45/options.json | 3 - .../45/output.json | 91 +++ .../46/options.json | 3 - .../46/output.json | 132 +++++ .../47/options.json | 3 - .../47/output.json | 132 +++++ .../48/options.json | 3 - .../48/output.json | 172 ++++++ .../49/options.json | 3 - .../49/output.json | 91 +++ .../5/options.json | 3 - .../5/output.json | 91 +++ .../50/options.json | 3 - .../50/output.json | 132 +++++ .../51/options.json | 3 - .../51/output.json | 132 +++++ .../52/options.json | 3 - .../52/output.json | 172 ++++++ .../53/options.json | 3 - .../53/output.json | 91 +++ .../54/options.json | 3 - .../54/output.json | 132 +++++ .../55/options.json | 3 - .../55/output.json | 132 +++++ .../56/options.json | 3 - .../56/output.json | 172 ++++++ .../57/options.json | 3 - .../57/output.json | 91 +++ .../58/options.json | 3 - .../58/output.json | 132 +++++ .../59/options.json | 3 - .../59/output.json | 132 +++++ .../6/options.json | 3 - .../6/output.json | 132 +++++ .../60/options.json | 3 - .../60/output.json | 172 ++++++ .../61/options.json | 3 - .../61/output.json | 91 +++ .../62/options.json | 3 - .../62/output.json | 132 +++++ .../63/options.json | 3 - .../63/output.json | 132 +++++ .../64/options.json | 3 - .../64/output.json | 172 ++++++ .../65/options.json | 3 - .../65/output.json | 91 +++ .../66/options.json | 3 - .../66/output.json | 132 +++++ .../67/options.json | 3 - .../67/output.json | 132 +++++ .../68/options.json | 3 - .../68/output.json | 172 ++++++ .../7/options.json | 3 - .../7/output.json | 132 +++++ .../8/options.json | 3 - .../8/output.json | 172 ++++++ .../9/options.json | 3 - .../9/output.json | 91 +++ .../options.json | 10 +- .../output.json | 172 ++++++ .../options.json | 3 - .../output.json | 73 +++ .../invalid-commonjs-module/options.json | 3 - .../invalid-commonjs-module/output.json | 214 +++++++ .../invalid-es-module/options.json | 3 - .../invalid-es-module/output.json | 214 +++++++ .../invalid-import/options.json | 3 - .../declare-module/invalid-import/output.json | 161 +++++ .../invalid-module-in-module/options.json | 3 - .../invalid-module-in-module/output.json | 137 +++++ .../invalid-multiple-commonjs/options.json | 3 - .../invalid-multiple-commonjs/output.json | 181 ++++++ .../options.json | 4 +- .../output.json | 131 +++++ .../options.json | 4 +- .../output.json | 185 ++++++ .../options.json | 2 +- .../options.json | 2 +- .../options.json | 5 - .../output.json | 185 ++++++ .../options.json | 2 +- .../options.json | 2 +- .../id-reserved-type-invalid/options.json | 3 - .../id-reserved-type-invalid/output.json | 94 +++ .../options.json | 3 - .../output.json | 122 ++++ .../fixtures/flow/iterator/03/options.json | 3 - .../fixtures/flow/iterator/03/output.json | 89 +++ .../fixtures/flow/iterator/04/options.json | 3 - .../fixtures/flow/iterator/04/output.json | 89 +++ .../fixtures/flow/iterator/05/options.json | 3 - .../fixtures/flow/iterator/05/output.json | 144 +++++ .../fixtures/flow/iterator/06/options.json | 3 - .../fixtures/flow/iterator/06/output.json | 144 +++++ .../fixtures/flow/iterator/07/options.json | 3 - .../fixtures/flow/iterator/07/output.json | 86 +++ .../fixtures/flow/iterator/08/options.json | 3 - .../fixtures/flow/iterator/08/output.json | 86 +++ .../fixtures/flow/iterator/09/options.json | 3 - .../fixtures/flow/iterator/09/output.json | 161 +++++ .../fixtures/flow/iterator/10/options.json | 3 - .../fixtures/flow/iterator/10/output.json | 161 +++++ .../fixtures/flow/iterator/11/options.json | 3 - .../fixtures/flow/iterator/11/output.json | 161 +++++ .../multiple-declarations/class/options.json | 3 +- .../multiple-declarations/class/output.json | 143 +++++ .../interface/options.json | 3 +- .../interface/output.json | 180 ++++++ .../multiple-declarations/type/options.json | 3 +- .../multiple-declarations/type/output.json | 134 +++++ .../options.json | 3 - .../output.json | 212 +++++++ .../invalid-getter-param-count/options.json | 3 - .../invalid-getter-param-count/output.json | 212 +++++++ .../invalid-setter-param-count/options.json | 3 - .../invalid-setter-param-count/output.json | 163 +++++ .../invalid-setter-param-type/options.json | 3 - .../invalid-setter-param-type/output.json | 212 +++++++ .../reserved-type-invalid/options.json | 3 - .../reserved-type-invalid/output.json | 87 +++ .../flow/optional-type/6/options.json | 3 - .../fixtures/flow/optional-type/6/output.json | 124 ++++ .../fixtures/flow/predicates/4/options.json | 3 - .../fixtures/flow/predicates/4/output.json | 241 ++++++++ .../fixtures/flow/predicates/5/options.json | 3 - .../fixtures/flow/predicates/5/output.json | 210 +++++++ .../issue-58-ambiguous/options.json | 2 +- .../issue-58-failing-1/options.json | 3 - .../regression/issue-58-failing-1/output.json | 234 ++++++++ .../issue-58-failing-2/options.json | 3 - .../regression/issue-58-failing-2/output.json | 354 +++++++++++ .../issue-58-failing-3/options.json | 3 - .../regression/issue-58-failing-3/output.json | 271 +++++++++ .../issue-58-failing-4/options.json | 3 - .../regression/issue-58-failing-4/output.json | 271 +++++++++ .../options.json | 8 +- .../dupl-decl-const-declare-class/output.json | 164 ++++++ .../options.json | 8 +- .../output.json | 164 ++++++ .../dupl-decl-const-interface/options.json | 8 +- .../dupl-decl-const-interface/output.json | 164 ++++++ .../dupl-decl-const-opaque-type/options.json | 3 - .../dupl-decl-const-opaque-type/output.json | 163 +++++ .../scope/dupl-decl-const-type/options.json | 3 - .../scope/dupl-decl-const-type/output.json | 162 +++++ .../options.json | 8 +- .../output.json | 150 +++++ .../options.json | 8 +- .../output.json | 150 +++++ .../dupl-decl-declare-var-let/options.json | 8 +- .../dupl-decl-declare-var-let/output.json | 151 +++++ .../options.json | 8 +- .../dupl-decl-interface-interface/output.json | 150 +++++ .../dupl-decl-let-declare-class/options.json | 8 +- .../dupl-decl-let-declare-class/output.json | 164 ++++++ .../options.json | 8 +- .../output.json | 164 ++++++ .../dupl-decl-let-interface/options.json | 8 +- .../scope/dupl-decl-let-interface/output.json | 164 ++++++ .../dupl-decl-let-opaque-type/options.json | 3 - .../dupl-decl-let-opaque-type/output.json | 163 +++++ .../scope/dupl-decl-let-type/options.json | 3 - .../flow/scope/dupl-decl-let-type/output.json | 162 +++++ .../dupl-decl-opaque-type-const/options.json | 3 - .../dupl-decl-opaque-type-const/output.json | 163 +++++ .../dupl-decl-opaque-type-let/options.json | 3 - .../dupl-decl-opaque-type-let/output.json | 163 +++++ .../options.json | 3 - .../output.json | 148 +++++ .../dupl-decl-opaque-type-type/options.json | 3 - .../dupl-decl-opaque-type-type/output.json | 147 +++++ .../dupl-decl-opaque-type-var/options.json | 3 - .../dupl-decl-opaque-type-var/output.json | 163 +++++ .../scope/dupl-decl-type-const/options.json | 3 - .../scope/dupl-decl-type-const/output.json | 162 +++++ .../dupl-decl-type-interface/options.json | 8 +- .../dupl-decl-type-interface/output.json | 142 +++++ .../scope/dupl-decl-type-let/options.json | 3 - .../flow/scope/dupl-decl-type-let/output.json | 162 +++++ .../dupl-decl-type-opaque-type/options.json | 3 - .../dupl-decl-type-opaque-type/output.json | 147 +++++ .../scope/dupl-decl-type-type/options.json | 3 - .../scope/dupl-decl-type-type/output.json | 146 +++++ .../scope/dupl-decl-type-var/options.json | 3 - .../flow/scope/dupl-decl-type-var/output.json | 162 +++++ .../options.json | 8 +- .../output.json | 164 ++++++ .../dupl-decl-var-interface/options.json | 8 +- .../scope/dupl-decl-var-interface/output.json | 164 ++++++ .../dupl-decl-var-opaque-type/options.json | 3 - .../dupl-decl-var-opaque-type/output.json | 163 +++++ .../scope/dupl-decl-var-type/options.json | 3 - .../flow/scope/dupl-decl-var-type/output.json | 162 +++++ .../flow/type-annotations/131/options.json | 3 - .../flow/type-annotations/131/output.json | 86 +++ .../flow/type-annotations/132/options.json | 3 - .../flow/type-annotations/132/output.json | 119 ++++ .../flow/type-annotations/133/options.json | 3 - .../flow/type-annotations/133/output.json | 236 ++++++++ .../flow/type-annotations/134/options.json | 3 - .../flow/type-annotations/134/output.json | 86 +++ .../flow/type-annotations/137/options.json | 3 - .../flow/type-annotations/137/output.json | 140 +++++ .../flow/type-annotations/139/options.json | 3 - .../flow/type-annotations/139/output.json | 190 ++++++ .../with-default-invalid/options.json | 3 - .../with-default-invalid/output.json | 173 ++++++ .../invalid-import-type-2/options.json | 3 - .../invalid-import-type-2/output.json | 126 ++++ .../invalid-import-type-3/options.json | 3 - .../invalid-import-type-3/output.json | 108 ++++ .../invalid-import-type-4/options.json | 3 - .../invalid-import-type-4/output.json | 108 ++++ .../invalid-import-type-as/options.json | 8 +- .../invalid-import-type-as/output.json | 126 ++++ .../options.json | 3 - .../output.json | 126 ++++ .../options.json | 3 - .../output.json | 126 ++++ .../options.json | 3 - .../output.json | 126 ++++ .../options.json | 3 - .../invalid-import-type-shorthand/output.json | 126 ++++ .../invalid-import-type/options.json | 3 - .../invalid-import-type/output.json | 108 ++++ .../default-missing/options.json | 3 - .../default-missing/output.json | 169 ++++++ .../options.json | 9 +- .../output.json | 94 +++ .../options.json | 5 - .../output.json | 241 ++++++++ .../options.json | 3 +- .../output.json | 122 ++++ .../options.json | 5 - .../output.json | 174 ++++++ .../fail-in-calls-with-one-arg/options.json | 3 - .../fail-in-calls-with-one-arg/output.json | 149 +++++ .../flow/typecasts/fail-in-calls/options.json | 3 - .../flow/typecasts/fail-in-calls/output.json | 166 ++++++ .../fail-without-parens/options.json | 3 - .../typecasts/fail-without-parens/output.json | 171 ++++++ .../fails-in-array-expression-1/options.json | 3 - .../fails-in-array-expression-1/output.json | 132 +++++ .../fails-in-array-expression-2/options.json | 3 - .../fails-in-array-expression-2/output.json | 136 +++++ .../fails-in-array-expression-3/options.json | 3 - .../fails-in-array-expression-3/output.json | 170 ++++++ .../fails-in-array-expression-4/options.json | 3 - .../fails-in-array-expression-4/output.json | 166 ++++++ .../fails-in-array-expression-5/options.json | 3 - .../fails-in-array-expression-5/output.json | 200 +++++++ .../attribute-empty-expression/options.json | 3 - .../attribute-empty-expression/output.json | 165 ++++++ .../wrong-closing-tag-fragment/options.json | 3 - .../wrong-closing-tag-fragment/output.json | 115 ++++ .../wrong-opening-tag-fragment/options.json | 3 - .../wrong-opening-tag-fragment/output.json | 117 ++++ .../_errors/space-after/options.json | 3 +- .../_errors/space-after/output.json | 71 +++ .../_errors/space-before/options.json | 3 +- .../_errors/space-before/output.json | 71 +++ .../arrow-async-parameter-as/options.json | 3 - .../cast/arrow-async-parameter-as/output.json | 154 +++++ .../options.json | 3 - .../output.json | 154 +++++ .../cast/arrow-parameter-as/options.json | 3 - .../cast/arrow-parameter-as/output.json | 154 +++++ .../arrow-parameter-assertion/options.json | 3 - .../arrow-parameter-assertion/output.json | 154 +++++ .../class/extends-empty/options.json | 3 - .../class/extends-empty/output.json | 87 +++ .../extends-implements-empty/options.json | 3 - .../extends-implements-empty/output.json | 104 ++++ .../class/implements-empty/options.json | 3 - .../class/implements-empty/output.json | 88 +++ .../options.json | 3 - .../output.json | 177 ++++++ .../function/pattern-parameters/options.json | 3 - .../function/pattern-parameters/output.json | 124 ++++ .../redeclaration-class-class/options.json | 3 - .../redeclaration-class-class/output.json | 136 +++++ .../redeclaration-class-enum/options.json | 3 - .../redeclaration-class-enum/output.json | 120 ++++ .../redeclaration-class-type/options.json | 3 - .../redeclaration-class-type/output.json | 134 +++++ .../redeclaration-constenum-enum/options.json | 3 - .../redeclaration-constenum-enum/output.json | 105 ++++ .../redeclaration-enum-class/options.json | 3 - .../redeclaration-enum-class/output.json | 120 ++++ .../redeclaration-enum-constenum/options.json | 3 - .../redeclaration-enum-constenum/output.json | 105 ++++ .../redeclaration-enum-function/options.json | 3 - .../redeclaration-enum-function/output.json | 123 ++++ .../redeclaration-enum-interface/options.json | 3 - .../redeclaration-enum-interface/output.json | 119 ++++ .../scope/redeclaration-enum-let/options.json | 3 - .../scope/redeclaration-enum-let/output.json | 122 ++++ .../redeclaration-enum-type/options.json | 3 - .../scope/redeclaration-enum-type/output.json | 118 ++++ .../scope/redeclaration-enum-var/options.json | 3 - .../scope/redeclaration-enum-var/output.json | 122 ++++ .../redeclaration-function-enum/options.json | 3 - .../redeclaration-function-enum/output.json | 123 ++++ .../redeclaration-interface-enum/options.json | 3 - .../redeclaration-interface-enum/output.json | 119 ++++ .../scope/redeclaration-let-enum/options.json | 3 - .../scope/redeclaration-let-enum/output.json | 122 ++++ .../redeclaration-type-class/options.json | 3 - .../redeclaration-type-class/output.json | 134 +++++ .../redeclaration-type-enum/options.json | 3 - .../scope/redeclaration-type-enum/output.json | 118 ++++ .../redeclaration-type-interface/options.json | 3 - .../redeclaration-type-interface/output.json | 133 +++++ .../redeclaration-type-type/options.json | 3 - .../scope/redeclaration-type-type/output.json | 132 +++++ .../scope/redeclaration-var-enum/options.json | 3 - .../scope/redeclaration-var-enum/output.json | 122 ++++ .../types/literal-string-2/options.json | 5 - .../types/literal-string-2/output.json | 195 ++++++ .../typescript/types/read-only-1/options.json | 5 - .../typescript/types/read-only-1/output.json | 137 +++++ .../typescript/types/read-only-2/options.json | 5 - .../typescript/types/read-only-2/output.json | 154 +++++ .../typescript/types/read-only-3/options.json | 5 - .../typescript/types/read-only-3/output.json | 168 ++++++ .../typescript/types/read-only-4/options.json | 5 - .../typescript/types/read-only-4/output.json | 186 ++++++ .../types/tuple-optional-invalid/options.json | 5 - .../types/tuple-optional-invalid/output.json | 166 ++++++ .../options.json | 2 +- 2108 files changed, 149169 insertions(+), 2795 deletions(-) delete mode 100644 packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/options.json create mode 100644 packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json create mode 100644 packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/options.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/options.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json create mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json create mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json create mode 100644 packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/scope/for-var/options.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/for-var/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json create mode 100644 packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/108/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/108/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/349/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/349/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/350/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/350/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/351/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/351/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/354/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/354/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/361/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/361/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/362/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/362/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/363/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/363/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/366/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/366/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/367/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/367/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/368/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/368/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/369/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/369/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/370/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/370/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/371/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/371/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/372/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/372/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/373/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/373/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/374/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/374/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/382/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/382/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/383/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/383/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/384/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/384/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/397/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/397/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/398/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/398/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/399/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/399/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/400/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/400/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/401/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/401/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/402/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/402/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/403/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/403/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/404/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/404/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/409/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/409/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/411/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/411/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/417/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/417/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/418/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/418/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/425/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/425/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/427/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/427/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/446/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/446/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/447/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/447/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/448/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/448/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/449/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/449/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/454/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/454/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/455/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/455/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/456/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/456/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/457/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/457/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/459/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/459/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/460/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/460/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/461/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/461/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/462/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/462/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/463/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/463/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/464/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/464/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/465/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/465/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/466/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/466/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/467/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/467/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/468/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/468/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/469/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/469/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/470/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/470/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/471/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/471/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/472/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/472/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/473/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/473/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/474/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/474/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/475/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/475/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/476/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/476/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/477/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/477/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/478/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/478/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/479/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/479/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/480/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/480/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/481/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/481/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/482/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/482/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/483/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/483/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/484/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/484/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/485/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/485/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/486/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/486/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/487/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/487/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/488/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/488/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/489/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/489/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/490/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/490/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/491/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/491/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/492/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/492/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/493/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/493/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/494/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/494/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/495/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/495/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/496/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/496/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/497/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/497/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/498/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/498/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/499/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/499/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/500/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/500/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/501/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/501/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/502/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/502/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/503/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/503/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/504/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/504/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/505/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/505/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/506/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/506/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/507/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/507/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/508/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/508/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/509/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/509/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/510/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/510/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/511/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/511/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/512/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/512/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/513/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/513/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/514/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/514/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/515/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/515/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/516/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/516/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/517/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/517/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/518/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/518/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/519/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/519/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/520/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/520/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/521/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/521/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/522/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/522/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/523/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/523/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/524/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/524/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/544/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/544/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/545/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/547/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/547/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/548/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/550/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/550/output.json delete mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/552/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/552/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/556/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/558/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/class/extends-strict/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/shorthand/1/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/shorthand/2/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/125/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/126/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/127/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/198/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/200/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/201/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/202/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/204/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/205/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/206/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/208/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/209/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/210/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/211/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/213/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/214/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/215/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/217/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/218/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/219/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/220/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/221/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/222/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/223/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/226/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/228/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/229/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/230/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/231/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/232/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/248/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/249/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/251/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/252/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/280/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/281/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/284/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/290/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/291/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/298/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/324/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/325/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/329/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/333/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/339/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/347/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/348/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/349/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/37/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json create mode 100644 packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/options.json create mode 100644 packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/2/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/options.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/options.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/options.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/options.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/options.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json delete mode 100644 packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json create mode 100644 packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 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 create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/03/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/03/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/04/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/04/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/05/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/05/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/06/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/06/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/07/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/07/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/08/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/08/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/09/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/09/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/10/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/10/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/iterator/11/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/iterator/11/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/optional-type/6/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/optional-type/6/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/predicates/4/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/predicates/4/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/predicates/5/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/predicates/5/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/131/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/132/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/133/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/134/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/137/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/139/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/options.json create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/options.json create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json create mode 100644 packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json create mode 100644 packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/literal-string-2/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-1/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-2/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-3/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-4/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json diff --git a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/options.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..bed17cab3909 --- /dev/null +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/7/output.json @@ -0,0 +1,128 @@ +{ + "type": "FunctionExpression", + "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 + } + }, + "left": { + "type": "Identifier", + "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 + } + }, + "extra": { + "rawValue": "default", + "raw": "\"default\"" + }, + "value": "default" + } + } + ], + "body": { + "type": "BlockStatement", + "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 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 26, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": "use strict", + "extra": { + "raw": "\"use strict\"", + "rawValue": "use strict" + } + } + } + ] + }, + "errors": [ + "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/options.json b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/options.json index 5f24fc4399ed..4f434cf0aa86 100644 --- a/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/options.json +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/options.json @@ -1,4 +1,3 @@ { - "strictMode": true, - "throws": "Unexpected reserved word 'public' (2:0)" -} + "strictMode": true +} \ 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 new file mode 100644 index 000000000000..df12702dd8b4 --- /dev/null +++ b/packages/babel-parser/test/expressions/is-expression-babel-parser/fail/8/output.json @@ -0,0 +1,20 @@ +{ + "type": "Identifier", + "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)" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/options.json deleted file mode 100644 index 05a7826ae8ba..000000000000 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "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)" -} 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 new file mode 100644 index 000000000000..7ad34b6ae910 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json @@ -0,0 +1,125 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "test": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "body": { + "type": "FunctionDeclaration", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/options.json deleted file mode 100644 index 395620bfa2f8..000000000000 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "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)" -} 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 new file mode 100644 index 000000000000..64064c04c2b9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json @@ -0,0 +1,189 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "test": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "body": { + "type": "LabeledStatement", + "start": 10, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": { + "type": "LabeledStatement", + "start": 15, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": { + "type": "FunctionDeclaration", + "start": 20, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "bar" + }, + "name": "bar" + } + }, + "label": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json deleted file mode 100644 index 3ef90d2032d2..000000000000 --- a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'break' (2:2)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..742ca4b45728 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/output.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'break' (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "break" + }, + "name": "break" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "break" + }, + "name": "break" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json deleted file mode 100644 index 3ae5cb6c96c4..000000000000 --- a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..20b84ecf03fa --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": { + "raw": "\\8", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json deleted file mode 100644 index 3ae5cb6c96c4..000000000000 --- a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..9e0985f69a92 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": { + "raw": "\\9", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/options.json b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/options.json index 8ac5b45f7194..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/options.json +++ b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Legacy octal literals are not allowed in strict mode (1:0)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..99253558c815 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 9.5, + "raw": "09.5" + }, + "value": 9.5 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/options.json deleted file mode 100644 index b14806508f97..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (4:6)" -} 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 new file mode 100644 index 000000000000..f017f0fa5f00 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json @@ -0,0 +1,247 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 30, + "end": 42, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/options.json deleted file mode 100644 index 6a0c16d56696..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (3:4)" -} 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 new file mode 100644 index 000000000000..758528386efb --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json @@ -0,0 +1,229 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/options.json deleted file mode 100644 index b14806508f97..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (4:6)" -} 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 new file mode 100644 index 000000000000..0444f665d33d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json @@ -0,0 +1,247 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 19, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start": 30, + "end": 42, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/options.json deleted file mode 100644 index 6a0c16d56696..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (3:4)" -} 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 new file mode 100644 index 000000000000..76f48823dd81 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json @@ -0,0 +1,229 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + }, + { + "type": "VariableDeclaration", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/options.json deleted file mode 100644 index 2cbe06c40914..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:15)" -} 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 new file mode 100644 index 000000000000..899412645531 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json @@ -0,0 +1,154 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "param": { + "type": "ArrayPattern", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/options.json deleted file mode 100644 index ac735b2ace22..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (1:35)" -} 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 new file mode 100644 index 000000000000..cddf0493cba9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json @@ -0,0 +1,222 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "TryStatement", + "start": 9, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "block": { + "type": "BlockStatement", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 16, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "param": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + }, + { + "type": "VariableDeclaration", + "start": 31, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/options.json deleted file mode 100644 index 6f5b5641a148..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (3:11)" -} 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 new file mode 100644 index 000000000000..ab1db27cf0a8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json @@ -0,0 +1,173 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 24, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/options.json deleted file mode 100644 index 254a763e653e..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (3:6)" -} 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 new file mode 100644 index 000000000000..e759f28d0434 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "param": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/options.json deleted file mode 100644 index bf345ea77127..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:28)" -} 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 new file mode 100644 index 000000000000..5a4c9d365dbe --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json @@ -0,0 +1,293 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "param": { + "type": "ObjectPattern", + "start": 15, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + } + }, + { + "type": "ObjectProperty", + "start": 25, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectPattern", + "start": 28, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 30, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "c" + }, + "name": "c" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 31 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + } + } + ] + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/options.json deleted file mode 100644 index 254a763e653e..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (3:6)" -} 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 new file mode 100644 index 000000000000..40bb3df74915 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json @@ -0,0 +1,189 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "param": { + "type": "ArrayPattern", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 22, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 26, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/options.json deleted file mode 100644 index 254a763e653e..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (3:6)" -} 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 new file mode 100644 index 000000000000..5cd4c6abd102 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-obj-destr/output.json @@ -0,0 +1,227 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "param": { + "type": "ObjectPattern", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 24, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 28, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/options.json deleted file mode 100644 index cdd0ac832c57..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:6)" -} 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 new file mode 100644 index 000000000000..6d2e82b586ae --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json @@ -0,0 +1,166 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [] + } + }, + { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "ClassDeclaration", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "body": [] + } + }, + { + "type": "EmptyStatement", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/options.json deleted file mode 100644 index cdd0ac832c57..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:6)" -} 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 new file mode 100644 index 000000000000..a23d95cfc217 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [] + } + }, + { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "VariableDeclaration", + "start": 14, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/options.json deleted file mode 100644 index a3504d289fd7..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:9)" -} 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 new file mode 100644 index 000000000000..a6bf56aa7623 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json @@ -0,0 +1,169 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [] + } + }, + { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "FunctionDeclaration", + "start": 14, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "EmptyStatement", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/options.json deleted file mode 100644 index c04a6f3e48eb..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:4)" -} 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 new file mode 100644 index 000000000000..49daeec3aef6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [] + } + }, + { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "VariableDeclaration", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/options.json deleted file mode 100644 index c04a6f3e48eb..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:4)" -} 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 new file mode 100644 index 000000000000..205470069b5d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json @@ -0,0 +1,153 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "body": [] + } + }, + { + "type": "EmptyStatement", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + { + "type": "VariableDeclaration", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/options.json deleted file mode 100644 index d62aabfd1b07..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (1:13)" -} 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 new file mode 100644 index 000000000000..b6f764fce7a5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json @@ -0,0 +1,160 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "VariableDeclarator", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/options.json deleted file mode 100644 index 1b6192a1bc04..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'f' has already been declared (1:28)" -} 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 new file mode 100644 index 000000000000..ebd20401ed0f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json @@ -0,0 +1,160 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 2, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "FunctionDeclaration", + "start": 18, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/options.json index 3f4250fbe917..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Identifier 'foo' has already been declared (1:29)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..c1b2c1a85a29 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json @@ -0,0 +1,160 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 2, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "FunctionDeclaration", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/options.json index e253f0a85f47..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Identifier 'foo' has already been declared (2:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..eadbdeeb68f8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json @@ -0,0 +1,142 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "FunctionDeclaration", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/options.json deleted file mode 100644 index 254a763e653e..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (3:6)" -} 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 new file mode 100644 index 000000000000..454a440c3426 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json @@ -0,0 +1,178 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "VariableDeclaration", + "start": 24, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/options.json deleted file mode 100644 index 1b6192a1bc04..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'f' has already been declared (1:28)" -} 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 new file mode 100644 index 000000000000..fdad445b5deb --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json @@ -0,0 +1,160 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 2, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "FunctionDeclaration", + "start": 19, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/options.json deleted file mode 100644 index 8ca49120a98a..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (1:9)" -} 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 new file mode 100644 index 000000000000..e28bf9f399b0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": null + }, + { + "type": "VariableDeclarator", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/options.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/options.json deleted file mode 100644 index 3eaa378d43e7..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'a' has already been declared (3:8)" -} 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 new file mode 100644 index 000000000000..f925321aef98 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "BlockStatement", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/for-var/options.json b/packages/babel-parser/test/fixtures/core/scope/for-var/options.json deleted file mode 100644 index 5f2332a9ed8f..000000000000 --- a/packages/babel-parser/test/fixtures/core/scope/for-var/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'i' has already been declared (2:8)" -} 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 new file mode 100644 index 000000000000..bfd483ec7fb4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/for-var/output.json @@ -0,0 +1,194 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": null, + "update": null, + "body": { + "type": "BlockStatement", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json index 8448889cf253..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Export 'encrypt' is not defined (1:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..996bc32d815d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json @@ -0,0 +1,106 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "default" + }, + "name": "default" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json index 8448889cf253..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Export 'encrypt' is not defined (1:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..11a778f34809 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json @@ -0,0 +1,158 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 20, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "decrypt" + }, + "name": "decrypt" + } + } + ], + "source": null, + "declaration": null + }, + { + "type": "FunctionDeclaration", + "start": 31, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 40, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "decrypt" + }, + "name": "decrypt" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json index 0844d3e80e68..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Export 'encrypt' is not defined (4:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..a660653865e5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 4, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + }, + { + "type": "ExportNamedDeclaration", + "start": 28, + "end": 46, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "local": { + "type": "Identifier", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 16 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 16 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json index cbab70613300..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Export 'Object' is not defined (1:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..ce100047f2fe --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json @@ -0,0 +1,106 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "Object" + }, + "name": "Object" + }, + "exported": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "Obj" + }, + "name": "Obj" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json index cbab70613300..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Export 'Object' is not defined (1:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..22aa25d45da7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json @@ -0,0 +1,106 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "Object" + }, + "name": "Object" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "Object" + }, + "name": "Object" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json index 2c97b3ce5a78..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "In strict mode code, functions can only be declared at top level or inside a block (2:10)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..dbff016172cc --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json @@ -0,0 +1,191 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + } + } + ], + "source": null, + "declaration": null + }, + { + "type": "IfStatement", + "start": 20, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 24, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "value": true + }, + "consequent": { + "type": "FunctionDeclaration", + "start": 30, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 39, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 26 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 49, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "body": [], + "directives": [] + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json index 8448889cf253..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Export 'encrypt' is not defined (1:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..6293e83f540f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json @@ -0,0 +1,106 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "encrypt" + }, + "name": "encrypt" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/108/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/108/options.json deleted file mode 100644 index 080cb0eaaa8a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/108/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid regular expression flag (1:17)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json new file mode 100644 index 000000000000..65ac2b95f145 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json @@ -0,0 +1,112 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "RegExpLiteral", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "raw": "/[P QR]/\\u0067" + }, + "pattern": "[P QR]", + "flags": "\\u0067" + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file 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 91bb1eef0c0d..aa61ff56c2b3 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": "Invalid number (1:0)" -} + "throws": "Identifier directly after number (1:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/349/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/349/options.json deleted file mode 100644 index 91bb1eef0c0d..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/349/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json new file mode 100644 index 000000000000..284fac8c4357 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "errors": [ + "SyntaxError: Invalid number (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 3, + "raw": "3e" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/350/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/350/options.json deleted file mode 100644 index 91bb1eef0c0d..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/350/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json new file mode 100644 index 000000000000..6b6e666b00ca --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "errors": [ + "SyntaxError: Invalid number (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 3, + "raw": "3e+" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/351/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/351/options.json deleted file mode 100644 index 91bb1eef0c0d..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/351/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json new file mode 100644 index 000000000000..b52b27d1ef37 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "errors": [ + "SyntaxError: Invalid number (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 3, + "raw": "3e-" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/354/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/354/options.json deleted file mode 100644 index 1a0693338eee..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/354/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 16 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json new file mode 100644 index 000000000000..ffcb3680fd0b --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0x" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/361/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/361/options.json deleted file mode 100644 index 18c53b997b56..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/361/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json new file mode 100644 index 000000000000..fbb1d3b5d554 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json @@ -0,0 +1,70 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "xx\\" + }, + "name": "xx\\" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/362/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/362/options.json deleted file mode 100644 index ea7ba01dc69c..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/362/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json new file mode 100644 index 000000000000..fae32b78cde4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json @@ -0,0 +1,70 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "errors": [ + "SyntaxError: Invalid Unicode escape (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x\\" + }, + "name": "x\\" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/363/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/363/options.json deleted file mode 100644 index ea7ba01dc69c..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/363/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json new file mode 100644 index 000000000000..37312f42ce97 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json @@ -0,0 +1,70 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "errors": [ + "SyntaxError: Invalid Unicode escape (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x*" + }, + "name": "x*" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/366/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/366/options.json deleted file mode 100644 index adf556b0a352..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/366/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid regular expression flag (1:16)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json new file mode 100644 index 000000000000..68d637a98170 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json @@ -0,0 +1,109 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "RegExpLiteral", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "raw": "/[a-z]/\\ux" + }, + "pattern": "[a-z]", + "flags": "\\ux" + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/367/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/367/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/367/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json new file mode 100644 index 000000000000..466f4bd92254 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json @@ -0,0 +1,110 @@ +{ + "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", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "operator": "=", + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + }, + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/368/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/368/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/368/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json new file mode 100644 index 000000000000..8a8d67a80a10 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json @@ -0,0 +1,123 @@ +{ + "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", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "operator": "=", + "left": { + "type": "CallExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "func" + }, + "name": "func" + }, + "arguments": [] + }, + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/369/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/369/options.json deleted file mode 100644 index 7c5f08eb9ba6..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/369/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json new file mode 100644 index 000000000000..b22f988e1aa7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in assignment expression (1:1)", + "SyntaxError: Invalid left-hand side in assignment expression (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "operator": "=", + "left": { + "type": "BinaryExpression", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "NumericLiteral", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/370/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/370/options.json deleted file mode 100644 index c09dac1301de..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/370/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in postfix operation (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json new file mode 100644 index 000000000000..ce2cb3d23d67 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/371/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/371/options.json deleted file mode 100644 index c09dac1301de..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/371/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in postfix operation (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json new file mode 100644 index 000000000000..57d55fec0b5d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/372/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/372/options.json deleted file mode 100644 index 515e441e8ea7..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/372/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in prefix operation (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json new file mode 100644 index 000000000000..9a7a240c5b4a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/373/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/373/options.json deleted file mode 100644 index 515e441e8ea7..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/373/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in prefix operation (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json new file mode 100644 index 000000000000..85107220dae5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/374/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/374/options.json deleted file mode 100644 index f8560a7de9d6..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/374/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-in statement (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json new file mode 100644 index 000000000000..d2ba76398677 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json @@ -0,0 +1,197 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "left": { + "type": "BinaryExpression", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 4 + } + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "list" + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "CallExpression", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "callee": { + "type": "Identifier", + "start": 21, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "process" + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/382/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/382/options.json deleted file mode 100644 index 2b91be8d5115..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/382/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'if' (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json new file mode 100644 index 000000000000..ac910291b748 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'if' (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "if" + }, + "name": "if" + }, + "init": { + "type": "NumericLiteral", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/383/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/383/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/383/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json new file mode 100644 index 000000000000..329a2a1e98b7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json @@ -0,0 +1,143 @@ +{ + "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", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "operator": "=", + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + }, + "right": { + "type": "NumericLiteral", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/384/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/384/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/384/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json new file mode 100644 index 000000000000..12ab663d4186 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json @@ -0,0 +1,124 @@ +{ + "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", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/397/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/397/options.json deleted file mode 100644 index f9543317a817..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/397/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'if' (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json new file mode 100644 index 000000000000..0e5a7503ecdd --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'if' (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "t" + }, + "name": "t" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "if" + }, + "name": "if" + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/398/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/398/options.json deleted file mode 100644 index bba7a057d842..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/398/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'true' (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json new file mode 100644 index 000000000000..9da054e4ab90 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'true' (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "t" + }, + "name": "t" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "true" + }, + "name": "true" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/399/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/399/options.json deleted file mode 100644 index b04b18396af1..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/399/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'false' (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json new file mode 100644 index 000000000000..f4f5b906e9c7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'false' (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "t" + }, + "name": "t" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "false" + }, + "name": "false" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/400/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/400/options.json deleted file mode 100644 index 667f2cc8816d..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/400/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'null' (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json new file mode 100644 index 000000000000..b8eaca925ad4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'null' (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "t" + }, + "name": "t" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "null" + }, + "name": "null" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/401/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/401/options.json deleted file mode 100644 index fa57d4f43f70..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/401/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'null' (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json new file mode 100644 index 000000000000..3fea78461b66 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json @@ -0,0 +1,90 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'null' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "null" + }, + "name": "null" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/402/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/402/options.json deleted file mode 100644 index c4a7ead13704..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/402/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'true' (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json new file mode 100644 index 000000000000..fc0c10f2f765 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json @@ -0,0 +1,90 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'true' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "true" + }, + "name": "true" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/403/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/403/options.json deleted file mode 100644 index 0e9cf8962aae..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/403/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'false' (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json new file mode 100644 index 000000000000..7e708faf3684 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json @@ -0,0 +1,90 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'false' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "false" + }, + "name": "false" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/404/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/404/options.json deleted file mode 100644 index a87aa98c0e01..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/404/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'if' (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json new file mode 100644 index 000000000000..813c4e9b903a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json @@ -0,0 +1,90 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'if' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "if" + }, + "name": "if" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/409/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/409/options.json deleted file mode 100644 index 701f9fe8f27a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/409/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json new file mode 100644 index 000000000000..d3a105c584dd --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json @@ -0,0 +1,54 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BreakStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "label": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/411/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/411/options.json deleted file mode 100644 index de66853a7a3d..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/411/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json new file mode 100644 index 000000000000..c32c5b089115 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json @@ -0,0 +1,54 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ContinueStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "label": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/417/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/417/options.json deleted file mode 100644 index f8560a7de9d6..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/417/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-in statement (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json new file mode 100644 index 000000000000..9210a772c6e1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json @@ -0,0 +1,138 @@ +{ + "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", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "BinaryExpression", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "right": { + "type": "ObjectExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/418/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/418/options.json deleted file mode 100644 index f8560a7de9d6..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/418/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-in statement (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json new file mode 100644 index 000000000000..7300952311c2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json @@ -0,0 +1,119 @@ +{ + "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", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "UnaryExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "right": { + "type": "ObjectExpression", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/425/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/425/options.json deleted file mode 100644 index 429d96ca3f9a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/425/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Missing catch or finally clause (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json new file mode 100644 index 000000000000..3d2ee0555b85 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json @@ -0,0 +1,72 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [], + "directives": [] + }, + "handler": null, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/427/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/427/options.json deleted file mode 100644 index aadfa63716c2..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/427/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Multiple default clauses (1:22)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json new file mode 100644 index 000000000000..c90c4eefdc6f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "errors": [ + "SyntaxError: Multiple default clauses (1:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "c" + }, + "name": "c" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "consequent": [], + "test": null + }, + { + "type": "SwitchCase", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "consequent": [], + "test": null + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/446/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/446/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/446/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json new file mode 100644 index 000000000000..1db488318bdf --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json @@ -0,0 +1,71 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "\\\\\\" + }, + "name": "\\\\\\" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/447/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/447/options.json deleted file mode 100644 index 82bcfe621c49..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/447/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json new file mode 100644 index 000000000000..d44909ca998a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json @@ -0,0 +1,70 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "errors": [ + "SyntaxError: Invalid Unicode escape (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "\\" + }, + "name": "\\" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/448/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/448/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/448/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json new file mode 100644 index 000000000000..38cc0c05b021 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json @@ -0,0 +1,70 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "\\x" + }, + "name": "\\x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/449/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/449/options.json deleted file mode 100644 index 82bcfe621c49..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/449/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json new file mode 100644 index 000000000000..380e6ec698ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json @@ -0,0 +1,70 @@ +{ + "type": "File", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "errors": [ + "SyntaxError: Invalid Unicode escape (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "\u0000" + }, + "name": "\u0000" + } + } + ], + "directives": [] + } +} \ 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 8e0dce66eff8..a760565b1bd2 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": "Bad character escape sequence (1:3)" -} + "throws": "Unterminated string constant (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/454/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/454/options.json deleted file mode 100644 index f9d29c7f328c..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/454/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'return' outside of function (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json new file mode 100644 index 000000000000..e43da2374537 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json @@ -0,0 +1,54 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ReturnStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "argument": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/455/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/455/options.json deleted file mode 100644 index 701f9fe8f27a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/455/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json new file mode 100644 index 000000000000..d3a105c584dd --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json @@ -0,0 +1,54 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BreakStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "label": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/456/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/456/options.json deleted file mode 100644 index de66853a7a3d..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/456/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json new file mode 100644 index 000000000000..c32c5b089115 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json @@ -0,0 +1,54 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ContinueStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "label": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/457/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/457/options.json deleted file mode 100644 index c726e8fa98e4..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/457/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:22)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json new file mode 100644 index 000000000000..b83145faf5ab --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 13, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "consequent": [ + { + "type": "ContinueStatement", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "label": null + } + ], + "test": null + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/459/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/459/options.json deleted file mode 100644 index 070e662e80d4..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/459/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json new file mode 100644 index 000000000000..a7c8d4f9a0ca --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/460/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/460/options.json deleted file mode 100644 index 2a2e15787aa7..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/460/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json new file mode 100644 index 000000000000..2f1c8737b22e --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "label": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/461/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/461/options.json deleted file mode 100644 index 464af80a1561..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/461/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:33)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json new file mode 100644 index 000000000000..7337acd3e8fd --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 19, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "label": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 + } + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/462/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/462/options.json deleted file mode 100644 index a056cb50e190..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/462/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:33)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json new file mode 100644 index 000000000000..18bc9b977ca7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 19, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "label": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 + } + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/463/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/463/options.json deleted file mode 100644 index 464af80a1561..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/463/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:33)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json new file mode 100644 index 000000000000..59ae007d6fba --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 19, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "label": null + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 + } + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/464/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/464/options.json deleted file mode 100644 index a056cb50e190..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/464/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:33)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json new file mode 100644 index 000000000000..d26e37b08031 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 19, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 33, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "label": null + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 + } + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/465/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/465/options.json deleted file mode 100644 index da7f2590db0b..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/465/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Label 'x' is already declared (1: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 new file mode 100644 index 000000000000..3025d6bfbf72 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json @@ -0,0 +1,199 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "LabeledStatement", + "start": 18, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": { + "type": "WhileStatement", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 28, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/466/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/466/options.json deleted file mode 100644 index 1517e1719333..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/466/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Deleting local variable in strict mode (1:29)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json new file mode 100644 index 000000000000..f22f0efb0609 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json @@ -0,0 +1,195 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "CallExpression", + "start": 1, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 29, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "operator": "delete", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "i" + }, + "name": "i" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/467/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/467/options.json deleted file mode 100644 index 31b4c6d2a040..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/467/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'with' in strict mode (1:29)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json new file mode 100644 index 000000000000..1567b18881d6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json @@ -0,0 +1,193 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "CallExpression", + "start": 1, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [ + { + "type": "WithStatement", + "start": 29, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "object": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "EmptyStatement", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/468/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/468/options.json deleted file mode 100644 index dfbf1f6d0d1c..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/468/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:36)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json new file mode 100644 index 000000000000..7598b7431e9f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json @@ -0,0 +1,197 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 32, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "id": { + "type": "Identifier", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "init": { + "type": "NumericLiteral", + "start": 43, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/469/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/469/options.json deleted file mode 100644 index b74dfcf59199..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/469/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:36)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json new file mode 100644 index 000000000000..7101109189a2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json @@ -0,0 +1,197 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 32, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 36, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "init": { + "type": "NumericLiteral", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/470/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/470/options.json deleted file mode 100644 index e95a2d7f7535..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/470/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:47)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json new file mode 100644 index 000000000000..dd5fca85f2e5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 32, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "block": { + "type": "BlockStatement", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 40, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "param": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "body": { + "type": "BlockStatement", + "start": 53, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/471/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/471/options.json deleted file mode 100644 index 14d96617b4b6..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/471/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:47)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json new file mode 100644 index 000000000000..3b89f63424e2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 32, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "block": { + "type": "BlockStatement", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 40, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "param": { + "type": "Identifier", + "start": 47, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 56 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "body": { + "type": "BlockStatement", + "start": 58, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/472/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/472/options.json deleted file mode 100644 index 6faa5d0476c3..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/472/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:32)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json new file mode 100644 index 000000000000..2973f3517639 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json @@ -0,0 +1,195 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "right": { + "type": "NumericLiteral", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/473/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/473/options.json deleted file mode 100644 index 2f502104f7d4..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/473/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:32)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json new file mode 100644 index 000000000000..e328a1e98ef9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json @@ -0,0 +1,195 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 32, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "right": { + "type": "NumericLiteral", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/474/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/474/options.json deleted file mode 100644 index 0964911894d9..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/474/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:34)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json new file mode 100644 index 000000000000..95091e65367d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/475/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/475/options.json deleted file mode 100644 index 0964911894d9..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/475/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:34)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json new file mode 100644 index 000000000000..8473055a411c --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/476/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/476/options.json deleted file mode 100644 index ba5ef9dd55cc..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/476/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:34)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json new file mode 100644 index 000000000000..c9974932443e --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/477/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/477/options.json deleted file mode 100644 index ba5ef9dd55cc..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/477/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:34)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json new file mode 100644 index 000000000000..cf31420c53a0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/478/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/478/options.json deleted file mode 100644 index 6faa5d0476c3..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/478/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:32)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json new file mode 100644 index 000000000000..59618c91e2ca --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/479/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/479/options.json deleted file mode 100644 index 6faa5d0476c3..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/479/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:32)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json new file mode 100644 index 000000000000..0b6b047c7b58 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/480/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/480/options.json deleted file mode 100644 index 2f502104f7d4..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/480/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:32)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json new file mode 100644 index 000000000000..64f2c09fd91e --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/481/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/481/options.json deleted file mode 100644 index 2f502104f7d4..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/481/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:32)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json new file mode 100644 index 000000000000..34c1b59c4e79 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/482/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/482/options.json deleted file mode 100644 index 439ffff53e89..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/482/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:41)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json new file mode 100644 index 000000000000..a26597f806c1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json @@ -0,0 +1,180 @@ +{ + "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", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 32, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/483/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/483/options.json deleted file mode 100644 index ad15b27f9b9a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/483/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:41)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json new file mode 100644 index 000000000000..4c756f50ea07 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json @@ -0,0 +1,180 @@ +{ + "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", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 32, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 50 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 53, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/484/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/484/options.json deleted file mode 100644 index 1eb91299eb1b..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/484/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json new file mode 100644 index 000000000000..ede15490b692 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/485/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/485/options.json deleted file mode 100644 index c903c1205ce8..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/485/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json new file mode 100644 index 000000000000..aeccd1a07ed9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/486/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/486/options.json deleted file mode 100644 index 884ab94e3403..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/486/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:42)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json new file mode 100644 index 000000000000..4e8af9c85d04 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json @@ -0,0 +1,214 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "expression": { + "type": "CallExpression", + "start": 33, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": [], + "directives": [] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/487/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/487/options.json deleted file mode 100644 index 58a98e4ca953..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/487/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:42)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json new file mode 100644 index 000000000000..49a2e0086f28 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json @@ -0,0 +1,214 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "expression": { + "type": "CallExpression", + "start": 33, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 33, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [], + "directives": [] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/488/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/488/options.json deleted file mode 100644 index aa44c4aafa4d..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/488/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:10)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json new file mode 100644 index 000000000000..6d1387258a3e --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json @@ -0,0 +1,161 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/489/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/489/options.json deleted file mode 100644 index 59ccf8eb8209..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/489/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:10)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json new file mode 100644 index 000000000000..d3b5c3628386 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json @@ -0,0 +1,161 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/490/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/490/options.json deleted file mode 100644 index e95a2d7f7535..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/490/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:47)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json new file mode 100644 index 000000000000..d0eb8e29b2a1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json @@ -0,0 +1,250 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 35, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "FunctionExpression", + "start": 38, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/491/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/491/options.json deleted file mode 100644 index e29c7aee6091..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/491/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'package' in strict mode (1:10)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json new file mode 100644 index 000000000000..d6510094936e --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json @@ -0,0 +1,161 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "package" + }, + "name": "package" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/492/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/492/options.json deleted file mode 100644 index 43dc5662e1e5..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/492/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:48)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json new file mode 100644 index 000000000000..98e096877880 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json @@ -0,0 +1,292 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "i" + }, + "name": "i" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + { + "type": "ObjectMethod", + "start": 42, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 48, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/493/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/493/options.json deleted file mode 100644 index 439ffff53e89..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/493/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:41)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json new file mode 100644 index 000000000000..f974d83f5a98 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json @@ -0,0 +1,237 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 35, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 41, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/494/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/494/options.json deleted file mode 100644 index 8b18a4ec3e5a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/494/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:49)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json new file mode 100644 index 000000000000..2993cf648835 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json @@ -0,0 +1,268 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 35, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "FunctionExpression", + "start": 38, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "s" + }, + "name": "s" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 49, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 53 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 55, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/495/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/495/options.json deleted file mode 100644 index 794c4864d4e5..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/495/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json new file mode 100644 index 000000000000..4534376b270a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/496/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/496/options.json deleted file mode 100644 index 212d35fcb5fe..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/496/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json new file mode 100644 index 000000000000..cb41c2783446 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/497/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/497/options.json deleted file mode 100644 index 43dc5662e1e5..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/497/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:48)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json new file mode 100644 index 000000000000..d8df2c1c2d07 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json @@ -0,0 +1,197 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 33, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "inner" + }, + "name": "inner" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 48, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/498/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/498/options.json deleted file mode 100644 index 8370ba5c765f..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/498/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:48)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json new file mode 100644 index 000000000000..a2fc6cb4db0e --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json @@ -0,0 +1,197 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 33, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "inner" + }, + "name": "inner" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 48, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 57 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + ], + "body": { + "type": "BlockStatement", + "start": 59, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/499/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/499/options.json deleted file mode 100644 index ae2bfab55c68..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/499/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:35)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json new file mode 100644 index 000000000000..1504ace4ac5d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:35)", + "SyntaxError: Octal literal in strict mode (1:35)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + }, + { + "type": "Directive", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "value": "\\1", + "extra": { + "raw": "\"\\1\"", + "rawValue": "\\1" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/500/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/500/options.json deleted file mode 100644 index 45ca229c1e8e..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/500/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (1:33)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json new file mode 100644 index 000000000000..805c176e7856 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json @@ -0,0 +1,163 @@ +{ + "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", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "extra": { + "rawValue": 17, + "raw": "021" + }, + "value": 17 + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/501/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/501/options.json deleted file mode 100644 index 7e50b5f9165e..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/501/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:38)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json new file mode 100644 index 000000000000..f73cb42cd9cf --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json @@ -0,0 +1,221 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:38)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 33, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 34, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 36, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "extra": { + "rawValue": "\u0001", + "raw": "\"\\1\"" + }, + "value": "\u0001" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 33 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/502/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/502/options.json deleted file mode 100644 index 8f6c8218f747..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/502/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (1:36)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json new file mode 100644 index 000000000000..5eb3bcef0b18 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json @@ -0,0 +1,221 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 34, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 36, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "method": false, + "key": { + "type": "NumericLiteral", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "extra": { + "rawValue": 17, + "raw": "021" + }, + "value": 17 + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 33 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/503/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/503/options.json deleted file mode 100644 index 8389b2c726ca..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/503/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:69)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json new file mode 100644 index 000000000000..e52fa38ccf73 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:69)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 33, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "inner" + }, + "name": "inner" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 52, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 72 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/504/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/504/options.json deleted file mode 100644 index 0641de45e29a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/504/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'implements' (1:37)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json new file mode 100644 index 000000000000..0f64682a8eb0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'implements' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "implements" + }, + "name": "implements" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/505/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/505/options.json deleted file mode 100644 index 859238d0423f..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/505/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'interface' (1:37)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json new file mode 100644 index 000000000000..8222afc6a0e6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'interface' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "interface" + }, + "name": "interface" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/506/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/506/options.json deleted file mode 100644 index 344c7075f4bf..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/506/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'package' (1:37)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json new file mode 100644 index 000000000000..f977c4c528e0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'package' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "package" + }, + "name": "package" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/507/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/507/options.json deleted file mode 100644 index 9fb9deaf9cba..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/507/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'private' (1:37)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json new file mode 100644 index 000000000000..b1147bbff4e1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'private' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "private" + }, + "name": "private" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/508/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/508/options.json deleted file mode 100644 index 292fb56f1cf3..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/508/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'protected' (1:37)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json new file mode 100644 index 000000000000..1b1c3bcecf8b --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'protected' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "protected" + }, + "name": "protected" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/509/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/509/options.json deleted file mode 100644 index d5f48446906a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/509/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'public' (1:37)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json new file mode 100644 index 000000000000..8c06677a9156 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'public' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "public" + }, + "name": "public" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/510/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/510/options.json deleted file mode 100644 index 0f41ff2e6f24..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/510/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'static' (1:37)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json new file mode 100644 index 000000000000..12f9d4d5420d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'static' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "static" + }, + "name": "static" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/511/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/511/options.json deleted file mode 100644 index 78c799ec6a49..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/511/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'static' in strict mode (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json new file mode 100644 index 000000000000..ab669586dc27 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "static" + }, + "name": "static" + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 25, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/512/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/512/options.json deleted file mode 100644 index d4a2d92e5b45..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/512/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'static' in strict mode (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json new file mode 100644 index 000000000000..be76a2099b54 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "static" + }, + "name": "static" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/513/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/513/options.json deleted file mode 100644 index 91bc36d3f360..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/513/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'static' (1:23)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json new file mode 100644 index 000000000000..03212ebf3a29 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json @@ -0,0 +1,128 @@ +{ + "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: Binding 'static' in strict mode (1:23)", + "SyntaxError: Binding 'static' in strict mode (1:23)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "static" + }, + "name": "static" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/514/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/514/options.json deleted file mode 100644 index 8b20b9a7df36..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/514/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:14)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json new file mode 100644 index 000000000000..f945eeb57491 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/515/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/515/options.json deleted file mode 100644 index 85fd3822f433..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/515/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json new file mode 100644 index 000000000000..f2ff5d38de33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/516/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/516/options.json deleted file mode 100644 index 604b5896c2c5..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/516/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'package' in strict mode (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json new file mode 100644 index 000000000000..2f734055a47a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "package" + }, + "name": "package" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/517/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/517/options.json deleted file mode 100644 index 9d2a58081596..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/517/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:43)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json new file mode 100644 index 000000000000..60ac3ce8c98c --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:43)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 29, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "b" + }, + "name": "b" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "EmptyStatement", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/518/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/518/options.json deleted file mode 100644 index 61c3bbb5abe0..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/518/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json new file mode 100644 index 000000000000..766ec14c5a33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/519/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/519/options.json deleted file mode 100644 index ae469fbd59da..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/519/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:44)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json new file mode 100644 index 000000000000..0f2e3c5dce01 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json @@ -0,0 +1,233 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:44)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 30, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "b" + }, + "name": "b" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 29 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/520/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/520/options.json deleted file mode 100644 index b60957f217a4..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/520/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:12)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json new file mode 100644 index 000000000000..7945e482ca86 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/521/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/521/options.json deleted file mode 100644 index 62075401e782..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/521/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'package' in strict mode (1:12)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json new file mode 100644 index 000000000000..304b4237e9e7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "package" + }, + "name": "package" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/522/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/522/options.json deleted file mode 100644 index 0b443b9bacfa..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/522/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (1:65)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json new file mode 100644 index 000000000000..98d2e052715b --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json @@ -0,0 +1,285 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 69 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 13, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 28, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "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" + } + } + } + ] + } + }, + { + "type": "FunctionDeclaration", + "start": 42, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 69 + } + }, + "id": { + "type": "Identifier", + "start": 51, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 51 + }, + "end": { + "line": 1, + "column": 54 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 56, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 56 + }, + "end": { + "line": 1, + "column": 69 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 57, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 57 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 61, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "id": { + "type": "Identifier", + "start": 61, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 62 + }, + "identifierName": "v" + }, + "name": "v" + }, + "init": { + "type": "NumericLiteral", + "start": 65, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 65 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "extra": { + "rawValue": 13, + "raw": "015" + }, + "value": 13 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/523/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/523/options.json deleted file mode 100644 index 60a9d5934bd2..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/523/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'this' (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json new file mode 100644 index 000000000000..90808a26c8be --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'this' (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "this" + }, + "name": "this" + }, + "init": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/524/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/524/options.json deleted file mode 100644 index d07b41872ba6..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/524/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal newline after throw (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json new file mode 100644 index 000000000000..55552e2994ca --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ThrowStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 2 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/544/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/544/options.json deleted file mode 100644 index 37c243afff2a..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/544/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'public' (2:8)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json new file mode 100644 index 000000000000..eb3ded152bb0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json @@ -0,0 +1,213 @@ +{ + "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: Binding 'public' in strict mode (2:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "id": { + "type": "ObjectPattern", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "public" + }, + "name": "public" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "public" + }, + "name": "public" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "CallExpression", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 22 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json index b09fdddc9d0a..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'public' (1:8)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json new file mode 100644 index 000000000000..14bc7d51e260 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json @@ -0,0 +1,177 @@ +{ + "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: Binding 'public' in strict mode (1:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "public" + }, + "name": "public" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "public" + }, + "name": "public" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "CallExpression", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/547/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/547/options.json deleted file mode 100644 index c2fb6377e80d..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/547/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'arguments' (2:8)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json new file mode 100644 index 000000000000..39ef331a20b1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json @@ -0,0 +1,213 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved word 'arguments' (2:8)", + "SyntaxError: Binding 'arguments' in strict mode (2:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": { + "type": "ObjectPattern", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "CallExpression", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "callee": { + "type": "Identifier", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json index 4183c2e22534..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'arguments' (1:8)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json new file mode 100644 index 000000000000..132483692bbd --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json @@ -0,0 +1,177 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved word 'arguments' (1:8)", + "SyntaxError: Binding 'arguments' in strict mode (1:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "CallExpression", + "start": 22, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "callee": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/550/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/550/options.json deleted file mode 100644 index 5cee88d901e4..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/550/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (2:10)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json new file mode 100644 index 000000000000..9b383cded8fd --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "extra": { + "rawValue": 7, + "raw": "07" + }, + "value": 7 + } + } + ], + "kind": "const" + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/552/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/552/options.json deleted file mode 100644 index 5cee88d901e4..000000000000 --- a/packages/babel-parser/test/fixtures/core/uncategorised/552/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (2:10)" -} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json new file mode 100644 index 000000000000..a7d3e10860a2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "extra": { + "rawValue": 8, + "raw": "08" + }, + "value": 8 + } + } + ], + "kind": "const" + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json index eff49cbfba64..6d24025b8674 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json @@ -1,4 +1,3 @@ { - "createParenthesizedExpressions": true, - "throws": "You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" -} + "createParenthesizedExpressions": true +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json new file mode 100644 index 000000000000..448578186a0a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json @@ -0,0 +1,228 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "errors": [ + "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "ParenthesizedExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "ObjectPattern", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "extra": { + "shorthand": true + } + } + ] + } + }, + "right": { + "type": "ObjectExpression", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json index f37c4bc95c57..6d24025b8674 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json @@ -1,4 +1,3 @@ { - "createParenthesizedExpressions": true, - "throws": "You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)" -} + "createParenthesizedExpressions": true +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json new file mode 100644 index 000000000000..e2a0d2a8ba52 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json @@ -0,0 +1,134 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "operator": "=", + "left": { + "type": "ParenthesizedExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "ArrayPattern", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + }, + "right": { + "type": "ArrayExpression", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/options.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/options.json deleted file mode 100644 index 7931fd924fcd..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected trailing comma after rest element (1:5)" -} 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 new file mode 100644 index 000000000000..3d5c2a07c806 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "trailingComma": 5 + }, + "elements": [ + { + "type": "RestElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "argument": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + }, + "right": { + "type": "ArrayExpression", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "elements": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json deleted file mode 100644 index 0b0d3c532d1e..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected trailing comma after rest element (1:10)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..f97d7f0db889 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json @@ -0,0 +1,136 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "left": { + "type": "ArrayPattern", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "trailingComma": 10 + }, + "elements": [ + { + "type": "RestElement", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + }, + "right": { + "type": "ArrayExpression", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [] + }, + "body": { + "type": "EmptyStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json deleted file mode 100644 index 95a846d785a8..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected trailing comma after rest element (1:6)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..4cbc33abae7e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json @@ -0,0 +1,154 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "trailingComma": 6 + }, + "elements": [ + { + "type": "RestElement", + "start": 2, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "argument": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + } + ] + }, + "right": { + "type": "ArrayExpression", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/comma-after-rest-param/options.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/comma-after-rest-param/options.json index 38fec89ef15c..5ed0b104c003 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/comma-after-rest-param/options.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/comma-after-rest-param/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected trailing comma after rest element (1:8)" -} + "throws": "Unexpected token, expected \")\" (1:8)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/options.json deleted file mode 100644 index 660e644cf6a5..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "super is only allowed in object methods and classes (4:13)" -} 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 new file mode 100644 index 000000000000..6a343317ea61 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json @@ -0,0 +1,340 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 3 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 2 + } + }, + "callee": { + "type": "MemberExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "Object" + }, + "name": "Object" + }, + "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": [ + { + "type": "ObjectExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [] + }, + { + "type": "ObjectExpression", + "start": 18, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 22, + "end": 83, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectExpression", + "start": 27, + "end": 83, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 33, + "end": 79, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "get" + }, + "name": "get" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "FunctionExpression", + "start": 38, + "end": 79, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 48, + "end": 79, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 56, + "end": 73, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "argument": { + "type": "MemberExpression", + "start": 63, + "end": 72, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "object": { + "type": "Super", + "start": 63, + "end": 68, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "start": 69, + "end": 72, + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 22 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false + } + } + ], + "directives": [] + } + } + } + ] + } + } + ] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json deleted file mode 100644 index 9461325c423a..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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? (2:8)" -} 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 new file mode 100644 index 000000000000..65fe6001d2c6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json @@ -0,0 +1,191 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 28, + "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": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "callee": { + "type": "Super", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + } + }, + "arguments": [] + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/options.json deleted file mode 100644 index a848b7de671a..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (2:11)" -} 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 new file mode 100644 index 000000000000..328e55a13f5d --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json @@ -0,0 +1,179 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Argument name clash (2:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json deleted file mode 100644 index 524ed587e113..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Classes may not have static property named prototype (2:10)" -} 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 new file mode 100644 index 000000000000..0ffcd2fd0520 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 36, + "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": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "static": true, + "kind": "method", + "key": { + "type": "Identifier", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "prototype" + }, + "name": "prototype" + }, + "computed": false, + "id": null, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/options.json deleted file mode 100644 index f30c8a49abd3..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Classes may not have static property named prototype (2:9)" -} 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 new file mode 100644 index 000000000000..f78f786f6aa9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 35, + "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": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "static": true, + "key": { + "type": "Identifier", + "start": 19, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "prototype" + }, + "name": "prototype" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/options.json deleted file mode 100644 index 65bc24a66fcd..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "getter must not have any formal parameters (2:2)" -} 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 new file mode 100644 index 000000000000..1f5262e935f3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json @@ -0,0 +1,162 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, + "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": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "prop" + }, + "name": "prop" + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "arg" + }, + "name": "arg" + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/options.json b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/options.json deleted file mode 100644 index 09a1c52e4354..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/class/extends-strict/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'with' in strict mode (2:2)" -} 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 new file mode 100644 index 000000000000..efd21a8e7118 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/class/extends-strict/output.json @@ -0,0 +1,237 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": { + "type": "CallExpression", + "start": 17, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 17, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "B" + }, + "name": "B" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "WithStatement", + "start": 34, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "object": { + "type": "ObjectExpression", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + } + } + }, + { + "type": "ReturnStatement", + "start": 47, + "end": 56, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "argument": { + "type": "Identifier", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "B" + }, + "name": "B" + } + } + ], + "directives": [] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 16 + } + }, + "body": { + "type": "ClassBody", + "start": 62, + "end": 64, + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/options.json b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/options.json deleted file mode 100644 index 1b54b61689e7..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'this' (1:6)" -} 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 new file mode 100644 index 000000000000..a246297545bc --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/output.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'this' (1:6)", + "SyntaxError: Complex binding patterns require an initialization value (1:12)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "this" + }, + "name": "this" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "this" + }, + "name": "this" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/options.json b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/options.json deleted file mode 100644 index f52857170baa..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Only '=' operator can be used for specifying default value. (1:3)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json new file mode 100644 index 000000000000..a26de7c1fac3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json @@ -0,0 +1,158 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "errors": [ + "SyntaxError: Only '=' operator can be used for specifying default value. (1:3)", + "SyntaxError: Invalid left-hand side in array destructuring pattern (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "AssignmentExpression", + "start": 2, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "+=", + "left": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/options.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/options.json deleted file mode 100644 index dfcad1b5cbf0..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)" -} 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 new file mode 100644 index 000000000000..111c55cd65bd --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-array/output.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "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", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/options.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/options.json deleted file mode 100644 index d0fb48924093..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" -} 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 new file mode 100644 index 000000000000..34adca287e3e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": true, + "value": { + "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", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json deleted file mode 100644 index 2a64fa7c20ad..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-loop (2:5)" -} 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 new file mode 100644 index 000000000000..bde13b8bdbda --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json @@ -0,0 +1,187 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ForInStatement", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "left": { + "type": "AssignmentPattern", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + "right": { + "type": "ObjectExpression", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json deleted file mode 100644 index 68677faac9b9..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..b85f54f50027 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json @@ -0,0 +1,154 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "const" + }, + "right": { + "type": "ObjectExpression", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json deleted file mode 100644 index 68677faac9b9..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..d890ea49e1da --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json @@ -0,0 +1,154 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "right": { + "type": "ObjectExpression", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json deleted file mode 100644 index 1fa21b020d65..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-in loop variable declaration may not have an initializer (2:5)" -} 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 new file mode 100644 index 000000000000..556eea44650d --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/for-in/strict-initializer/output.json @@ -0,0 +1,190 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 19, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "var" + }, + "right": { + "type": "ObjectExpression", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 22 + } + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json deleted file mode 100644 index 68677faac9b9..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..fbffb7c6994a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json @@ -0,0 +1,171 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "ArrayPattern", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + }, + "init": { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "var" + }, + "right": { + "type": "ObjectExpression", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json deleted file mode 100644 index 68677faac9b9..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..0afdc7b4d271 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "ObjectPattern", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "var" + }, + "right": { + "type": "ObjectExpression", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json deleted file mode 100644 index 2a64fa7c20ad..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-loop (2:5)" -} 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 new file mode 100644 index 000000000000..936a7b0183e3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json @@ -0,0 +1,188 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ForOfStatement", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "await": false, + "left": { + "type": "AssignmentPattern", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + "right": { + "type": "ObjectExpression", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json index 67305b830e87..8d7589bff5a4 100644 --- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json +++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json @@ -1,3 +1,3 @@ { - "throws": "Can not use 'yield' as identifier inside a generator (1:16)" -} + "throws": "Unexpected token, expected \";\" (1:27)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/options.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/options.json deleted file mode 100644 index 8cdac51705a1..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Generators can only be declared at the top level or inside a block (1:16)" -} 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 new file mode 100644 index 000000000000..0059c885f4d8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "test": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "consequent": { + "type": "FunctionDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/options.json deleted file mode 100644 index d6c0b22e3090..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Escape sequence in keyword const (1:14)" -} 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 new file mode 100644 index 000000000000..9b7b38d58487 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Escape sequence in keyword const (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "const" + }, + "name": "const" + }, + "init": { + "type": "NumericLiteral", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 123, + "raw": "123" + }, + "value": 123 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json deleted file mode 100644 index 80870219d5cc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Escape sequence in keyword export (1:15)" -} 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 new file mode 100644 index 000000000000..306595677000 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "errors": [ + "SyntaxError: Escape sequence in keyword export (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "export" + }, + "name": "export" + }, + "init": { + "type": "NumericLiteral", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 123, + "raw": "123" + }, + "value": 123 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/options.json deleted file mode 100644 index 52faf91d3656..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Escape sequence in keyword if (1:12)" -} 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 new file mode 100644 index 000000000000..4da6a4e43640 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json @@ -0,0 +1,87 @@ +{ + "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:12)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": true + }, + "consequent": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json deleted file mode 100644 index 45763ffa389b..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Escape sequence in keyword import (1:40)" -} 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 new file mode 100644 index 000000000000..fe3db26d020a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "errors": [ + "SyntaxError: Escape sequence in keyword import (1:40)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "import" + }, + "name": "import" + }, + "init": { + "type": "NumericLiteral", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "extra": { + "rawValue": 123, + "raw": "123" + }, + "value": 123 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/options.json deleted file mode 100644 index 34db9f6413ed..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Escape sequence in keyword null (1:9)" -} 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 new file mode 100644 index 000000000000..912c74d9fcbd --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json @@ -0,0 +1,70 @@ +{ + "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:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "null" + }, + "name": "null" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/options.json deleted file mode 100644 index c1c2620da097..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Escape sequence in keyword true (1:9)" -} 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 new file mode 100644 index 000000000000..d216ce539ec6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json @@ -0,0 +1,70 @@ +{ + "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:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "true" + }, + "name": "true" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/options.json deleted file mode 100644 index ab238c8bbff9..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'let' (2:0)" -} 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 new file mode 100644 index 000000000000..85fa32674b37 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-strict-fail/output.json @@ -0,0 +1,142 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 14, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "let" + }, + "name": "let" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/options.json deleted file mode 100644 index 75f41b260f56..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json new file mode 100644 index 000000000000..e6e2ced3bb0c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json @@ -0,0 +1,159 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "errors": [ + "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "let" + }, + "name": "let" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "let" + }, + "name": "let" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [] + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/options.json deleted file mode 100644 index 0a2459ae24fc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:8)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json new file mode 100644 index 000000000000..2c3d3871ec80 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json @@ -0,0 +1,159 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "errors": [ + "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "let" + }, + "name": "let" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "let" + }, + "name": "let" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/options.json deleted file mode 100644 index 80b209cf3816..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json new file mode 100644 index 000000000000..4354932c617c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json @@ -0,0 +1,121 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "errors": [ + "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:5)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "let" + }, + "name": "let" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [] + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/options.json deleted file mode 100644 index ccbcbd4b6bbc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:7)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json new file mode 100644 index 000000000000..720c37df7a15 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json @@ -0,0 +1,121 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "errors": [ + "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:7)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "ArrayPattern", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "let" + }, + "name": "let" + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/options.json deleted file mode 100644 index 6152a659dcca..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json new file mode 100644 index 000000000000..93d70aa80f8b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json @@ -0,0 +1,89 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "errors": [ + "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "let" + }, + "name": "let" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/options.json deleted file mode 100644 index 75f41b260f56..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json new file mode 100644 index 000000000000..77846750f6ed --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "errors": [ + "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "let" + }, + "name": "let" + }, + "init": { + "type": "StringLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "", + "raw": "''" + }, + "value": "" + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json deleted file mode 100644 index 2c54a7452db9..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (2:6)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json new file mode 100644 index 000000000000..ecd45f67f5c5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json @@ -0,0 +1,172 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (2:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 7, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "param": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "err" + }, + "name": "err" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 23, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "let" + }, + "name": "let" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/options.json deleted file mode 100644 index 4931a93f395d..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "new.target can only be used in functions (2:2)" -} 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 new file mode 100644 index 000000000000..64d4a8d35758 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json @@ -0,0 +1,189 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "expression": { + "type": "MetaProperty", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "meta": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "target" + }, + "name": "target" + } + } + } + ], + "directives": [] + } + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json deleted file mode 100644 index 8a88f91714d0..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The only valid meta property for new is new.target (1:4)" -} 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 new file mode 100644 index 000000000000..dcfdebf0f762 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json @@ -0,0 +1,103 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: The only valid meta property for new is new.target (1:4)", + "SyntaxError: new.target can only be used in functions (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "MetaProperty", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "meta": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "prop" + }, + "name": "prop" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/options.json deleted file mode 100644 index 112b0adc3e61..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Escape sequence in keyword new (1:23)" -} 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 new file mode 100644 index 000000000000..c500d9a7b8e4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json @@ -0,0 +1,156 @@ +{ + "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:23)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "MemberExpression", + "start": 15, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "object": { + "type": "Identifier", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "target" + }, + "name": "target" + }, + "computed": false + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/options.json deleted file mode 100644 index 09a27d63dba1..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The only valid meta property for new is new.target (1:19)" -} 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 new file mode 100644 index 000000000000..2fa8e1dd5500 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json @@ -0,0 +1,155 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "MetaProperty", + "start": 15, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "meta": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 19, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "target" + }, + "name": "target" + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/options.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/options.json deleted file mode 100644 index 092a825444ad..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "new.target can only be used in functions (1:0)" -} 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 new file mode 100644 index 000000000000..4283f53e7dea --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json @@ -0,0 +1,102 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "MetaProperty", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "meta": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "target" + }, + "name": "target" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json index 275e6a57f95f..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json @@ -1,3 +1,3 @@ { - "throws": "Only one default export allowed per module. (2:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..019d83e37ab4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json @@ -0,0 +1,173 @@ +{ + "type": "File", + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "declaration": { + "type": "FunctionDeclaration", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 30, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 39, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "local": { + "type": "Identifier", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 46, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "default" + }, + "name": "default" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/options.json index 1ec6a5168f14..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/options.json @@ -1,3 +1,3 @@ { - "throws": "Only one default export allowed per module. (2:0)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json new file mode 100644 index 000000000000..d8e83bc56d6e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json @@ -0,0 +1,135 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "errors": [ + "SyntaxError: Only one default export allowed per module. (2:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "declaration": { + "type": "ObjectExpression", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [] + } + }, + { + "type": "ExportDefaultDeclaration", + "start": 19, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "declaration": { + "type": "FunctionDeclaration", + "start": 34, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 29 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/options.json index 3bdafe893282..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/options.json @@ -1,3 +1,3 @@ { - "throws": "`Foo` has already been exported. Exported identifiers must be unique. (2:0)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json new file mode 100644 index 000000000000..cf1a59d2669e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json @@ -0,0 +1,187 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "errors": [ + "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "Foo" + }, + "name": "Foo" + } + } + ], + "source": null, + "declaration": null + }, + { + "type": "ExportNamedDeclaration", + "start": 16, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "ClassDeclaration", + "start": 23, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "body": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/options.json index ea1f7f46f967..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:15)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json new file mode 100644 index 000000000000..ae3e358fbe8c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json @@ -0,0 +1,280 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "errors": [ + "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "source": null, + "declaration": null + }, + { + "type": "ExportNamedDeclaration", + "start": 16, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 23, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 29, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "id": { + "type": "ObjectPattern", + "start": 29, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 31, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "AssignmentPattern", + "start": 31, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "left": { + "type": "Identifier", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "right": { + "type": "NumericLiteral", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 30 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/options.json deleted file mode 100644 index 446a980f5409..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:20)" -} 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 new file mode 100644 index 000000000000..ba018d66dfd9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring10/output.json @@ -0,0 +1,331 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:20)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 26, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 33, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 39, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "id": { + "type": "ObjectPattern", + "start": 39, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 41, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 44, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 45, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 46, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 46, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 46, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + } + ] + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 56, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 33 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/options.json deleted file mode 100644 index 09b3fa97a0d1..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo4' has already been declared (2:50)" -} 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 new file mode 100644 index 000000000000..853a21053688 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring11/output.json @@ -0,0 +1,521 @@ +{ + "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: `foo4` has already been exported. Exported identifiers must be unique. (2:50)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 96, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 69 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "foo4" + }, + "name": "foo4" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 27, + "end": 96, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 69 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 34, + "end": 96, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 69 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 40, + "end": 95, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 68 + } + }, + "id": { + "type": "ArrayPattern", + "start": 40, + "end": 89, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 62 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 41, + "end": 88, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 61 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 43, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 46, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 47, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 57, + "end": 86, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 59 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 57, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 31 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectPattern", + "start": 60, + "end": 86, + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 59 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 62, + "end": 84, + "loc": { + "start": { + "line": 2, + "column": 35 + }, + "end": { + "line": 2, + "column": 57 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 62, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 35 + }, + "end": { + "line": 2, + "column": 39 + }, + "identifierName": "foo2" + }, + "name": "foo2" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 68, + "end": 84, + "loc": { + "start": { + "line": 2, + "column": 41 + }, + "end": { + "line": 2, + "column": 57 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 69, + "end": 83, + "loc": { + "start": { + "line": 2, + "column": 42 + }, + "end": { + "line": 2, + "column": 56 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 71, + "end": 81, + "loc": { + "start": { + "line": 2, + "column": 44 + }, + "end": { + "line": 2, + "column": 54 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 71, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 44 + }, + "end": { + "line": 2, + "column": 48 + }, + "identifierName": "foo3" + }, + "name": "foo3" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 77, + "end": 81, + "loc": { + "start": { + "line": 2, + "column": 50 + }, + "end": { + "line": 2, + "column": 54 + }, + "identifierName": "foo4" + }, + "name": "foo4" + } + } + ] + } + ] + } + } + ] + } + } + ] + } + ] + }, + "init": { + "type": "Identifier", + "start": 92, + "end": 95, + "loc": { + "start": { + "line": 2, + "column": 65 + }, + "end": { + "line": 2, + "column": 68 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/options.json deleted file mode 100644 index 3a7173c837e3..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo4' has already been declared (2:49)" -} 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 new file mode 100644 index 000000000000..9100976f570c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring12/output.json @@ -0,0 +1,504 @@ +{ + "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: `foo4` has already been exported. Exported identifiers must be unique. (2:49)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 94, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 67 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "foo4" + }, + "name": "foo4" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 27, + "end": 94, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 67 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 34, + "end": 94, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 67 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 40, + "end": 93, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 66 + } + }, + "id": { + "type": "ObjectPattern", + "start": 40, + "end": 87, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 60 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 42, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 45, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 46, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 56, + "end": 85, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 58 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 56, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectPattern", + "start": 59, + "end": 85, + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 58 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 61, + "end": 83, + "loc": { + "start": { + "line": 2, + "column": 34 + }, + "end": { + "line": 2, + "column": 56 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 61, + "end": 65, + "loc": { + "start": { + "line": 2, + "column": 34 + }, + "end": { + "line": 2, + "column": 38 + }, + "identifierName": "foo2" + }, + "name": "foo2" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 67, + "end": 83, + "loc": { + "start": { + "line": 2, + "column": 40 + }, + "end": { + "line": 2, + "column": 56 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 68, + "end": 82, + "loc": { + "start": { + "line": 2, + "column": 41 + }, + "end": { + "line": 2, + "column": 55 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 70, + "end": 80, + "loc": { + "start": { + "line": 2, + "column": 43 + }, + "end": { + "line": 2, + "column": 53 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 70, + "end": 74, + "loc": { + "start": { + "line": 2, + "column": 43 + }, + "end": { + "line": 2, + "column": 47 + }, + "identifierName": "foo3" + }, + "name": "foo3" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 76, + "end": 80, + "loc": { + "start": { + "line": 2, + "column": 49 + }, + "end": { + "line": 2, + "column": 53 + }, + "identifierName": "foo4" + }, + "name": "foo4" + } + } + ] + } + ] + } + } + ] + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 90, + "end": 93, + "loc": { + "start": { + "line": 2, + "column": 63 + }, + "end": { + "line": 2, + "column": 66 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/options.json deleted file mode 100644 index d3fc42a61ba1..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo4' has already been declared (2:58)" -} 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 new file mode 100644 index 000000000000..63e32c488670 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring13/output.json @@ -0,0 +1,556 @@ +{ + "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: `foo4` has already been exported. Exported identifiers must be unique. (2:58)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 103, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 76 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "foo4" + }, + "name": "foo4" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 27, + "end": 103, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 76 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 34, + "end": 103, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 76 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 40, + "end": 102, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 75 + } + }, + "id": { + "type": "ObjectPattern", + "start": 40, + "end": 96, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 69 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 42, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 45, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 46, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 48, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 48, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "foo4" + }, + "name": "foo4" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 54, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 30 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + ] + } + }, + { + "type": "ObjectProperty", + "start": 62, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 35 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 62, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 35 + }, + "end": { + "line": 2, + "column": 36 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 62, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 35 + }, + "end": { + "line": 2, + "column": 36 + }, + "identifierName": "b" + }, + "name": "b" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 65, + "end": 94, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 67 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 65, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 39 + }, + "identifierName": "c" + }, + "name": "c" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectPattern", + "start": 68, + "end": 94, + "loc": { + "start": { + "line": 2, + "column": 41 + }, + "end": { + "line": 2, + "column": 67 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 70, + "end": 92, + "loc": { + "start": { + "line": 2, + "column": 43 + }, + "end": { + "line": 2, + "column": 65 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 70, + "end": 74, + "loc": { + "start": { + "line": 2, + "column": 43 + }, + "end": { + "line": 2, + "column": 47 + }, + "identifierName": "foo2" + }, + "name": "foo2" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 76, + "end": 92, + "loc": { + "start": { + "line": 2, + "column": 49 + }, + "end": { + "line": 2, + "column": 65 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 77, + "end": 91, + "loc": { + "start": { + "line": 2, + "column": 50 + }, + "end": { + "line": 2, + "column": 64 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 79, + "end": 89, + "loc": { + "start": { + "line": 2, + "column": 52 + }, + "end": { + "line": 2, + "column": 62 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 79, + "end": 83, + "loc": { + "start": { + "line": 2, + "column": 52 + }, + "end": { + "line": 2, + "column": 56 + }, + "identifierName": "foo3" + }, + "name": "foo3" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 85, + "end": 89, + "loc": { + "start": { + "line": 2, + "column": 58 + }, + "end": { + "line": 2, + "column": 62 + }, + "identifierName": "foo4" + }, + "name": "foo4" + } + } + ] + } + ] + } + } + ] + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 99, + "end": 102, + "loc": { + "start": { + "line": 2, + "column": 72 + }, + "end": { + "line": 2, + "column": 75 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/options.json deleted file mode 100644 index 80640e0ce127..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:21)" -} 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 new file mode 100644 index 000000000000..1d699b58133a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json @@ -0,0 +1,262 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:21)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 22, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 29, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "id": { + "type": "ObjectPattern", + "start": 35, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "foo2" + }, + "name": "foo2" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 51, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/options.json deleted file mode 100644 index ea3a9b62f493..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo2' has already been declared (2:13)" -} 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 new file mode 100644 index 000000000000..140798f03a2d --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json @@ -0,0 +1,262 @@ +{ + "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: `foo2` has already been exported. Exported identifiers must be unique. (2:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "ObjectPattern", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 20, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "foo2" + }, + "name": "foo2" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 34, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 41, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 47, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "foo2" + }, + "name": "foo2" + }, + "init": { + "type": "NumericLiteral", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/options.json deleted file mode 100644 index 42c862ad273a..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:22)" -} 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 new file mode 100644 index 000000000000..d51c3a34e349 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json @@ -0,0 +1,259 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 22, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 29, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "id": { + "type": "ArrayPattern", + "start": 35, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + { + "type": "RestElement", + "start": 41, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "argument": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 51, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "baz" + }, + "name": "baz" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/options.json deleted file mode 100644 index 125c2618435d..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'bar' has already been declared (2:13)" -} 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 new file mode 100644 index 000000000000..5d56b3c37e96 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json @@ -0,0 +1,259 @@ +{ + "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: `bar` has already been exported. Exported identifiers must be unique. (2:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "ArrayPattern", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + { + "type": "RestElement", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "argument": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "baz" + }, + "name": "baz" + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 34, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 41, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 47, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "init": { + "type": "NumericLiteral", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/options.json deleted file mode 100644 index bf345ea77127..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:28)" -} 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 new file mode 100644 index 000000000000..0378d078ec4f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json @@ -0,0 +1,293 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:28)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 40 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 22, + "end": 62, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 40 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 29, + "end": 62, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 40 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 61, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "id": { + "type": "ArrayPattern", + "start": 35, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + { + "type": "ArrayPattern", + "start": 41, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 42, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + { + "type": "RestElement", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "argument": { + "type": "Identifier", + "start": 50, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 31 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + ] + }, + "init": { + "type": "Identifier", + "start": 58, + "end": 61, + "loc": { + "start": { + "line": 2, + "column": 36 + }, + "end": { + "line": 2, + "column": 39 + }, + "identifierName": "qux" + }, + "name": "qux" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/options.json deleted file mode 100644 index bf2483362193..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:29)" -} 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 new file mode 100644 index 000000000000..e185b7f4186f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json @@ -0,0 +1,311 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:29)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 42 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 22, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 42 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 29, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 42 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 41 + } + }, + "id": { + "type": "ObjectPattern", + "start": 35, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 37, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 42, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + { + "type": "RestElement", + "start": 48, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "argument": { + "type": "Identifier", + "start": 51, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 60, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 41 + }, + "identifierName": "qux" + }, + "name": "qux" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/options.json deleted file mode 100644 index 2cbe06c40914..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:15)" -} 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 new file mode 100644 index 000000000000..8e8c195325fc --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring2/output.json @@ -0,0 +1,262 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 26, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 33, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 39, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "id": { + "type": "ObjectPattern", + "start": 39, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 26 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/options.json deleted file mode 100644 index d36390356990..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:16)" -} 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 new file mode 100644 index 000000000000..f862a6a420c6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring3/output.json @@ -0,0 +1,262 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "ObjectPattern", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 28, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 35, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/options.json deleted file mode 100644 index 46358493589c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:14)" -} 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 new file mode 100644 index 000000000000..401baa93a85a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json @@ -0,0 +1,224 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 7, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 26, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 33, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 39, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "id": { + "type": "ArrayPattern", + "start": 39, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 40, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + }, + "init": { + "type": "Identifier", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/options.json deleted file mode 100644 index d36390356990..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:16)" -} 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 new file mode 100644 index 000000000000..39b035aada97 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json @@ -0,0 +1,224 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "ArrayPattern", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + }, + "init": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 26, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 33, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/options.json deleted file mode 100644 index 46358493589c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:14)" -} 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 new file mode 100644 index 000000000000..d4856c9023d7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring6/output.json @@ -0,0 +1,279 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "ObjectPattern", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 28, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 35, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 41, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "id": { + "type": "ArrayPattern", + "start": 41, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 42, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + }, + "init": { + "type": "Identifier", + "start": 49, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "bar2" + }, + "name": "bar2" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/options.json deleted file mode 100644 index 2cbe06c40914..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'foo' has already been declared (2:15)" -} 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 new file mode 100644 index 000000000000..3bfd361f5286 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring7/output.json @@ -0,0 +1,279 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "ArrayPattern", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + }, + "init": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 26, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 33, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 39, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": { + "type": "ObjectPattern", + "start": 39, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 49, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 27 + }, + "identifierName": "bar2" + }, + "name": "bar2" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/options.json deleted file mode 100644 index 982078d803c6..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'Foo' has already been declared (2:15)" -} 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 new file mode 100644 index 000000000000..5826aac519d7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring8/output.json @@ -0,0 +1,259 @@ +{ + "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: `Foo` has already been exported. Exported identifiers must be unique. (2:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "ClassDeclaration", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 21, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 28, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 34, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "id": { + "type": "ObjectPattern", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 26 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/options.json deleted file mode 100644 index f79b5469b1c0..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'Foo' has already been declared (2:14)" -} 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 new file mode 100644 index 000000000000..4ee921df359a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json @@ -0,0 +1,221 @@ +{ + "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: `Foo` has already been exported. Exported identifiers must be unique. (2:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "ClassDeclaration", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 21, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 28, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 34, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "id": { + "type": "ArrayPattern", + "start": 34, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "Foo" + }, + "name": "Foo" + } + ] + }, + "init": { + "type": "Identifier", + "start": 42, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/options.json index 1923e4752336..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/options.json @@ -1,3 +1,3 @@ { - "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:0)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json new file mode 100644 index 000000000000..ac8f210f8ba9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "errors": [ + "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "source": null, + "declaration": null + }, + { + "type": "ExportNamedDeclaration", + "start": 16, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "FunctionDeclaration", + "start": 23, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + }, + { + "type": "EmptyStatement", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 25 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/options.json index 9fdf7082da17..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/options.json @@ -1,3 +1,3 @@ { - "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:13)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json new file mode 100644 index 000000000000..981050ec6112 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "errors": [ + "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "source": null, + "declaration": null + }, + { + "type": "ExportNamedDeclaration", + "start": 16, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 23, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 29, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "Identifier", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 22 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/options.json index 9bb46f4778eb..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/options.json @@ -1,3 +1,3 @@ { - "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..b6476d620353 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json @@ -0,0 +1,176 @@ +{ + "type": "File", + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "exported": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "source": null, + "declaration": null + }, + { + "type": "ExportNamedDeclaration", + "start": 16, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "local": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "exported": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/options.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/options.json index 379fb1f86234..3c8ee8805e34 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/options.json @@ -1,4 +1,6 @@ { - "plugins": ["flow"], - "throws": "Unexpected keyword 'default' (1:9)" -} + "sourceType": "module", + "plugins": [ + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..d1f169eb7647 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json @@ -0,0 +1,126 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'default' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "imported": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "default" + }, + "name": "default" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "default" + }, + "name": "default" + } + } + ], + "importKind": "value", + "source": { + "type": "StringLiteral", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/options.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/options.json index cda01e8412c3..3c8ee8805e34 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/options.json @@ -1,4 +1,6 @@ { - "plugins": ["flow"], - "throws": "Unexpected keyword 'typeof' (1:9)" -} + "sourceType": "module", + "plugins": [ + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..62e2b403628d --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json @@ -0,0 +1,126 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'typeof' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "imported": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "typeof" + }, + "name": "typeof" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "typeof" + }, + "name": "typeof" + } + } + ], + "importKind": "value", + "source": { + "type": "StringLiteral", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/options.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/options.json index a45cdb986dd1..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected keyword 'typeof' (1:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..cd60a3c49fe9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'typeof' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "imported": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "typeof" + }, + "name": "typeof" + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "typeof" + }, + "name": "typeof" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/options.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/options.json index 2c6a46df3f6e..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected keyword 'debugger' (1:9)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..40242124c0c4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'debugger' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "imported": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "debugger" + }, + "name": "debugger" + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "debugger" + }, + "name": "debugger" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/options.json b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/options.json deleted file mode 100644 index a848b7de671a..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (2:11)" -} 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 new file mode 100644 index 000000000000..b9fa1b56ec84 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/object/disallow-duplicate-method-params/output.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "errors": [ + "SyntaxError: Argument name clash (2:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "body": [], + "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/options.json b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/options.json deleted file mode 100644 index 86670c5168d0..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Duplicate regular expression flag (1:6)" -} 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 new file mode 100644 index 000000000000..86ec306e13d1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "raw": "/./gii" + }, + "pattern": ".", + "flags": "gii" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/1/options.json b/packages/babel-parser/test/fixtures/es2015/shorthand/1/options.json deleted file mode 100644 index eaa26955dc77..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'const' (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json new file mode 100644 index 000000000000..712caaafe1a1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'const' (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ObjectExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "const" + }, + "name": "const" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "const" + }, + "name": "const" + }, + "extra": { + "shorthand": true + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 8 + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/2/options.json b/packages/babel-parser/test/fixtures/es2015/shorthand/2/options.json deleted file mode 100644 index be39a4451388..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'this' (1:8)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json new file mode 100644 index 000000000000..c91daf2f66d8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json @@ -0,0 +1,240 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'this' (1:8)", + "SyntaxError: Unexpected keyword 'if' (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "get" + }, + "name": "get" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "get" + }, + "name": "get" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "this" + }, + "name": "this" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "this" + }, + "name": "this" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "ObjectProperty", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "if" + }, + "name": "if" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "if" + }, + "name": "if" + }, + "extra": { + "shorthand": true + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/options.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/options.json deleted file mode 100644 index a064a678e553..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Lexical declaration cannot appear in a single-statement context (1:5)" -} 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 new file mode 100644 index 000000000000..b0dd4fe9c6d0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json @@ -0,0 +1,135 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": { + "type": "VariableDeclaration", + "start": 5, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "init": { + "type": "NullLiteral", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + } + ], + "kind": "const" + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/options.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/options.json deleted file mode 100644 index 95aaacb458f8..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Async functions can only be declared at the top level or inside a block (1:5)" -} 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 new file mode 100644 index 000000000000..31af7aa06caf --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": { + "type": "FunctionDeclaration", + "start": 5, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/options.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/options.json deleted file mode 100644 index 3f6e90c7cd27..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Generators can only be declared at the top level or inside a block (1:13)" -} 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 new file mode 100644 index 000000000000..5dd39402a92b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": { + "type": "FunctionDeclaration", + "start": 5, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "body": [], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/options.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/options.json deleted file mode 100644 index 1eebe15c408e..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "In strict mode code, functions can only be declared at top level or inside a block (1:35)" -} 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 new file mode 100644 index 000000000000..782989ece4c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-strict/output.json @@ -0,0 +1,211 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [ + { + "type": "LabeledStatement", + "start": 30, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": { + "type": "FunctionDeclaration", + "start": 35, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": [], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 16, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json deleted file mode 100644 index 1fc5db8949ff..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json new file mode 100644 index 000000000000..1bc303096308 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json @@ -0,0 +1,207 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "await": false, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "list" + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "callee": { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "process" + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json deleted file mode 100644 index 42317f2b92ee..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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? (1:40)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json new file mode 100644 index 000000000000..fcaa1ad31779 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json @@ -0,0 +1,246 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "expression": { + "type": "ClassExpression", + "start": 15, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 23, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 24, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "expression": { + "type": "CallExpression", + "start": 40, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "callee": { + "type": "Super", + "start": 40, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 45 + } + } + }, + "arguments": [] + } + } + ], + "directives": [] + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 14 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/input.js index a7bd428bbfce..83b8fa3b72d4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/input.js +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/input.js @@ -1 +1 @@ -class A { constructor() {} 'constructor'() } \ No newline at end of file +class A { constructor() {} 'constructor'() {} } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/options.json deleted file mode 100644 index 09e50a3d71c3..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Duplicate constructor in the same class (1:27)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json new file mode 100644 index 000000000000..d4cca9c08ac4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json @@ -0,0 +1,203 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "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": 47, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 27, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "static": false, + "key": { + "type": "StringLiteral", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "extra": { + "rawValue": "constructor", + "raw": "'constructor'" + }, + "value": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 43, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/options.json deleted file mode 100644 index 38e87b07044c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Constructor can't have get/set modifier (1:14)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json new file mode 100644 index 000000000000..b1c776635e95 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "errors": [ + "SyntaxError: Constructor can't have get/set modifier (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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": 32, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/options.json deleted file mode 100644 index becf560010f4..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Constructor can't be a generator (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json new file mode 100644 index 000000000000..8eb2f5bd2f58 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "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": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 10, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "static": false, + "kind": "method", + "key": { + "type": "Identifier", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "id": null, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json deleted file mode 100644 index b25685c6eac5..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:16)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json new file mode 100644 index 000000000000..62466668edcb --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:16)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ObjectPattern", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/options.json deleted file mode 100644 index 3f09c36a5f1c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 8 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json new file mode 100644 index 000000000000..12a024fb2c03 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0o" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/options.json deleted file mode 100644 index 3f09c36a5f1c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 8 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json new file mode 100644 index 000000000000..4b91f320f950 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0o9" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json new file mode 100644 index 000000000000..9978c5342ef3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 8, + "raw": "0o18" + }, + "value": 8 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/options.json deleted file mode 100644 index 3f09c36a5f1c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 8 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json new file mode 100644 index 000000000000..5d2ed2d91388 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0O" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/options.json deleted file mode 100644 index 3f09c36a5f1c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 8 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json new file mode 100644 index 000000000000..af4105738ef8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0O9" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json new file mode 100644 index 000000000000..617cc13b6615 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 8, + "raw": "0O18" + }, + "value": 8 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/options.json deleted file mode 100644 index 40dc3da9a8f4..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 2 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json new file mode 100644 index 000000000000..0688a297c669 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0b" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/options.json deleted file mode 100644 index 40dc3da9a8f4..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 2 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json new file mode 100644 index 000000000000..7281fb745a17 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0b9" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json new file mode 100644 index 000000000000..25d711669b8b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 2, + "raw": "0b18" + }, + "value": 2 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json new file mode 100644 index 000000000000..379e9db894c0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 2, + "raw": "0b12" + }, + "value": 2 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/options.json deleted file mode 100644 index 40dc3da9a8f4..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 2 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json new file mode 100644 index 000000000000..c87719ade97e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0B" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/options.json deleted file mode 100644 index 40dc3da9a8f4..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 2 (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json new file mode 100644 index 000000000000..e82ab6ace61a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0B9" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json new file mode 100644 index 000000000000..3726afdc10d4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 2, + "raw": "0B18" + }, + "value": 2 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json new file mode 100644 index 000000000000..402fcffc9e54 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 2, + "raw": "0B12" + }, + "value": 2 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/216/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/216/options.json index 77b813987217..8dfd231d943b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/216/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/216/options.json @@ -1,3 +1,3 @@ { - "throws": "Code point out of bounds (1:4)" -} + "throws": "Invalid code point 1114112" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/options.json deleted file mode 100644 index efaa7d304ccc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json new file mode 100644 index 000000000000..6052cbe571f5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "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{}" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/options.json deleted file mode 100644 index efaa7d304ccc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json new file mode 100644 index 000000000000..781e807d0c94 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/options.json deleted file mode 100644 index efaa7d304ccc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json new file mode 100644 index 000000000000..fcf4254c7a65 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "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}" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json new file mode 100644 index 000000000000..51d63380296a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json @@ -0,0 +1,120 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "operator": "+=", + "left": { + "type": "ArrayExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "v" + }, + "name": "v" + } + ] + }, + "right": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "ary" + }, + "name": "ary" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/options.json deleted file mode 100644 index 7c5f08eb9ba6..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json new file mode 100644 index 000000000000..6932acaf94d1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in assignment expression (1:1)", + "SyntaxError: Invalid left-hand side in array destructuring pattern (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ] + }, + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/options.json deleted file mode 100644 index e6630c3da3e8..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in object destructuring pattern (1:7)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json new file mode 100644 index 000000000000..d1731b24d0f8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json @@ -0,0 +1,167 @@ +{ + "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)", + "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "obj" + }, + "name": "obj" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 20, + "raw": "20" + }, + "value": 20 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "right": { + "type": "NumericLiteral", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/options.json deleted file mode 100644 index da1e10744904..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Object pattern can't contain getter or setter (1:8)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json new file mode 100644 index 000000000000..e43fe16db1b6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json @@ -0,0 +1,168 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "errors": [ + "SyntaxError: Object pattern can't contain getter or setter (1:8)", + "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)", + "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 2, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "right": { + "type": "NumericLiteral", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/options.json deleted file mode 100644 index 74c1a72d5030..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'default' (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json new file mode 100644 index 000000000000..c725f1875b33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json @@ -0,0 +1,90 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'default' (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "default" + }, + "name": "default" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json deleted file mode 100644 index 3f171f03c70c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:44)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json new file mode 100644 index 000000000000..2a794ddc885e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json @@ -0,0 +1,292 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "i" + }, + "name": "i" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + { + "type": "ObjectMethod", + "start": 42, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 44, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/options.json deleted file mode 100644 index a33dde469094..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:37)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json new file mode 100644 index 000000000000..73e7c59a8b68 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json @@ -0,0 +1,254 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 30, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 29 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/options.json deleted file mode 100644 index 5c79fd4f4ff2..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'super' (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json new file mode 100644 index 000000000000..c129c3fce1d1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json @@ -0,0 +1,89 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'super' (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "super" + }, + "name": "super" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/options.json deleted file mode 100644 index 8a17d90eba69..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'default' (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json new file mode 100644 index 000000000000..e901e11e9473 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json @@ -0,0 +1,89 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'default' (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "default" + }, + "name": "default" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/options.json deleted file mode 100644 index 8a17d90eba69..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'default' (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json new file mode 100644 index 000000000000..635346ad81de --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json @@ -0,0 +1,89 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'default' (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "default" + }, + "name": "default" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/input.js index 49ff0434557a..5b6b54d778e4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/input.js +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/input.js @@ -1 +1 @@ -const default \ No newline at end of file +const default = 2 \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/options.json deleted file mode 100644 index d91e2a5bbc25..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'default' (1:6)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json new file mode 100644 index 000000000000..760cb15ffdeb --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'default' (1:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "default" + }, + "name": "default" + }, + "init": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json deleted file mode 100644 index 084570ac7584..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:20)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json new file mode 100644 index 000000000000..1fbc3ac656a7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json @@ -0,0 +1,196 @@ +{ + "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: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 14, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "v" + }, + "name": "v" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 20, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 14 + } + }, + "right": { + "type": "Identifier", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json deleted file mode 100644 index bfa460f59bbd..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:20)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json new file mode 100644 index 000000000000..ada5ea9281b8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json @@ -0,0 +1,196 @@ +{ + "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: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 14, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 15, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "v" + }, + "name": "v" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 14 + } + }, + "right": { + "type": "Identifier", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json deleted file mode 100644 index 68677faac9b9..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json new file mode 100644 index 000000000000..f42607bf0849 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json @@ -0,0 +1,206 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "list" + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "callee": { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "process" + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json deleted file mode 100644 index 1fc5db8949ff..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json new file mode 100644 index 000000000000..1679566d43da --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json @@ -0,0 +1,207 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "await": false, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "list" + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "callee": { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "process" + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json deleted file mode 100644 index 92845f5f2081..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json new file mode 100644 index 000000000000..3731ec6d7b75 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json @@ -0,0 +1,182 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "right": { + "type": "NumericLiteral", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "body": { + "type": "NumericLiteral", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json deleted file mode 100644 index ad54c428a2f9..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:14)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json new file mode 100644 index 000000000000..dbffe6547ab5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "NumericLiteral", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json deleted file mode 100644 index bfa08eae293e..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:14)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json new file mode 100644 index 000000000000..1b3ed15f002e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + ], + "body": { + "type": "NumericLiteral", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json deleted file mode 100644 index 794c4864d4e5..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json new file mode 100644 index 000000000000..6b7ae83c0ad2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json deleted file mode 100644 index 212d35fcb5fe..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json new file mode 100644 index 000000000000..c681755fb108 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json deleted file mode 100644 index 794c4864d4e5..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json new file mode 100644 index 000000000000..b8b375182e2c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json @@ -0,0 +1,198 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + { + "type": "AssignmentPattern", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "left": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "body": { + "type": "NumericLiteral", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/options.json deleted file mode 100644 index b99fd35222b1..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:18)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json new file mode 100644 index 000000000000..3a5f60bdddea --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:18)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/options.json deleted file mode 100644 index 79a05e62290e..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (1:21)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json new file mode 100644 index 000000000000..18c0889f74b8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 0, + "raw": "00" + }, + "value": 0 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/options.json deleted file mode 100644 index 99ffc0de0153..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json new file mode 100644 index 000000000000..11b48d988225 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json @@ -0,0 +1,114 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", + "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ], + "body": { + "type": "NumericLiteral", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "00" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/options.json deleted file mode 100644 index 99ffc0de0153..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json new file mode 100644 index 000000000000..fb79f18aa20a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", + "SyntaxError: Invalid left-hand side in arrow function parameters (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", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + }, + { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 20, + "raw": "20" + }, + "value": 20 + } + ], + "body": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "00" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/options.json deleted file mode 100644 index 5cbee309bd50..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:30)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json new file mode 100644 index 000000000000..299c0dabdaa1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json @@ -0,0 +1,216 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:30)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ObjectPattern", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/options.json deleted file mode 100644 index 8dba9882c0dc..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:47)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json new file mode 100644 index 000000000000..50b6eca3fddd --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json @@ -0,0 +1,392 @@ +{ + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:47)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 27, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectPattern", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + }, + { + "type": "ArrayPattern", + "start": 39, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 40, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 42, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectPattern", + "start": 45, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + } + } + ] + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/options.json deleted file mode 100644 index 71f5061aff9a..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (1:3)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json new file mode 100644 index 000000000000..05a6a4bba833 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (1:3)", + "SyntaxError: Binding invalid left-hand side in array destructuring pattern (1:3)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json deleted file mode 100644 index a8f0b3c33031..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:5)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json new file mode 100644 index 000000000000..db0bdfa5417b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json @@ -0,0 +1,184 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "t" + }, + "name": "t" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "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" + } + } + } + ] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/options.json deleted file mode 100644 index 473cd470d4f1..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:23)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json new file mode 100644 index 000000000000..34fe89ec4c5a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json @@ -0,0 +1,165 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "test" + }, + "name": "test" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 15, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "", + "cooked": "" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "value": { + "raw": "\\02", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/options.json deleted file mode 100644 index ae24fbee33c8..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'import' and 'export' may only appear at the top level (1:7)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json new file mode 100644 index 000000000000..42655f4b978c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json @@ -0,0 +1,111 @@ +{ + "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 appear only with 'sourceType: \"module\"' (1:7)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "test": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "consequent": { + "type": "ImportDeclaration", + "start": 7, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "start": 14, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": "acorn", + "raw": "\"acorn\"" + }, + "value": "acorn" + } + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json deleted file mode 100644 index 794c4864d4e5..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json new file mode 100644 index 000000000000..49e0835c1bfc --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "NumericLiteral", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json deleted file mode 100644 index cc2bef2a9a34..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json new file mode 100644 index 000000000000..85866aeddd23 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json @@ -0,0 +1,179 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "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" + } + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/options.json deleted file mode 100644 index 49d27a1476b0..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Object pattern can't contain getter or setter (1:7)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json new file mode 100644 index 000000000000..5300255c00f5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json @@ -0,0 +1,167 @@ +{ + "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: Binding invalid left-hand side in object destructuring pattern (1:3)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "test" + }, + "name": "test" + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + ] + } + ], + "body": { + "type": "NumericLiteral", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/options.json deleted file mode 100644 index d921abda8ff6..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Complex binding patterns require an initialization value (1:7)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json new file mode 100644 index 000000000000..09ca9d8754be --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json @@ -0,0 +1,106 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/options.json deleted file mode 100644 index d921abda8ff6..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Complex binding patterns require an initialization value (1:7)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json new file mode 100644 index 000000000000..6d0d7ab1d050 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json @@ -0,0 +1,106 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/options.json deleted file mode 100644 index 97818d2eea7e..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Lexical declaration cannot appear in a single-statement context (1:9)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json new file mode 100644 index 000000000000..9b5c4b8b1857 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "init": null, + "test": null, + "update": null, + "body": { + "type": "VariableDeclaration", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json deleted file mode 100644 index 5718d0551359..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:18)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json new file mode 100644 index 000000000000..cc9bdf3e164e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json @@ -0,0 +1,171 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "argument": { + "type": "Identifier", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "arr" + }, + "name": "arr" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/333/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/333/options.json deleted file mode 100644 index 567e40541c5b..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/333/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'eval' (1:16)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json new file mode 100644 index 000000000000..5d9acaecea9b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json @@ -0,0 +1,231 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved word 'eval' (1:16)", + "SyntaxError: Assigning to 'eval' in strict mode (1:16)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 15, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 15, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 16, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "AssignmentPattern", + "start": 16, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "left": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "right": { + "type": "Identifier", + "start": 23, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "defValue" + }, + "name": "defValue" + } + }, + "extra": { + "shorthand": true + } + } + ] + }, + "right": { + "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 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json index e31fbe3a64b9..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Assigning to 'eval' in strict mode (1:4)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json new file mode 100644 index 000000000000..a1414d86bbf6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json @@ -0,0 +1,135 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "RestElement", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "argument": { + "type": "Identifier", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "arr" + }, + "name": "arr" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json new file mode 100644 index 000000000000..86383c01feb1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\07", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json index ad3fdc7d73f7..0ab445fe47b8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json @@ -1,3 +1,3 @@ { - "throws": "super is only allowed in object methods and classes (1:0)" -} + "throws": "Unexpected token (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/options.json deleted file mode 100644 index 9a137564eed4..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "setter must have exactly one formal parameter (1:10)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json new file mode 100644 index 000000000000..31975621dcf1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json @@ -0,0 +1,179 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "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": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 10, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "prop" + }, + "name": "prop" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "y" + }, + "name": "y" + } + ], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/options.json deleted file mode 100644 index c1ac8e1d138d..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:17)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json new file mode 100644 index 000000000000..49d20172fcc8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json @@ -0,0 +1,184 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/options.json deleted file mode 100644 index 0d3bc321ef03..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:19)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json new file mode 100644 index 000000000000..ba254dda4d93 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json @@ -0,0 +1,187 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "__proto__", + "raw": "'__proto__'" + }, + "value": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 19, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json index c148ada0c73a..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Can not use keyword 'await' outside an async function (1:0)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json new file mode 100644 index 000000000000..f2b991f74176 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json @@ -0,0 +1,121 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "errors": [ + "SyntaxError: Can not use keyword 'await' outside an async function (1:0)", + "SyntaxError: Unexpected reserved word 'await' (1:0)", + "SyntaxError: Assigning to 'await' in strict mode (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "await" + }, + "name": "await" + }, + "right": { + "type": "CallExpression", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "callee": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json index fa250ba921b1..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Can not use keyword 'await' outside an async function (1:6)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json new file mode 100644 index 000000000000..2101c44304be --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json @@ -0,0 +1,123 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Can not use keyword 'await' outside an async function (1:6)", + "SyntaxError: Unexpected reserved word 'await' (1:6)", + "SyntaxError: Binding 'await' in strict mode (1:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "await" + }, + "name": "await" + }, + "init": { + "type": "CallExpression", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callee": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json index fd81c5071d1d..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Can not use keyword 'await' outside an async function (1:8)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json new file mode 100644 index 000000000000..8545de59cbf3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "errors": [ + "SyntaxError: Can not use keyword 'await' outside an async function (1:8)", + "SyntaxError: Unexpected reserved word 'await' (1:8)", + "SyntaxError: Binding 'await' in strict mode (1:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "await" + }, + "name": "await" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "await" + }, + "name": "await" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "CallExpression", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "callee": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json index a72d4ab0ff7f..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Can not use keyword 'await' outside an async function (1:15)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json new file mode 100644 index 000000000000..78a6181b6eae --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "errors": [ + "SyntaxError: Can not use keyword 'await' outside an async function (1:15)", + "SyntaxError: Unexpected reserved word 'await' (1:15)", + "SyntaxError: Binding 'await' in strict mode (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "await" + }, + "name": "await" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "await" + }, + "name": "await" + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json index 18d9310bd147..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Can not use keyword 'await' outside an async function (1:9)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json new file mode 100644 index 000000000000..1182853d6b38 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json @@ -0,0 +1,93 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "errors": [ + "SyntaxError: Can not use keyword 'await' outside an async function (1:9)", + "SyntaxError: Unexpected reserved word 'await' (1:9)", + "SyntaxError: Binding 'await' in strict mode (1:9)", + "SyntaxError: Binding 'await' in strict mode (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "await" + }, + "name": "await" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json index fa250ba921b1..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Can not use keyword 'await' outside an async function (1:6)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json new file mode 100644 index 000000000000..3a4719110853 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json @@ -0,0 +1,89 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "errors": [ + "SyntaxError: Can not use keyword 'await' outside an async function (1:6)", + "SyntaxError: Unexpected reserved word 'await' (1:6)", + "SyntaxError: Binding 'await' in strict mode (1:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "await" + }, + "name": "await" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json index 8e557dcc53af..53135cabff8f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json @@ -1,4 +1,3 @@ { - "sourceType": "script", - "throws": "Unexpected reserved word 'enum' (1:0)" -} + "sourceType": "script" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json new file mode 100644 index 000000000000..db0bfd7b2d15 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json @@ -0,0 +1,119 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "right": { + "type": "CallExpression", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json index 9ef8cae21e3e..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'enum' (1:0)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json new file mode 100644 index 000000000000..d51874f8f22c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json @@ -0,0 +1,120 @@ +{ + "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: Assigning to 'enum' in strict mode (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "right": { + "type": "CallExpression", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/options.json deleted file mode 100644 index 401518851fb6..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json new file mode 100644 index 000000000000..0f0e4be597a6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (1:2)", + "SyntaxError: Binding member expression (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "MemberExpression", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "object": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false + } + ] + } + ], + "body": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json index 55bc1ec84f4a..53135cabff8f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json @@ -1,4 +1,3 @@ { - "sourceType": "script", - "throws": "Unexpected reserved word 'enum' (1:6)" -} + "sourceType": "script" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json new file mode 100644 index 000000000000..6f19d31ea58f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json @@ -0,0 +1,121 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "init": { + "type": "CallExpression", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json index e6801417951e..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'enum' (1:6)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json new file mode 100644 index 000000000000..96cc1332f046 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json @@ -0,0 +1,122 @@ +{ + "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: Binding 'enum' in strict mode (1:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "init": { + "type": "CallExpression", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callee": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json index 3ef9cf1c71bb..53135cabff8f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json @@ -1,4 +1,3 @@ { - "sourceType": "script", - "throws": "Unexpected reserved word 'enum' (1:8)" -} + "sourceType": "script" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json new file mode 100644 index 000000000000..7da63dd7a987 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "CallExpression", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "callee": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json index 91d0958e3d0b..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'enum' (1:8)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json new file mode 100644 index 000000000000..3b9e20a45001 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json @@ -0,0 +1,177 @@ +{ + "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: Binding 'enum' in strict mode (1:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "init": { + "type": "CallExpression", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "callee": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json index be1d10ebd92c..53135cabff8f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json @@ -1,4 +1,3 @@ { - "sourceType": "script", - "throws": "Unexpected reserved word 'enum' (1:15)" -} + "sourceType": "script" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json new file mode 100644 index 000000000000..339a9b1d9aef --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json index f3a107c75be7..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'enum' (1:15)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json new file mode 100644 index 000000000000..c42ad32ffcb1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json @@ -0,0 +1,164 @@ +{ + "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: Binding 'enum' in strict mode (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json index de270bbb0542..53135cabff8f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json @@ -1,4 +1,3 @@ { - "sourceType": "script", - "throws": "Unexpected reserved word 'enum' (1:9)" -} + "sourceType": "script" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json new file mode 100644 index 000000000000..ed7ac1e2953c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json index 27f9ea278f30..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'enum' (1:9)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json new file mode 100644 index 000000000000..690d556783a4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json @@ -0,0 +1,92 @@ +{ + "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: Binding 'enum' in strict mode (1:9)", + "SyntaxError: Binding 'enum' in strict mode (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json index 55bc1ec84f4a..53135cabff8f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json @@ -1,4 +1,3 @@ { - "sourceType": "script", - "throws": "Unexpected reserved word 'enum' (1:6)" -} + "sourceType": "script" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json new file mode 100644 index 000000000000..e2deffa5b87d --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json @@ -0,0 +1,88 @@ +{ + "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: Binding 'enum' in strict mode (1:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json index e6801417951e..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'enum' (1:6)" -} + "sourceType": "module" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json new file mode 100644 index 000000000000..afe72915c3f3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json @@ -0,0 +1,88 @@ +{ + "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: Binding 'enum' in strict mode (1:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "enum" + }, + "name": "enum" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json index db72a6af957d..6d24025b8674 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json @@ -1,4 +1,3 @@ { - "createParenthesizedExpressions": true, - "throws": "Invalid left-hand side in arrow function parameters (1:2)" -} + "createParenthesizedExpressions": true +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json new file mode 100644 index 000000000000..0f0e4be597a6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (1:2)", + "SyntaxError: Binding member expression (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "MemberExpression", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "object": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false + } + ] + } + ], + "body": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/options.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/options.json deleted file mode 100644 index 37d7f62549c6..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (2:11)" -} 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 new file mode 100644 index 000000000000..a545b4a024b1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json @@ -0,0 +1,143 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/options.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/options.json deleted file mode 100644 index 72f8d0e0e4c3..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:11)" -} 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 new file mode 100644 index 000000000000..39554296d4c3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "FunctionExpression", + "start": 1, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/options.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/options.json deleted file mode 100644 index e55b18eb4f07..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'yield' in strict mode (1:9)" -} 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 new file mode 100644 index 000000000000..1a8500a416fb --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict-body/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/options.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/options.json deleted file mode 100644 index 320734ea2ef7..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (2:9)" -} 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 new file mode 100644 index 000000000000..33902efb1ed5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-strict/output.json @@ -0,0 +1,128 @@ +{ + "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: Binding 'yield' in strict mode (2:9)", + "SyntaxError: Binding 'yield' in strict mode (2:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-class-heritage/options.json b/packages/babel-parser/test/fixtures/es2015/yield/in-class-heritage/options.json index e817f30acb5c..23c503c046ad 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/in-class-heritage/options.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/in-class-heritage/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected reserved word 'yield' (1:16)" -} + "throws": "Unexpected token, expected \"{\" (1:22)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/in-iterator-stmt/options.json b/packages/babel-parser/test/fixtures/es2015/yield/in-iterator-stmt/options.json index ad46a65e5082..589316ba5b14 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/in-iterator-stmt/options.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/in-iterator-stmt/options.json @@ -1,3 +1,3 @@ { - "throws": "Invalid left-hand side in for-in statement (2:7)" -} + "throws": "Unexpected token, expected \")\" (2:21)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/options.json deleted file mode 100644 index 75b3f62fdacb..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:7)" -} 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 new file mode 100644 index 000000000000..6639d749ab68 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json @@ -0,0 +1,192 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:7)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "delegate": false, + "argument": null + } + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/options.json deleted file mode 100644 index 9d35f54190c8..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:15)" -} 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 new file mode 100644 index 000000000000..b029ca9f0ce9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json @@ -0,0 +1,331 @@ +{ + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 20, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "BinaryExpression", + "start": 24, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "left": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + }, + "operator": "+", + "right": { + "type": "BinaryExpression", + "start": 28, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "left": { + "type": "CallExpression", + "start": 28, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "callee": { + "type": "MemberExpression", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "object": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false + }, + "arguments": [ + { + "type": "YieldExpression", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "delegate": false, + "argument": null + } + ] + }, + "operator": "**", + "right": { + "type": "NumericLiteral", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/options.json deleted file mode 100644 index 75b3f62fdacb..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:7)" -} 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 new file mode 100644 index 000000000000..7ce61876e0a8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json @@ -0,0 +1,208 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:7)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "delegate": false, + "argument": { + "type": "Identifier", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "fn" + }, + "name": "fn" + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/options.json deleted file mode 100644 index b3ac060855bb..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:17)" -} 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 new file mode 100644 index 000000000000..e88af5b40a30 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json @@ -0,0 +1,261 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "AssignmentPattern", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "left": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b" + }, + "right": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + }, + { + "type": "AssignmentPattern", + "start": 30, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "left": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 34, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "delegate": false, + "argument": null + } + } + ], + "body": { + "type": "BlockStatement", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/options.json deleted file mode 100644 index 379c08c57e90..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:8)" -} 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 new file mode 100644 index 000000000000..b6f2f5c99bca --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json @@ -0,0 +1,231 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:8)", + "SyntaxError: Invalid left-hand side in arrow function parameters (2:8)", + "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "ArrowFunctionExpression", + "start": 24, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "YieldExpression", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "delegate": false, + "argument": null + } + ], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/options.json deleted file mode 100644 index 379c08c57e90..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:8)" -} 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 new file mode 100644 index 000000000000..ce92441a5734 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-6/output.json @@ -0,0 +1,196 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "delegate": false, + "argument": null, + "extra": { + "parenthesized": true, + "parenStart": 24 + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/options.json deleted file mode 100644 index 6f5bd40fe357..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "yield is not allowed in generator parameters (1:15)" -} 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 new file mode 100644 index 000000000000..4a1eedc0abfe --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator-method/output.json @@ -0,0 +1,182 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "errors": [ + "SyntaxError: yield is not allowed in generator parameters (1:15)", + "SyntaxError: Yield cannot be used as name inside a generator function (1:15)", + "SyntaxError: Yield cannot be used as name inside a generator function (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "method" + }, + "name": "method" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "delegate": false, + "argument": null + } + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/options.json deleted file mode 100644 index dd9a684ef928..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "yield is not allowed in generator parameters (1:17)" -} 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 new file mode 100644 index 000000000000..e27657c1aa93 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json @@ -0,0 +1,141 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "errors": [ + "SyntaxError: yield is not allowed in generator parameters (1:17)", + "SyntaxError: Yield cannot be used as name inside a generator function (1:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 13, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "delegate": false, + "argument": null + } + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/options.json deleted file mode 100644 index ecc179f974cb..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (2:16)" -} 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 new file mode 100644 index 000000000000..e051b9ac1378 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-strict/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 21 + }, + "identifierName": "yield" + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/options.json deleted file mode 100644 index b566d4944c2c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:3)" -} 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 new file mode 100644 index 000000000000..a528450c2999 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:3)", + "SyntaxError: Invalid left-hand side in arrow function parameters (2:3)", + "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "YieldExpression", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "delegate": false, + "argument": null + } + ], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/options.json deleted file mode 100644 index b566d4944c2c..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:3)" -} 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 new file mode 100644 index 000000000000..fdd2c3dee906 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:3)", + "SyntaxError: Invalid left-hand side in arrow function parameters (2:3)", + "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "YieldExpression", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "delegate": false, + "argument": { + "type": "Identifier", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "fn" + }, + "name": "fn" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/options.json deleted file mode 100644 index 479a9a79f900..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (2:9)" -} 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 new file mode 100644 index 000000000000..e7d047d9c0e0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json @@ -0,0 +1,196 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (2:9)", + "SyntaxError: Invalid left-hand side in arrow function parameters (2:9)", + "SyntaxError: Binding invalid left-hand side in function parameter list (2:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "YieldExpression", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "delegate": false, + "argument": null + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/options.json deleted file mode 100644 index 72f8d0e0e4c3..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:11)" -} 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 new file mode 100644 index 000000000000..2a15b906e992 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator-method/output.json @@ -0,0 +1,148 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "method" + }, + "name": "method" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/options.json deleted file mode 100644 index dcab4205d32f..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:13)" -} 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 new file mode 100644 index 000000000000..a8a1424ee419 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json @@ -0,0 +1,108 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/options.json deleted file mode 100644 index 0329a317f084..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'yield' in strict mode (1:12)" -} 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 new file mode 100644 index 000000000000..ad17fc3ec47d --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict-body/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/options.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/options.json deleted file mode 100644 index 75bdf3d53d6e..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (2:12)" -} 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 new file mode 100644 index 000000000000..ce1937133385 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-strict/output.json @@ -0,0 +1,145 @@ +{ + "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: Binding 'yield' in strict mode (2:12)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/options.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/options.json deleted file mode 100644 index dd9a684ef928..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "yield is not allowed in generator parameters (1:17)" -} 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 new file mode 100644 index 000000000000..f3dded193720 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json @@ -0,0 +1,158 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "errors": [ + "SyntaxError: yield is not allowed in generator parameters (1:17)", + "SyntaxError: yield is not allowed in generator parameters (1:24)", + "SyntaxError: Yield cannot be used as name inside a generator function (1:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 13, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "delegate": true, + "argument": { + "type": "YieldExpression", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "delegate": false, + "argument": null + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/options.json deleted file mode 100644 index 2c624e8cec70..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json new file mode 100644 index 000000000000..99a1c0eac6e6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json @@ -0,0 +1,126 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "operator": "**", + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 6, + "raw": "6" + }, + "value": 6 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/options.json deleted file mode 100644 index f04c5c035abb..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json new file mode 100644 index 000000000000..8bfc60ddbdbc --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "UnaryExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 5, + "raw": "5", + "parenthesized": true, + "parenStart": 1 + }, + "value": 5 + } + }, + "operator": "**", + "right": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 6, + "raw": "6" + }, + "value": 6 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/options.json deleted file mode 100644 index f04c5c035abb..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json new file mode 100644 index 000000000000..1a7be0b48b55 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json @@ -0,0 +1,130 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "UnaryExpression", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "operator": "**", + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 6, + "raw": "6" + }, + "value": 6 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/options.json index c694133bf2b1..6d24025b8674 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/options.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/options.json @@ -1,4 +1,3 @@ { - "createParenthesizedExpressions": true, - "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)" -} + "createParenthesizedExpressions": true +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json new file mode 100644 index 000000000000..56e0b17f480e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json @@ -0,0 +1,141 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "UnaryExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "ParenthesizedExpression", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + } + }, + "operator": "**", + "right": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 6, + "raw": "6" + }, + "value": 6 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/options.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/options.json index 19687fbe197a..6d24025b8674 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/options.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/options.json @@ -1,4 +1,3 @@ { - "createParenthesizedExpressions": true, - "throws": "Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" -} + "createParenthesizedExpressions": true +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json new file mode 100644 index 000000000000..5fd8ad0e4fbd --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json @@ -0,0 +1,141 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ParenthesizedExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "left": { + "type": "UnaryExpression", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 5, + "raw": "5" + }, + "value": 5 + } + }, + "operator": "**", + "right": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 6, + "raw": "6" + }, + "value": 6 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..5c66e79b6581 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern-default/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "left": { + "type": "ArrayPattern", + "start": 11, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "option1" + }, + "name": "option1" + }, + { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "option2" + }, + "name": "option2" + } + ] + }, + "right": { + "type": "ArrayExpression", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "elements": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 42, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..21f903177a3d --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/array-pattern/output.json @@ -0,0 +1,178 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "option1" + }, + "name": "option1" + }, + { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "option2" + }, + "name": "option2" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 37, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/options.json deleted file mode 100644 index 089b542c3704..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:8)" -} 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 new file mode 100644 index 000000000000..c63422a6be79 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 8, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 9, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "options" + }, + "name": "options" + }, + "right": { + "type": "ObjectExpression", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 30, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/options.json deleted file mode 100644 index 089b542c3704..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:8)" -} 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 new file mode 100644 index 000000000000..6183a084c384 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 8, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "options" + }, + "name": "options" + }, + "right": { + "type": "ObjectExpression", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 36, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..324b53bc26ec --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-function/output.json @@ -0,0 +1,175 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "options" + }, + "name": "options" + }, + "right": { + "type": "ObjectExpression", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 35, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..f40df83751ba --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/default/output.json @@ -0,0 +1,175 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "options" + }, + "name": "options" + }, + "right": { + "type": "ObjectExpression", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 29, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..4d433d4b0bc1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-function/output.json @@ -0,0 +1,175 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "Identifier", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "options" + }, + "name": "options" + }, + "right": { + "type": "ObjectExpression", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 30, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/options.json deleted file mode 100644 index 9908b496fd2a..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (2:5)" -} 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 new file mode 100644 index 000000000000..393540b1fa01 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/generator-method/output.json @@ -0,0 +1,246 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "obj" + }, + "name": "obj" + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 14, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": true, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 18, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "options" + }, + "name": "options" + }, + "right": { + "type": "ObjectExpression", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 38, + "end": 51, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "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" + } + } + } + ] + } + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/options.json deleted file mode 100644 index 5d0e394f2b9d..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (2:3)" -} 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 new file mode 100644 index 000000000000..99d18df924f2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/method/output.json @@ -0,0 +1,246 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "obj" + }, + "name": "obj" + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 14, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 16, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "left": { + "type": "Identifier", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "options" + }, + "name": "options" + }, + "right": { + "type": "ObjectExpression", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 36, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "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" + } + } + } + ] + } + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..f6c0442d811a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern-default/output.json @@ -0,0 +1,285 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "left": { + "type": "ObjectPattern", + "start": 11, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "option1" + }, + "name": "option1" + }, + "computed": false, + "shorthand": true, + "value": { + "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 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "option2" + }, + "name": "option2" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "option2" + }, + "name": "option2" + }, + "extra": { + "shorthand": true + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 42, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..2089ba375f3e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/object-pattern/output.json @@ -0,0 +1,254 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 11, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "option1" + }, + "name": "option1" + }, + "computed": false, + "shorthand": true, + "value": { + "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 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "option2" + }, + "name": "option2" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "option2" + }, + "name": "option2" + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 37, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/options.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/options.json deleted file mode 100644 index 12b18792fcc4..000000000000 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Illegal 'use strict' directive in function with non-simple parameter list (1:0)" -} 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 new file mode 100644 index 000000000000..9c23ba0225c7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/rest/output.json @@ -0,0 +1,159 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "argument": { + "type": "Identifier", + "start": 14, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "options" + }, + "name": "options" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/2/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/2/options.json deleted file mode 100644 index c6f19067ee66..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "await* has been removed from the async functions proposal. Use Promise.all() instead. (2:2)" -} 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 new file mode 100644 index 000000000000..d6708279fdcb --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json @@ -0,0 +1,154 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "argument": { + "type": "CallExpression", + "start": 32, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "arguments": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/options.json deleted file mode 100644 index 022428647fee..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'await' as identifier inside an async function (1:16)" -} 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 new file mode 100644 index 000000000000..34fa5d9a8d4f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-expression-name/output.json @@ -0,0 +1,109 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "await" + }, + "name": "await" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json deleted file mode 100644 index c066100759e2..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Await cannot be used as name inside an async function (1:20)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..c9a8709666e7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/output.json @@ -0,0 +1,231 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "errors": [ + "SyntaxError: Await cannot be used as name inside an async function (1:20)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 7, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "left": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "ArrowFunctionExpression", + "start": 11, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "await" + }, + "name": "await" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "await" + }, + "name": "await" + }, + "extra": { + "shorthand": true + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/options.json deleted file mode 100644 index d45274982dc1..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'await' as identifier inside an async function (2:11)" -} 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 new file mode 100644 index 000000000000..3d543c665be5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json @@ -0,0 +1,143 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 25, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "await" + }, + "name": "await" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/options.json deleted file mode 100644 index 9a4cb65743b5..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Await cannot be used as name inside an async function (2:23)" -} 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 new file mode 100644 index 000000000000..281c41288873 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json @@ -0,0 +1,277 @@ +{ + "type": "File", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Await cannot be used as name inside an async function (2:23)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 24, + "end": 61, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 24, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 31, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "left": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "CallExpression", + "start": 35, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "callee": { + "type": "Identifier", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "async" + }, + "name": "async" + }, + "arguments": [ + { + "type": "AssignmentExpression", + "start": 41, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "y" + }, + "name": "y" + }, + "right": { + "type": "AwaitExpression", + "start": 45, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 58, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 36 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/options.json deleted file mode 100644 index 7cec39290c2a..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Await cannot be used as name inside an async function (2:7)" -} 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 new file mode 100644 index 000000000000..329e0670c59a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json @@ -0,0 +1,210 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Await cannot be used as name inside an async function (2:7)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 24, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 24, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 25, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "AwaitExpression", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/options.json deleted file mode 100644 index b45bba7cab4a..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Await cannot be used as name inside an async function (2:13)" -} 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 new file mode 100644 index 000000000000..39796387c784 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json @@ -0,0 +1,210 @@ +{ + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Await cannot be used as name inside an async function (2:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 24, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 24, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 31, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "left": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "AwaitExpression", + "start": 35, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 47, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/options.json deleted file mode 100644 index f4af75f31164..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "await is not allowed in async function parameters (1:22)" -} 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 new file mode 100644 index 000000000000..e566a0f08075 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json @@ -0,0 +1,159 @@ +{ + "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 cannot be used as name inside an async function (1:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "AwaitExpression", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/options.json index 9e964f0047f8..1780992b49c5 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-await/options.json @@ -1,3 +1,3 @@ { - "throws": "Can not use 'await' as identifier inside an async function (1:20)" -} + "throws": "Unexpected token, expected \";\" (1:31)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json deleted file mode 100644 index 4bcd823e98be..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Async functions can only be declared at the top level or inside a block (1:10)" -} 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 new file mode 100644 index 000000000000..e4933140f380 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json @@ -0,0 +1,125 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "test": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "body": { + "type": "FunctionDeclaration", + "start": 10, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/options.json deleted file mode 100644 index 49a2f478c663..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Constructor can't be an async function (2:8)" -} 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 new file mode 100644 index 000000000000..8a46002d51c7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 36, + "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": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/options.json deleted file mode 100644 index bc7331763bfa..000000000000 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected trailing comma after rest element (1:11)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..009f7252316f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "RestElement", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "argument": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/options.json index 6dad74eebd16..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Identifier 'foo' has already been declared (2:23)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..8e0284f73c05 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/11/output.json @@ -0,0 +1,297 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:23)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 22, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 29, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "id": { + "type": "ObjectPattern", + "start": 35, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "RestElement", + "start": 42, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "argument": { + "type": "Identifier", + "start": 45, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 26 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 53, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 34 + }, + "identifierName": "baz" + }, + "name": "baz" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/options.json index 165223a448a3..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Identifier 'bar' has already been declared (2:13)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..dd11a6812a7b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/12/output.json @@ -0,0 +1,297 @@ +{ + "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: `bar` has already been exported. Exported identifiers must be unique. (2:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "ObjectPattern", + "start": 13, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "RestElement", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "argument": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "baz" + }, + "name": "baz" + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 36, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 43, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 49, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "init": { + "type": "NumericLiteral", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/options.json index 68df28e41c41..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Identifier 'foo' has already been declared (2:30)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..a591bf90155e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/13/output.json @@ -0,0 +1,349 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:30)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 44 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 22, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 44 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 29, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 44 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 65, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 43 + } + }, + "id": { + "type": "ObjectPattern", + "start": 35, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 37 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 37, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ObjectPattern", + "start": 42, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "RestElement", + "start": 49, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "argument": { + "type": "Identifier", + "start": 52, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 33 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 62, + "end": 65, + "loc": { + "start": { + "line": 2, + "column": 40 + }, + "end": { + "line": 2, + "column": 43 + }, + "identifierName": "qux" + }, + "name": "qux" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/options.json index 280073b140f0..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Identifier 'foo' has already been declared (2:29)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..d092e82a47c3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/14/output.json @@ -0,0 +1,331 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:29)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 42 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 22, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 42 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 29, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 42 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 41 + } + }, + "id": { + "type": "ArrayPattern", + "start": 35, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + { + "type": "ObjectPattern", + "start": 41, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 43, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "RestElement", + "start": 48, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "argument": { + "type": "Identifier", + "start": 51, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + ] + }, + "init": { + "type": "Identifier", + "start": 60, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 41 + }, + "identifierName": "qux" + }, + "name": "qux" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/options.json index 68df28e41c41..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Identifier 'foo' has already been declared (2:30)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..a35595b31013 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/15/output.json @@ -0,0 +1,348 @@ +{ + "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: `foo` has already been exported. Exported identifiers must be unique. (2:30)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 44 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + }, + { + "type": "ExportNamedDeclaration", + "start": 22, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 44 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 29, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 44 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 65, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 43 + } + }, + "id": { + "type": "ArrayPattern", + "start": 35, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 37 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + { + "type": "ArrayPattern", + "start": 41, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 42, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "baz" + }, + "name": "baz" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "RestElement", + "start": 49, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "argument": { + "type": "Identifier", + "start": 52, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 33 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + ] + } + ] + }, + "init": { + "type": "Identifier", + "start": 62, + "end": 65, + "loc": { + "start": { + "line": 2, + "column": 40 + }, + "end": { + "line": 2, + "column": 43 + }, + "identifierName": "qux" + }, + "name": "qux" + } + } + ], + "kind": "const" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/options.json deleted file mode 100644 index b447c590ab2c..000000000000 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid rest operator's argument (1:5)" -} 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 new file mode 100644 index 000000000000..9a9ef9274914 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/18/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "properties": [ + { + "type": "RestElement", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "argument": { + "type": "ObjectPattern", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "properties": [] + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/options.json deleted file mode 100644 index b447c590ab2c..000000000000 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid rest operator's argument (1:5)" -} 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 new file mode 100644 index 000000000000..09b6d303c4ac --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/21/output.json @@ -0,0 +1,173 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "properties": [ + { + "type": "RestElement", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "argument": { + "type": "AssignmentPattern", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/options.json deleted file mode 100644 index b447c590ab2c..000000000000 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid rest operator's argument (1:5)" -} 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 new file mode 100644 index 000000000000..2f80e2925775 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/24/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "properties": [ + { + "type": "RestElement", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [] + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/options.json deleted file mode 100644 index c44d69275adb..000000000000 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected trailing comma after rest element (1:16)" -} 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 new file mode 100644 index 000000000000..c7ff07e0d0df --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/8/output.json @@ -0,0 +1,250 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "ObjectPattern", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "shorthand": true, + "value": { + "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 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "y" + }, + "name": "y" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "y" + }, + "name": "y" + }, + "extra": { + "shorthand": true + } + }, + { + "type": "RestElement", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "argument": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "z" + }, + "name": "z" + } + } + ], + "extra": { + "trailingComma": 16 + } + }, + "init": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "obj" + }, + "name": "obj" + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/options.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/options.json deleted file mode 100644 index 8b20b9a7df36..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:14)" -} 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 new file mode 100644 index 000000000000..aa4301697cf8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/dupe-param/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json deleted file mode 100644 index a4a6e207d28c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:11)" -} 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 new file mode 100644 index 000000000000..09552b591b3f --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json @@ -0,0 +1,193 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ArrayPattern", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + } + ] + }, + { + "type": "RestElement", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "argument": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "b" + }, + "name": "b" + } + } + ] + } + ], + "body": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/options.json deleted file mode 100644 index 49e8d8e86314..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (2:14)" -} 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 new file mode 100644 index 000000000000..57442d5cb4fd --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-1/output.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Argument name clash (2:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/options.json deleted file mode 100644 index 3829082a4878..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (2:17)" -} 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 new file mode 100644 index 000000000000..4242da8e09f7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-2/output.json @@ -0,0 +1,193 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "errors": [ + "SyntaxError: Argument name clash (2:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 25, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 28, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "argument": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/options.json deleted file mode 100644 index 782073313a19..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (2:19)" -} 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 new file mode 100644 index 000000000000..00b0c28f58c6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/dupe-param-3/output.json @@ -0,0 +1,248 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "errors": [ + "SyntaxError: Argument name clash (2:19)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 26, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "a" + }, + "name": "a" + }, + "extra": { + "shorthand": true + } + } + ] + }, + { + "type": "RestElement", + "start": 30, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "argument": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json deleted file mode 100644 index fd74c5228531..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:7)" -} 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 new file mode 100644 index 000000000000..34fec649661b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json @@ -0,0 +1,159 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:7)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "RestElement", + "start": 3, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "argument": { + "type": "ArrayPattern", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + } + ] + } + } + ], + "body": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json deleted file mode 100644 index 368006ae58bd..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:4)" -} 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 new file mode 100644 index 000000000000..5456b40fe86d --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "body": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "y" + }, + "name": "y" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json deleted file mode 100644 index 8f5ca9d5da67..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:0)" -} 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 new file mode 100644 index 000000000000..1daa964b52b1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-param-strict-mode/output.json @@ -0,0 +1,143 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 8, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "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" + } + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/options.json deleted file mode 100644 index bf0f292caad2..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in object destructuring pattern (1:4)" -} 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 new file mode 100644 index 000000000000..8eb8960ae355 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json @@ -0,0 +1,199 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)", + "SyntaxError: Binding member expression (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "MemberExpression", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "property": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + } + } + ] + } + ], + "body": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/options.json deleted file mode 100644 index 559cc4e11a41..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Object pattern can't contain getter or setter (1:6)" -} 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 new file mode 100644 index 000000000000..cfd6fd2fb6af --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json @@ -0,0 +1,167 @@ +{ + "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: Binding invalid left-hand side in object destructuring pattern (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "body": [], + "directives": [] + } + } + ] + } + ], + "body": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/options.json deleted file mode 100644 index 30f209db8f07..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in object destructuring pattern (1:24)" -} 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 new file mode 100644 index 000000000000..2956af5c9a0e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json @@ -0,0 +1,539 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in object destructuring pattern (1:24)", + "SyntaxError: Binding member expression (1:24)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 1, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 2, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 3, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 4, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 5, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 6, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 7, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 8, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 9, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 10, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 13, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 15, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 16, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 17, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 19, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "MemberExpression", + "start": 24, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "object": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "b" + }, + "name": "b" + }, + "property": { + "type": "NumericLiteral", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "computed": true + } + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ], + "body": { + "type": "NumericLiteral", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json deleted file mode 100644 index bf0f292caad2..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in object destructuring pattern (1:4)" -} 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 new file mode 100644 index 000000000000..89f16c86c886 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-01/output.json @@ -0,0 +1,161 @@ +{ + "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", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ThisExpression", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + } + ] + }, + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json deleted file mode 100644 index 2cfe61cdc033..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in object destructuring pattern (1:5)" -} 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 new file mode 100644 index 000000000000..43142f71dcd8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-lhs-02/output.json @@ -0,0 +1,161 @@ +{ + "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", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 1, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ThisExpression", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + } + } + } + ] + }, + "right": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json deleted file mode 100644 index 081535f854c6..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Object pattern can't contain methods (1:2)" -} 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 new file mode 100644 index 000000000000..5fca3277888c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/output.json @@ -0,0 +1,168 @@ +{ + "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: Invalid left-hand side in object destructuring pattern (1:2)", + "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json deleted file mode 100644 index 7c5f08eb9ba6..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:1)" -} 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 new file mode 100644 index 000000000000..104d3f520ff3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment/invalid-group-assignment/output.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in assignment expression (1:1)", + "SyntaxError: Invalid left-hand side in assignment expression (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "SequenceExpression", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "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 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "c" + }, + "name": "c" + }, + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "d" + }, + "name": "d" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json index 9371e19769ce..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected keyword 'default' (1:8)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..0b3a95c25658 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json @@ -0,0 +1,107 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "local": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "default" + }, + "name": "default" + }, + "exported": { + "type": "Identifier", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "default" + }, + "name": "default" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json deleted file mode 100644 index 1fc5db8949ff..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..9addc13c958b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json @@ -0,0 +1,156 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "await": false, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "y" + }, + "name": "y" + }, + "body": { + "type": "EmptyStatement", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json deleted file mode 100644 index 1fc5db8949ff..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..e7720b34974c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json @@ -0,0 +1,156 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "await": false, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "y" + }, + "name": "y" + }, + "body": { + "type": "EmptyStatement", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json deleted file mode 100644 index a4dd545935e8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-of statement (1:5)" -} 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 new file mode 100644 index 000000000000..58a3e4e97f69 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json @@ -0,0 +1,102 @@ +{ + "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", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "await": false, + "left": { + "type": "ThisExpression", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + } + }, + "right": { + "type": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "that" + }, + "name": "that" + }, + "body": { + "type": "EmptyStatement", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json deleted file mode 100644 index 1fc5db8949ff..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..5c95e7b34186 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json @@ -0,0 +1,156 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForOfStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "await": false, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + "right": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "y" + }, + "name": "y" + }, + "body": { + "type": "EmptyStatement", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json deleted file mode 100644 index df97a8ee679f..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:4)" -} 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 new file mode 100644 index 000000000000..111d8eb97b43 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "𞸀" + }, + "name": "𞸀" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json deleted file mode 100644 index afbed324e92a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json new file mode 100644 index 000000000000..a6d558c93efe --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json @@ -0,0 +1,158 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "errors": [ + "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "answer" + }, + "name": "answer" + }, + "init": { + "type": "BinaryExpression", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "await" + }, + "name": "await" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "kind": "var" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json deleted file mode 100644 index afbed324e92a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)" -} diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json new file mode 100644 index 000000000000..514e8e0f0abe --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "errors": [ + "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 7, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "await" + }, + "name": "await" + }, + "init": null + } + ], + "kind": "var" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json deleted file mode 100644 index 57893e4eee56..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Complex binding patterns require an initialization value (1:6)" -} 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 new file mode 100644 index 000000000000..fe814362c2c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json @@ -0,0 +1,88 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [] + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json deleted file mode 100644 index 68677faac9b9..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..f2fe5561bb8d --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json @@ -0,0 +1,157 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "y" + }, + "name": "y" + }, + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json deleted file mode 100644 index 68677faac9b9..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} 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 new file mode 100644 index 000000000000..3a3a8f1230c5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json @@ -0,0 +1,157 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 5, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "right": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "y" + }, + "name": "y" + }, + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json deleted file mode 100644 index a8a536e737f3..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "new.target can only be used in functions (1:8)" -} 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 new file mode 100644 index 000000000000..e02e90a31d33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "MetaProperty", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "meta": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "target" + }, + "name": "target" + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json deleted file mode 100644 index f1d291c3e468..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The only valid meta property for new is new.target (1:25)" -} 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 new file mode 100644 index 000000000000..4bcbca3b0d36 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json @@ -0,0 +1,189 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "f" + }, + "name": "f" + }, + "init": { + "type": "FunctionExpression", + "start": 8, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 21, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "MetaProperty", + "start": 21, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "meta": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 25, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "unknown_property" + }, + "name": "unknown_property" + } + } + } + ], + "directives": [] + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json deleted file mode 100644 index de857a114a82..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:39)" -} 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 new file mode 100644 index 000000000000..8316c5f97f85 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-getter-literal-identifier/output.json @@ -0,0 +1,234 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "__proto" + }, + "name": "__proto" + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ObjectProperty", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + } + } + }, + { + "type": "ObjectProperty", + "start": 39, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 39, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 50, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 54 + } + } + } + } + ], + "extra": { + "trailingComma": 54, + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json deleted file mode 100644 index 5c966843f4fa..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:20)" -} 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 new file mode 100644 index 000000000000..5e3da9129e41 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifier-literal/output.json @@ -0,0 +1,177 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + }, + { + "type": "ObjectProperty", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json deleted file mode 100644 index 5c966843f4fa..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:20)" -} 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 new file mode 100644 index 000000000000..f0884a922d47 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-identifiers/output.json @@ -0,0 +1,174 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + }, + { + "type": "ObjectProperty", + "start": 20, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 35 + } + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json deleted file mode 100644 index e19950ad14df..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:22)" -} 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 new file mode 100644 index 000000000000..7b8c0af8927c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literal-identifier/output.json @@ -0,0 +1,177 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + }, + { + "type": "ObjectProperty", + "start": 22, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json deleted file mode 100644 index e19950ad14df..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:22)" -} 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 new file mode 100644 index 000000000000..a9e0e52b80af --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-literals/output.json @@ -0,0 +1,180 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + }, + { + "type": "ObjectProperty", + "start": 22, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "extra": { + "rawValue": "__proto__", + "raw": "'__proto__'" + }, + "value": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 35, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 39 + } + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json deleted file mode 100644 index f364ee918462..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:42)" -} 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 new file mode 100644 index 000000000000..1a77efa6deef --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/invalid-proto-setter-literal-identifier/output.json @@ -0,0 +1,252 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 3, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ObjectProperty", + "start": 23, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 23, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "extra": { + "rawValue": "__proto__", + "raw": "\"__proto__\"" + }, + "value": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 40 + } + } + } + }, + { + "type": "ObjectProperty", + "start": 42, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NullLiteral", + "start": 53, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 57 + } + } + } + } + ], + "extra": { + "trailingComma": 57, + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json deleted file mode 100644 index cf468e48541b..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "super is only allowed in object methods and classes (1:8)" -} 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 new file mode 100644 index 000000000000..88a5ff1cee1b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json @@ -0,0 +1,120 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "errors": [ + "SyntaxError: super is only allowed in object methods and classes (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", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "CallExpression", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "callee": { + "type": "Super", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + "arguments": [] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..3f3cd6596907 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json deleted file mode 100644 index f81e206da65d..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (1:21)" -} 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 new file mode 100644 index 000000000000..93f29667086b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (1:21)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 17, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "delegate": false, + "argument": { + "type": "NumericLiteral", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json deleted file mode 100644 index efa8ac523c48..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (1:16)" -} 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 new file mode 100644 index 000000000000..3ce1bab5f80e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (1:16)", + "SyntaxError: Invalid left-hand side in arrow function parameters (1:16)", + "SyntaxError: Binding invalid left-hand side in function parameter list (1:16)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "YieldExpression", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "delegate": false, + "argument": null + } + ], + "body": { + "type": "NumericLiteral", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json deleted file mode 100644 index 185008241333..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (1:25)" -} 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 new file mode 100644 index 000000000000..8f2ce5dd74e8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json @@ -0,0 +1,216 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (1:25)", + "SyntaxError: Invalid left-hand side in arrow function parameters (1:25)", + "SyntaxError: Binding invalid left-hand side in function parameter list (1:25)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 15, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 15, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "c" + }, + "name": "c" + }, + { + "type": "YieldExpression", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "delegate": false, + "argument": null + } + ], + "body": { + "type": "NumericLiteral", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json deleted file mode 100644 index 8c287a1d5b36..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:30)" -} 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 new file mode 100644 index 000000000000..638788f4405b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json @@ -0,0 +1,173 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 16, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "block": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 23, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "param": { + "type": "Identifier", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json deleted file mode 100644 index 3ceff8546d37..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:26)" -} 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 new file mode 100644 index 000000000000..30846cf74293 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json @@ -0,0 +1,143 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 16, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json index 23a96f285fe4..54925950e059 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Unexpected reserved word 'yield' (1:25)" -} + "sourceType": "module" +} \ No newline at end of file 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 new file mode 100644 index 000000000000..d38e74d2f5ca --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json @@ -0,0 +1,107 @@ +{ + "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: Binding 'yield' in strict mode (1:25)", + "SyntaxError: Binding 'yield' in strict mode (1:25)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "declaration": { + "type": "FunctionDeclaration", + "start": 15, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json deleted file mode 100644 index c32eaf81f281..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:10)" -} 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 new file mode 100644 index 000000000000..0eca9154c92a --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-name/output.json @@ -0,0 +1,109 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json deleted file mode 100644 index 28b734910647..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:12)" -} 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 new file mode 100644 index 000000000000..dbee42bd9873 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-parameter/output.json @@ -0,0 +1,111 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json deleted file mode 100644 index aef4d7f4f9a2..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:18)" -} 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 new file mode 100644 index 000000000000..74eaaceb9832 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-expression-rest/output.json @@ -0,0 +1,143 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "RestElement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "argument": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "yield" + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json deleted file mode 100644 index 6993832643f1..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:25)" -} 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 new file mode 100644 index 000000000000..ec55ac771815 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json @@ -0,0 +1,143 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 16, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json deleted file mode 100644 index ad818f81f136..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:20)" -} 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 new file mode 100644 index 000000000000..e07b84fedd4d --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json @@ -0,0 +1,142 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 16, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json deleted file mode 100644 index 28b734910647..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:12)" -} 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 new file mode 100644 index 000000000000..91b76a6f9351 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json @@ -0,0 +1,108 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json deleted file mode 100644 index c811689d9abd..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:24)" -} 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 new file mode 100644 index 000000000000..0b1e59c7ab58 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json @@ -0,0 +1,174 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "b" + }, + "name": "b" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "c" + }, + "name": "c" + }, + { + "type": "RestElement", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "argument": { + "type": "Identifier", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "yield" + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json deleted file mode 100644 index 865e081676d6..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:46)" -} 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 new file mode 100644 index 000000000000..2ff01fa39674 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json @@ -0,0 +1,230 @@ +{ + "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: Binding 'yield' in strict mode (1:46)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 29, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 33, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "id": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "y" + }, + "name": "y" + }, + "init": { + "type": "FunctionExpression", + "start": 37, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "id": { + "type": "Identifier", + "start": 46, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 53, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json deleted file mode 100644 index 21348af52377..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:47)" -} 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 new file mode 100644 index 000000000000..ce4b71676c3a --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-parameter/output.json @@ -0,0 +1,232 @@ +{ + "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: Binding 'yield' in strict mode (1:47)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 30, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 34, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "z" + }, + "name": "z" + }, + "init": { + "type": "FunctionExpression", + "start": 38, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 47, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json deleted file mode 100644 index ad818f81f136..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Can not use 'yield' as identifier inside a generator (1:20)" -} 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 new file mode 100644 index 000000000000..770c2246fabb --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json @@ -0,0 +1,142 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 16, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json deleted file mode 100644 index e817f30acb5c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:16)" -} 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 new file mode 100644 index 000000000000..22b8f61b28c5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-array-pattern/output.json @@ -0,0 +1,161 @@ +{ + "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: Assigning to 'yield' in strict mode (1:16)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ] + }, + "right": { + "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 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json deleted file mode 100644 index e80b46c31b86..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:19)" -} 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 new file mode 100644 index 000000000000..b6b507c9e6cb --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-default/output.json @@ -0,0 +1,175 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "yield" + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json deleted file mode 100644 index 27b38d28f986..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:15)" -} 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 new file mode 100644 index 000000000000..d4b3ef0768e9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-arrow-parameter-name/output.json @@ -0,0 +1,147 @@ +{ + "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: Binding 'yield' in strict mode (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "NumericLiteral", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json deleted file mode 100644 index 5d111aab9319..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:23)" -} 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 new file mode 100644 index 000000000000..d646272c9402 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-binding-element/output.json @@ -0,0 +1,194 @@ +{ + "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: Binding 'yield' in strict mode (1:23)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "ObjectPattern", + "start": 18, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "yield" + }, + "name": "yield" + } + } + ] + }, + "init": { + "type": "Identifier", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json deleted file mode 100644 index 01aca4591cea..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:28)" -} 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 new file mode 100644 index 000000000000..ab8117bb07ce --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-catch-parameter/output.json @@ -0,0 +1,157 @@ +{ + "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: Binding 'yield' in strict mode (1:28)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 14, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "block": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "param": { + "type": "Identifier", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json deleted file mode 100644 index a4a677fb3136..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:25)" -} 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 new file mode 100644 index 000000000000..b1af37211882 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-formal-parameter/output.json @@ -0,0 +1,145 @@ +{ + "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: Binding 'yield' in strict mode (1:25)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "yield" + }, + "name": "yield" + } + ], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json deleted file mode 100644 index e55b18eb4f07..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'yield' in strict mode (1:9)" -} 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 new file mode 100644 index 000000000000..7f270919a446 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-declaration/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json deleted file mode 100644 index 8928b8977517..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'yield' in strict mode (1:10)" -} 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 new file mode 100644 index 000000000000..d65f41baceea --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-function-expression/output.json @@ -0,0 +1,145 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json deleted file mode 100644 index 412431249548..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:29)" -} 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 new file mode 100644 index 000000000000..0d4e30957667 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-identifier/output.json @@ -0,0 +1,159 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "Identifier", + "start": 29, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "yield" + }, + "name": "yield" + } + } + ], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json deleted file mode 100644 index 53a8921cb309..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:18)" -} 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 new file mode 100644 index 000000000000..11e6c19eb5b9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json @@ -0,0 +1,145 @@ +{ + "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: Binding 'yield' in strict mode (1:18)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "init": { + "type": "NumericLiteral", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "let" + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json deleted file mode 100644 index 01aca4591cea..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:28)" -} 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 new file mode 100644 index 000000000000..ec7a987deed9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-rest-parameter/output.json @@ -0,0 +1,160 @@ +{ + "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: Binding 'yield' in strict mode (1:28)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 25, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "argument": { + "type": "Identifier", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "yield" + }, + "name": "yield" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json deleted file mode 100644 index 53a8921cb309..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:18)" -} 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 new file mode 100644 index 000000000000..925a7247ad47 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-variable-declaration/output.json @@ -0,0 +1,126 @@ +{ + "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: Binding 'yield' in strict mode (1:18)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/options.json deleted file mode 100644 index f81e206da65d..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Yield cannot be used as name inside a generator function (1:21)" -} 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 new file mode 100644 index 000000000000..c26b779c0207 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json @@ -0,0 +1,192 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "errors": [ + "SyntaxError: Yield cannot be used as name inside a generator function (1:21)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "YieldExpression", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "delegate": false, + "argument": null + } + } + ], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/input.js b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/input.js index 79581f8529b7..cbd842119b94 100755 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/input.js +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/input.js @@ -1 +1 @@ -\u2163\u2161\u200A=\u2009[] +\u2163\u2161\u200A diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/options.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/options.json deleted file mode 100644 index abe9f835b84b..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:12)" -} 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 new file mode 100644 index 000000000000..ea30bc6a3013 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json @@ -0,0 +1,70 @@ +{ + "type": "File", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "errors": [ + "SyntaxError: Invalid Unicode escape (1:12)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "ⅣⅡ " + }, + "name": "ⅣⅡ " + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json deleted file mode 100644 index 8e0dce66eff8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:3)" -} 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 new file mode 100644 index 000000000000..30ad8a2a0533 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-00/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json deleted file mode 100644 index 8e0dce66eff8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:3)" -} 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 new file mode 100644 index 000000000000..91bb0ab97d98 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-01/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json deleted file mode 100644 index 8e0dce66eff8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:3)" -} 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 new file mode 100644 index 000000000000..422caf2f1ecf --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-02/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json deleted file mode 100644 index 8e0dce66eff8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:3)" -} 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 new file mode 100644 index 000000000000..a00ba8fc772c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-03/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json deleted file mode 100644 index 8e0dce66eff8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:3)" -} 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 new file mode 100644 index 000000000000..4158fada8f7f --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-04/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json deleted file mode 100644 index 8e0dce66eff8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:3)" -} 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 new file mode 100644 index 000000000000..b36764ece66c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-05/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json deleted file mode 100644 index 8e0dce66eff8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:3)" -} 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 new file mode 100644 index 000000000000..b24d044db414 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-06/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json deleted file mode 100644 index 8e0dce66eff8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Bad character escape sequence (1:3)" -} 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 new file mode 100644 index 000000000000..eb3f631398dc --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/GH-1106-07/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file 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 91bb1eef0c0d..aa61ff56c2b3 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": "Invalid number (1:0)" -} + "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_0004/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json deleted file mode 100644 index 91bb1eef0c0d..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (1:0)" -} 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 new file mode 100644 index 000000000000..284fac8c4357 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "errors": [ + "SyntaxError: Invalid number (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 3, + "raw": "3e" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json deleted file mode 100644 index 91bb1eef0c0d..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (1:0)" -} 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 new file mode 100644 index 000000000000..6b6e666b00ca --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "errors": [ + "SyntaxError: Invalid number (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 3, + "raw": "3e+" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json deleted file mode 100644 index 91bb1eef0c0d..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid number (1:0)" -} 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 new file mode 100644 index 000000000000..b52b27d1ef37 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "errors": [ + "SyntaxError: Invalid number (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 3, + "raw": "3e-" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json deleted file mode 100644 index 1a0693338eee..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 16 (1:2)" -} 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 new file mode 100644 index 000000000000..ffcb3680fd0b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0x" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json deleted file mode 100644 index 3f09c36a5f1c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 8 (1:2)" -} 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 new file mode 100644 index 000000000000..12a024fb2c03 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0o" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json deleted file mode 100644 index 3f09c36a5f1c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 8 (1:2)" -} 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 new file mode 100644 index 000000000000..5d2ed2d91388 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0O" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json deleted file mode 100644 index 3f09c36a5f1c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 8 (1:2)" -} 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 new file mode 100644 index 000000000000..4b91f320f950 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0o9" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} 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 new file mode 100644 index 000000000000..9978c5342ef3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 8, + "raw": "0o18" + }, + "value": 8 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json deleted file mode 100644 index 40dc3da9a8f4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 2 (1:2)" -} 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 new file mode 100644 index 000000000000..0688a297c669 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0b" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json deleted file mode 100644 index 40dc3da9a8f4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 2 (1:2)" -} 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 new file mode 100644 index 000000000000..7281fb745a17 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0b9" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} 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 new file mode 100644 index 000000000000..25d711669b8b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 2, + "raw": "0b18" + }, + "value": 2 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} 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 new file mode 100644 index 000000000000..379e9db894c0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 2, + "raw": "0b12" + }, + "value": 2 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json deleted file mode 100644 index 40dc3da9a8f4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 2 (1:2)" -} 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 new file mode 100644 index 000000000000..c87719ade97e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": null, + "raw": "0B" + }, + "value": null + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json deleted file mode 100644 index 40dc3da9a8f4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 2 (1:2)" -} 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 new file mode 100644 index 000000000000..e82ab6ace61a --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0B9" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} 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 new file mode 100644 index 000000000000..3726afdc10d4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 2, + "raw": "0B18" + }, + "value": 2 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} 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 new file mode 100644 index 000000000000..402fcffc9e54 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 2, + "raw": "0B12" + }, + "value": 2 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json deleted file mode 100644 index 3f09c36a5f1c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected number in radix 8 (1:2)" -} 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 new file mode 100644 index 000000000000..af4105738ef8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 0, + "raw": "0O9" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json deleted file mode 100644 index d52d9cfac4bc..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:3)" -} 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 new file mode 100644 index 000000000000..617cc13b6615 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 8, + "raw": "0O18" + }, + "value": 8 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json deleted file mode 100644 index 18c53b997b56..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)" -} 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 new file mode 100644 index 000000000000..fbb1d3b5d554 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json @@ -0,0 +1,70 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "xx\\" + }, + "name": "xx\\" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json deleted file mode 100644 index 18c53b997b56..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)" -} 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 new file mode 100644 index 000000000000..78c84a7def24 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json @@ -0,0 +1,71 @@ +{ + "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: Invalid Unicode escape (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "xx\\\\" + }, + "name": "xx\\\\" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json deleted file mode 100644 index 18c53b997b56..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)" -} 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 new file mode 100644 index 000000000000..9ad34de54933 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json @@ -0,0 +1,71 @@ +{ + "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: Invalid Unicode escape (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "xx\\*" + }, + "name": "xx\\*" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json deleted file mode 100644 index 18c53b997b56..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)" -} 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 new file mode 100644 index 000000000000..9eb536d497f9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json @@ -0,0 +1,72 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "errors": [ + "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)", + "SyntaxError: Bad character escape sequence (1:4)", + "SyntaxError: Invalid Unicode escape (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "aa\\\u0000" + }, + "name": "aa\\\u0000" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..850f07e0f4bc --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json @@ -0,0 +1,72 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "errors": [ + "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)", + "SyntaxError: Bad character escape sequence (1:3)", + "SyntaxError: Invalid Unicode escape (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "\\\u0000" + }, + "name": "\\\u0000" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json deleted file mode 100644 index adf556b0a352..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid regular expression flag (1:16)" -} 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 new file mode 100644 index 000000000000..76ef6d90fe84 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "RegExpLiteral", + "start": 8, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "extra": { + "raw": "/[a-z]/\\\\ux" + }, + "pattern": "[a-z]", + "flags": "\\\\ux" + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json deleted file mode 100644 index eae3757f4451..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid regular expression flag (1:18)" -} 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 new file mode 100644 index 000000000000..13b09289cf96 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json @@ -0,0 +1,110 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Invalid regular expression flag (1:18)", + "SyntaxError: Invalid regular expression flag (1:19)", + "SyntaxError: Invalid regular expression flag (1:21)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "RegExpLiteral", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "raw": "/[a-z\\n]/\\\\ux" + }, + "pattern": "[a-z\\n]", + "flags": "\\\\ux" + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json deleted file mode 100644 index adf556b0a352..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid regular expression flag (1:16)" -} 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 new file mode 100644 index 000000000000..89e710445090 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json @@ -0,0 +1,112 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Invalid regular expression flag (1:16)", + "SyntaxError: Invalid regular expression flag (1:17)", + "SyntaxError: Invalid regular expression flag (1:18)", + "SyntaxError: Invalid regular expression flag (1:19)", + "SyntaxError: Invalid regular expression flag (1:21)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "RegExpLiteral", + "start": 8, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "raw": "/[a-z]/\\\\\\\\ux" + }, + "pattern": "[a-z]", + "flags": "\\\\\\\\ux" + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json deleted file mode 100644 index 080cb0eaaa8a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid regular expression flag (1:17)" -} 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 new file mode 100644 index 000000000000..968729f24cff --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json @@ -0,0 +1,115 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "errors": [ + "SyntaxError: Invalid regular expression flag (1:17)", + "SyntaxError: Invalid regular expression flag (1:18)", + "SyntaxError: Invalid regular expression flag (1:19)", + "SyntaxError: Invalid regular expression flag (1:20)", + "SyntaxError: Invalid regular expression flag (1:22)", + "SyntaxError: Invalid regular expression flag (1:23)", + "SyntaxError: Invalid regular expression flag (1:24)", + "SyntaxError: Invalid regular expression flag (1:25)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "RegExpLiteral", + "start": 8, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "raw": "/[P QR]/\\\\\\\\u0067" + }, + "pattern": "[P QR]", + "flags": "\\\\\\\\u0067" + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} 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 new file mode 100644 index 000000000000..466f4bd92254 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json @@ -0,0 +1,110 @@ +{ + "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", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "operator": "=", + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + }, + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} 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 new file mode 100644 index 000000000000..8a8d67a80a10 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json @@ -0,0 +1,123 @@ +{ + "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", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "operator": "=", + "left": { + "type": "CallExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "func" + }, + "name": "func" + }, + "arguments": [] + }, + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 4, + "raw": "4" + }, + "value": 4 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json deleted file mode 100644 index 7c5f08eb9ba6..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:1)" -} 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 new file mode 100644 index 000000000000..b22f988e1aa7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0047/output.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in assignment expression (1:1)", + "SyntaxError: Invalid left-hand side in assignment expression (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "operator": "=", + "left": { + "type": "BinaryExpression", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "NumericLiteral", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "right": { + "type": "NumericLiteral", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/input.js index 2bbf7ac4d47c..1d1226dada02 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/input.js @@ -1 +1 @@ -\\u{110000} +\u{110000} diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json index 381fd12ce2d0..8dfd231d943b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0048/options.json @@ -1,3 +1,3 @@ { - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} + "throws": "Invalid code point 1114112" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/input.js index 9943cc7906a5..aabe8d74272e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/input.js @@ -1 +1 @@ -\\u{} +\u{} diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..6fe9c4b279b0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json @@ -0,0 +1,71 @@ +{ + "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: Invalid Unicode escape (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "\u0000" + }, + "name": "\u0000" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/input.js index 5d4f24cb8271..170edba55da6 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/input.js @@ -1 +1 @@ -\\u{FFFF +\u{FFFF diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..4a040c981dd0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json @@ -0,0 +1,71 @@ +{ + "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: Invalid Unicode escape (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "\u0000FFF" + }, + "name": "\u0000FFF" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/input.js index 11e05c81c1e8..0c65088d077b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/input.js @@ -1 +1 @@ -\\u{FFZ} +\u{FFZ} diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..f9a3a9bde958 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json @@ -0,0 +1,71 @@ +{ + "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: Invalid Unicode escape (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "\u0000" + }, + "name": "\u0000" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json deleted file mode 100644 index c09dac1301de..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in postfix operation (1:0)" -} 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 new file mode 100644 index 000000000000..ce2cb3d23d67 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json deleted file mode 100644 index c09dac1301de..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in postfix operation (1:0)" -} 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 new file mode 100644 index 000000000000..57d55fec0b5d --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "NumericLiteral", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json deleted file mode 100644 index 515e441e8ea7..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in prefix operation (1:2)" -} 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 new file mode 100644 index 000000000000..9a7a240c5b4a --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json deleted file mode 100644 index 515e441e8ea7..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in prefix operation (1:2)" -} 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 new file mode 100644 index 000000000000..85107220dae5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json deleted file mode 100644 index f8560a7de9d6..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-in statement (1:5)" -} 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 new file mode 100644 index 000000000000..d2ba76398677 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0056/output.json @@ -0,0 +1,197 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "left": { + "type": "BinaryExpression", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesized": true, + "parenStart": 4 + } + }, + "right": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "list" + }, + "name": "list" + }, + "body": { + "type": "ExpressionStatement", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "expression": { + "type": "CallExpression", + "start": 21, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "callee": { + "type": "Identifier", + "start": 21, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "process" + }, + "name": "process" + }, + "arguments": [ + { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json deleted file mode 100644 index 2b91be8d5115..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected keyword 'if' (1:4)" -} 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 new file mode 100644 index 000000000000..ac910291b748 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'if' (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "if" + }, + "name": "if" + }, + "init": { + "type": "NumericLiteral", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} 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 new file mode 100644 index 000000000000..329a2a1e98b7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json @@ -0,0 +1,143 @@ +{ + "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", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "operator": "=", + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + }, + "right": { + "type": "NumericLiteral", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json deleted file mode 100644 index 6010e96ed144..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in assignment expression (1:0)" -} 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 new file mode 100644 index 000000000000..12ab663d4186 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json @@ -0,0 +1,124 @@ +{ + "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", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "=", + "left": { + "type": "UnaryExpression", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "right": { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json index aa55ec4f840f..23e3c71b38f5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json @@ -1,3 +1,6 @@ { - "throws": "setter must have exactly one formal parameter (1:3)" -} + "throws": "setter must have exactly one formal parameter (1:3)", + "plugins": [ + "estree" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json deleted file mode 100644 index 92845f5f2081..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:15)" -} 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 new file mode 100644 index 000000000000..3731ec6d7b75 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0087/output.json @@ -0,0 +1,182 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "left": { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "right": { + "type": "NumericLiteral", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "body": { + "type": "NumericLiteral", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json deleted file mode 100644 index ad54c428a2f9..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:14)" -} 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 new file mode 100644 index 000000000000..dbffe6547ab5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0088/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "NumericLiteral", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json deleted file mode 100644 index bfa08eae293e..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:14)" -} 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 new file mode 100644 index 000000000000..1b3ed15f002e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0089/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + ], + "body": { + "type": "NumericLiteral", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json deleted file mode 100644 index 794c4864d4e5..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:15)" -} 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 new file mode 100644 index 000000000000..6b7ae83c0ad2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0090/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json deleted file mode 100644 index 212d35fcb5fe..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:15)" -} 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 new file mode 100644 index 000000000000..c681755fb108 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0091/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json deleted file mode 100644 index 368006ae58bd..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:4)" -} 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 new file mode 100644 index 000000000000..78da40f6d8c7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json @@ -0,0 +1,127 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:4)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json deleted file mode 100644 index b99fd35222b1..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:18)" -} 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 new file mode 100644 index 000000000000..3a5f60bdddea --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0093/output.json @@ -0,0 +1,163 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:18)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json deleted file mode 100644 index 79a05e62290e..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (1:21)" -} 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 new file mode 100644 index 000000000000..18c0889f74b8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0094/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "NumericLiteral", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": 0, + "raw": "00" + }, + "value": 0 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json deleted file mode 100644 index 99ffc0de0153..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (1:1)" -} 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 new file mode 100644 index 000000000000..11b48d988225 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json @@ -0,0 +1,114 @@ +{ + "type": "File", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", + "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ], + "body": { + "type": "NumericLiteral", + "start": 8, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "00" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json deleted file mode 100644 index 99ffc0de0153..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (1:1)" -} 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 new file mode 100644 index 000000000000..fb79f18aa20a --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", + "SyntaxError: Invalid left-hand side in arrow function parameters (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", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + }, + { + "type": "NumericLiteral", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 20, + "raw": "20" + }, + "value": 20 + } + ], + "body": { + "type": "NumericLiteral", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "00" + }, + "value": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json deleted file mode 100644 index 794c4864d4e5..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:15)" -} 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 new file mode 100644 index 000000000000..49e0835c1bfc --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0100/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "NumericLiteral", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json deleted file mode 100644 index cc2bef2a9a34..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:1)" -} 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 new file mode 100644 index 000000000000..85866aeddd23 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0101/output.json @@ -0,0 +1,179 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 10, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "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" + } + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json deleted file mode 100644 index 701f9fe8f27a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:0)" -} 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 new file mode 100644 index 000000000000..d3a105c584dd --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json @@ -0,0 +1,54 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BreakStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "label": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json deleted file mode 100644 index de66853a7a3d..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:0)" -} 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 new file mode 100644 index 000000000000..c32c5b089115 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json @@ -0,0 +1,54 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ContinueStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "label": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json deleted file mode 100644 index f8560a7de9d6..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-in statement (1:5)" -} 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 new file mode 100644 index 000000000000..9210a772c6e1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json @@ -0,0 +1,138 @@ +{ + "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", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "BinaryExpression", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "left": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "right": { + "type": "ObjectExpression", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json deleted file mode 100644 index f8560a7de9d6..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in for-in statement (1:5)" -} 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 new file mode 100644 index 000000000000..7300952311c2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json @@ -0,0 +1,119 @@ +{ + "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", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ForInStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "UnaryExpression", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "i" + }, + "name": "i" + } + }, + "right": { + "type": "ObjectExpression", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "properties": [] + }, + "body": { + "type": "EmptyStatement", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json deleted file mode 100644 index 429d96ca3f9a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Missing catch or finally clause (1:0)" -} 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 new file mode 100644 index 000000000000..3d2ee0555b85 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json @@ -0,0 +1,72 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "block": { + "type": "BlockStatement", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [], + "directives": [] + }, + "handler": null, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json deleted file mode 100644 index 82bcfe621c49..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:0)" -} 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 new file mode 100644 index 000000000000..237da8c03a78 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Invalid Unicode escape (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "‿" + }, + "name": "‿" + }, + "right": { + "type": "NumericLiteral", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json deleted file mode 100644 index 97818d2eea7e..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Lexical declaration cannot appear in a single-statement context (1:9)" -} 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 new file mode 100644 index 000000000000..c273b86361e0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json @@ -0,0 +1,140 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "IfStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 3, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": true + }, + "consequent": { + "type": "VariableDeclaration", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + }, + "alternate": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json deleted file mode 100644 index aadfa63716c2..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Multiple default clauses (1:22)" -} 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 new file mode 100644 index 000000000000..c90c4eefdc6f --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "errors": [ + "SyntaxError: Multiple default clauses (1:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "c" + }, + "name": "c" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "consequent": [], + "test": null + }, + { + "type": "SwitchCase", + "start": 22, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "consequent": [], + "test": null + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..1db488318bdf --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json @@ -0,0 +1,71 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "\\\\\\" + }, + "name": "\\\\\\" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..566db54902a1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json @@ -0,0 +1,71 @@ +{ + "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: Invalid Unicode escape (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "\\\\" + }, + "name": "\\\\" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..38cc0c05b021 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json @@ -0,0 +1,70 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "\\x" + }, + "name": "\\x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..b99a3f035e40 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json @@ -0,0 +1,71 @@ +{ + "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: Invalid Unicode escape (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "\\\u0000" + }, + "name": "\\\u0000" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json deleted file mode 100644 index 82bcfe621c49..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:0)" -} 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 new file mode 100644 index 000000000000..d528d79e32d4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Invalid Unicode escape (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "‌" + }, + "name": "‌" + }, + "right": { + "type": "ArrayExpression", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json deleted file mode 100644 index 82bcfe621c49..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid Unicode escape (1:0)" -} 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 new file mode 100644 index 000000000000..91544094b698 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Invalid Unicode escape (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "‍" + }, + "name": "‍" + }, + "right": { + "type": "ArrayExpression", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json deleted file mode 100644 index f9d29c7f328c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'return' outside of function (1:0)" -} 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 new file mode 100644 index 000000000000..e43da2374537 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json @@ -0,0 +1,54 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ReturnStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "argument": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json deleted file mode 100644 index 701f9fe8f27a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:0)" -} 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 new file mode 100644 index 000000000000..d3a105c584dd --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json @@ -0,0 +1,54 @@ +{ + "type": "File", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BreakStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "label": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json deleted file mode 100644 index de66853a7a3d..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:0)" -} 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 new file mode 100644 index 000000000000..c32c5b089115 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json @@ -0,0 +1,54 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ContinueStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "label": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json deleted file mode 100644 index c726e8fa98e4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:22)" -} 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 new file mode 100644 index 000000000000..b83145faf5ab --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json @@ -0,0 +1,106 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "SwitchStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "discriminant": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + "cases": [ + { + "type": "SwitchCase", + "start": 13, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "consequent": [ + { + "type": "ContinueStatement", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "label": null + } + ], + "test": null + } + ] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json deleted file mode 100644 index 070e662e80d4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:15)" -} 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 new file mode 100644 index 000000000000..a7c8d4f9a0ca --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "label": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json deleted file mode 100644 index 2a2e15787aa7..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:15)" -} 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 new file mode 100644 index 000000000000..2f1c8737b22e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "WhileStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 13, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "label": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json deleted file mode 100644 index 464af80a1561..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:33)" -} 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 new file mode 100644 index 000000000000..7337acd3e8fd --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0178/output.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 19, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "label": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 + } + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json deleted file mode 100644 index a056cb50e190..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:33)" -} 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 new file mode 100644 index 000000000000..18bc9b977ca7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0179/output.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 19, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "label": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 + } + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json deleted file mode 100644 index 464af80a1561..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic break (1:33)" -} 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 new file mode 100644 index 000000000000..59ae007d6fba --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0180/output.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "errors": [ + "SyntaxError: Unsyntactic break (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 19, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "BreakStatement", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "label": null + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 + } + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json deleted file mode 100644 index a056cb50e190..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unsyntactic continue (1:33)" -} 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 new file mode 100644 index 000000000000..d26e37b08031 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0181/output.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "errors": [ + "SyntaxError: Unsyntactic continue (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 18, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 19, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [ + { + "type": "ContinueStatement", + "start": 33, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "label": null + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 18 + } + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json deleted file mode 100644 index da7f2590db0b..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Label 'x' is already declared (1: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 new file mode 100644 index 000000000000..3025d6bfbf72 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json @@ -0,0 +1,199 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": { + "type": "WhileStatement", + "start": 3, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 16, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "LabeledStatement", + "start": 18, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": { + "type": "WhileStatement", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 28, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "value": true + }, + "body": { + "type": "BlockStatement", + "start": 34, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json deleted file mode 100644 index 1517e1719333..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Deleting local variable in strict mode (1:29)" -} 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 new file mode 100644 index 000000000000..f22f0efb0609 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0183/output.json @@ -0,0 +1,195 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "CallExpression", + "start": 1, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 29, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "operator": "delete", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 37 + }, + "identifierName": "i" + }, + "name": "i" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json deleted file mode 100644 index 31b4c6d2a040..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'with' in strict mode (1:29)" -} 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 new file mode 100644 index 000000000000..1567b18881d6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0184/output.json @@ -0,0 +1,193 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "expression": { + "type": "CallExpression", + "start": 1, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [ + { + "type": "WithStatement", + "start": 29, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "object": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "i" + }, + "name": "i" + }, + "body": { + "type": "EmptyStatement", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + } + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json deleted file mode 100644 index dfbf1f6d0d1c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:36)" -} 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 new file mode 100644 index 000000000000..7598b7431e9f --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0185/output.json @@ -0,0 +1,197 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 32, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "id": { + "type": "Identifier", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "init": { + "type": "NumericLiteral", + "start": 43, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json deleted file mode 100644 index b74dfcf59199..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:36)" -} 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 new file mode 100644 index 000000000000..7101109189a2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0186/output.json @@ -0,0 +1,197 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 32, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 36, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "init": { + "type": "NumericLiteral", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json deleted file mode 100644 index e95a2d7f7535..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:47)" -} 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 new file mode 100644 index 000000000000..dd5fca85f2e5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0187/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 32, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "block": { + "type": "BlockStatement", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 40, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "param": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "body": { + "type": "BlockStatement", + "start": 53, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json deleted file mode 100644 index 14d96617b4b6..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:47)" -} 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 new file mode 100644 index 000000000000..3b89f63424e2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0188/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 32, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "block": { + "type": "BlockStatement", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 40, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "param": { + "type": "Identifier", + "start": 47, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 56 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "body": { + "type": "BlockStatement", + "start": 58, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 58 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json deleted file mode 100644 index 6faa5d0476c3..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:32)" -} 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 new file mode 100644 index 000000000000..2973f3517639 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0189/output.json @@ -0,0 +1,195 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "right": { + "type": "NumericLiteral", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json deleted file mode 100644 index 2f502104f7d4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:32)" -} 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 new file mode 100644 index 000000000000..e328a1e98ef9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0190/output.json @@ -0,0 +1,195 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 32, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "right": { + "type": "NumericLiteral", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json deleted file mode 100644 index 0964911894d9..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:34)" -} 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 new file mode 100644 index 000000000000..95091e65367d --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0191/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json deleted file mode 100644 index 0964911894d9..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:34)" -} 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 new file mode 100644 index 000000000000..8473055a411c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0192/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json deleted file mode 100644 index ba5ef9dd55cc..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:34)" -} 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 new file mode 100644 index 000000000000..c9974932443e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0193/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json deleted file mode 100644 index ba5ef9dd55cc..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:34)" -} 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 new file mode 100644 index 000000000000..cf31420c53a0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0194/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "--", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json deleted file mode 100644 index 6faa5d0476c3..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:32)" -} 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 new file mode 100644 index 000000000000..59618c91e2ca --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0195/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json deleted file mode 100644 index 6faa5d0476c3..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'eval' in strict mode (1:32)" -} 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 new file mode 100644 index 000000000000..0b6b047c7b58 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0196/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "eval" + }, + "name": "eval" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json deleted file mode 100644 index 2f502104f7d4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:32)" -} 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 new file mode 100644 index 000000000000..64f2c09fd91e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0197/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "++", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json deleted file mode 100644 index 2f502104f7d4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Assigning to 'arguments' in strict mode (1:32)" -} 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 new file mode 100644 index 000000000000..34c1b59c4e79 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0198/output.json @@ -0,0 +1,176 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 32, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "--", + "prefix": false, + "argument": { + "type": "Identifier", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json deleted file mode 100644 index 439ffff53e89..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:41)" -} 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 new file mode 100644 index 000000000000..a26597f806c1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0199/output.json @@ -0,0 +1,180 @@ +{ + "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", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 32, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json deleted file mode 100644 index ad15b27f9b9a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:41)" -} 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 new file mode 100644 index 000000000000..4c756f50ea07 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0200/output.json @@ -0,0 +1,180 @@ +{ + "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", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 32, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 50 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 53, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json deleted file mode 100644 index 1eb91299eb1b..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:9)" -} 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 new file mode 100644 index 000000000000..ede15490b692 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0201/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json deleted file mode 100644 index c903c1205ce8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:9)" -} 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 new file mode 100644 index 000000000000..aeccd1a07ed9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0202/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json deleted file mode 100644 index 884ab94e3403..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:42)" -} 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 new file mode 100644 index 000000000000..4e8af9c85d04 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0203/output.json @@ -0,0 +1,214 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "expression": { + "type": "CallExpression", + "start": 33, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": [], + "directives": [] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json deleted file mode 100644 index 58a98e4ca953..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:42)" -} 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 new file mode 100644 index 000000000000..49a2e0086f28 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0204/output.json @@ -0,0 +1,214 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "expression": { + "type": "CallExpression", + "start": 33, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 33, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [], + "directives": [] + } + }, + "arguments": [], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json deleted file mode 100644 index aa44c4aafa4d..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:10)" -} 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 new file mode 100644 index 000000000000..6d1387258a3e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0205/output.json @@ -0,0 +1,161 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json deleted file mode 100644 index 59ccf8eb8209..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:10)" -} 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 new file mode 100644 index 000000000000..d3b5c3628386 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0206/output.json @@ -0,0 +1,161 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json deleted file mode 100644 index e95a2d7f7535..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:47)" -} 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 new file mode 100644 index 000000000000..d0eb8e29b2a1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0207/output.json @@ -0,0 +1,250 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 35, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "FunctionExpression", + "start": 38, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json deleted file mode 100644 index e29c7aee6091..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'package' in strict mode (1:10)" -} 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 new file mode 100644 index 000000000000..d6510094936e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0208/output.json @@ -0,0 +1,161 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "callee": { + "type": "FunctionExpression", + "start": 1, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "package" + }, + "name": "package" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json deleted file mode 100644 index 43dc5662e1e5..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:48)" -} 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 new file mode 100644 index 000000000000..98e096877880 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0209/output.json @@ -0,0 +1,292 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 35, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "i" + }, + "name": "i" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + }, + { + "type": "ObjectMethod", + "start": 42, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 48, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 57 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json deleted file mode 100644 index 439ffff53e89..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:41)" -} 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 new file mode 100644 index 000000000000..f974d83f5a98 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0210/output.json @@ -0,0 +1,237 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 35, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 41, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [], + "directives": [] + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json deleted file mode 100644 index 8b18a4ec3e5a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:49)" -} 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 new file mode 100644 index 000000000000..2993cf648835 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0211/output.json @@ -0,0 +1,268 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 64 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 32, + "end": 62, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 62 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 33, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 35, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "FunctionExpression", + "start": 38, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 48 + }, + "identifierName": "s" + }, + "name": "s" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 49, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 53 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 55, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 32 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json deleted file mode 100644 index 794c4864d4e5..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:15)" -} 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 new file mode 100644 index 000000000000..4534376b270a --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0212/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json deleted file mode 100644 index 212d35fcb5fe..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:15)" -} 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 new file mode 100644 index 000000000000..cb41c2783446 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0213/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + ], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 27, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json deleted file mode 100644 index 43dc5662e1e5..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:48)" -} 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 new file mode 100644 index 000000000000..d8df2c1c2d07 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0214/output.json @@ -0,0 +1,197 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 58 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 33, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "inner" + }, + "name": "inner" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 48, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 52 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 54 + }, + "end": { + "line": 1, + "column": 56 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json deleted file mode 100644 index 8370ba5c765f..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:48)" -} 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 new file mode 100644 index 000000000000..a2fc6cb4db0e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0215/output.json @@ -0,0 +1,197 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 63, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 63 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 33, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "inner" + }, + "name": "inner" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 48, + "end": 57, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 57 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + ], + "body": { + "type": "BlockStatement", + "start": 59, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 59 + }, + "end": { + "line": 1, + "column": 61 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json deleted file mode 100644 index 61a5834b639e..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:2)" -} 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 new file mode 100644 index 000000000000..48c8fda845ba --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0216/output.json @@ -0,0 +1,108 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": "\\1", + "extra": { + "raw": "\"\\1\"", + "rawValue": "\\1" + } + } + }, + { + "type": "Directive", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 6, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": "use strict", + "extra": { + "raw": "'use strict'", + "rawValue": "use strict" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json deleted file mode 100644 index ae2bfab55c68..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:35)" -} 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 new file mode 100644 index 000000000000..1504ace4ac5d --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0217/output.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:35)", + "SyntaxError: Octal literal in strict mode (1:35)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + }, + { + "type": "Directive", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "value": "\\1", + "extra": { + "raw": "\"\\1\"", + "rawValue": "\\1" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json deleted file mode 100644 index 45ca229c1e8e..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (1:33)" -} 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 new file mode 100644 index 000000000000..805c176e7856 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0218/output.json @@ -0,0 +1,163 @@ +{ + "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", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "extra": { + "rawValue": 17, + "raw": "021" + }, + "value": 17 + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json deleted file mode 100644 index 7e50b5f9165e..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:38)" -} 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 new file mode 100644 index 000000000000..f73cb42cd9cf --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0219/output.json @@ -0,0 +1,221 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:38)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 33, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 34, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 36, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "method": false, + "key": { + "type": "StringLiteral", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "extra": { + "rawValue": "\u0001", + "raw": "\"\\1\"" + }, + "value": "\u0001" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 33 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json deleted file mode 100644 index 8f6c8218f747..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Legacy octal literals are not allowed in strict mode (1:36)" -} 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 new file mode 100644 index 000000000000..5eb3bcef0b18 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0220/output.json @@ -0,0 +1,221 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 34, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 36, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "method": false, + "key": { + "type": "NumericLiteral", + "start": 36, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "extra": { + "rawValue": 17, + "raw": "021" + }, + "value": 17 + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 33 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json deleted file mode 100644 index d094fe0284b1..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:36)" -} 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 new file mode 100644 index 000000000000..374201e48c95 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0221/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:36)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 55 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": "octal directive\\1", + "extra": { + "raw": "\"octal directive\\1\"", + "rawValue": "octal directive\\1" + } + } + }, + { + "type": "Directive", + "start": 40, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 40, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "value": "use strict", + "extra": { + "raw": "\"use strict\"", + "rawValue": "use strict" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json deleted file mode 100644 index d094fe0284b1..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:36)" -} 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 new file mode 100644 index 000000000000..1c7a53167a1c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0222/output.json @@ -0,0 +1,197 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:36)", + "SyntaxError: Octal literal in strict mode (1:57)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "value": "octal directive\\1", + "extra": { + "raw": "\"octal directive\\1\"", + "rawValue": "octal directive\\1" + } + } + }, + { + "type": "Directive", + "start": 40, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 60 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 40, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 59 + } + }, + "value": "octal directive\\2", + "extra": { + "raw": "\"octal directive\\2\"", + "rawValue": "octal directive\\2" + } + } + }, + { + "type": "Directive", + "start": 61, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "value": { + "type": "DirectiveLiteral", + "start": 61, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 61 + }, + "end": { + "line": 1, + "column": 73 + } + }, + "value": "use strict", + "extra": { + "raw": "\"use strict\"", + "rawValue": "use strict" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json deleted file mode 100644 index 8389b2c726ca..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Octal literal in strict mode (1:69)" -} 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 new file mode 100644 index 000000000000..e52fa38ccf73 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0223/output.json @@ -0,0 +1,215 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "errors": [ + "SyntaxError: Octal literal in strict mode (1:69)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 76 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 33, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "inner" + }, + "name": "inner" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 74, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 74 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 52, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 72 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json deleted file mode 100644 index 0641de45e29a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'implements' (1:37)" -} 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 new file mode 100644 index 000000000000..0f64682a8eb0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0224/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'implements' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "implements" + }, + "name": "implements" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json deleted file mode 100644 index 859238d0423f..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'interface' (1:37)" -} 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 new file mode 100644 index 000000000000..8222afc6a0e6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0225/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'interface' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "interface" + }, + "name": "interface" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json deleted file mode 100644 index 344c7075f4bf..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'package' (1:37)" -} 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 new file mode 100644 index 000000000000..f977c4c528e0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0226/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'package' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "package" + }, + "name": "package" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json deleted file mode 100644 index 9fb9deaf9cba..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'private' (1:37)" -} 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 new file mode 100644 index 000000000000..b1147bbff4e1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0227/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'private' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "private" + }, + "name": "private" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json deleted file mode 100644 index 292fb56f1cf3..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'protected' (1:37)" -} 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 new file mode 100644 index 000000000000..1b1c3bcecf8b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0228/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'protected' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 46 + }, + "identifierName": "protected" + }, + "name": "protected" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json deleted file mode 100644 index d5f48446906a..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'public' (1:37)" -} 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 new file mode 100644 index 000000000000..8c06677a9156 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0229/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'public' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "public" + }, + "name": "public" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json deleted file mode 100644 index 0f41ff2e6f24..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'static' (1:37)" -} 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 new file mode 100644 index 000000000000..12f9d4d5420d --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0230/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'static' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "static" + }, + "name": "static" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json deleted file mode 100644 index 6ab197f35dc9..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'yield' (1:37)" -} 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 new file mode 100644 index 000000000000..7681159b6cbd --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0231/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'yield' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "yield" + }, + "name": "yield" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json deleted file mode 100644 index d2f3cbc2e116..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'let' (1:37)" -} 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 new file mode 100644 index 000000000000..bd47f7c95bef --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0232/output.json @@ -0,0 +1,179 @@ +{ + "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: Binding 'let' in strict mode (1:37)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "let" + }, + "name": "let" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json deleted file mode 100644 index 78c799ec6a49..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'static' in strict mode (1:15)" -} 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 new file mode 100644 index 000000000000..ab669586dc27 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0233/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "hello" + }, + "name": "hello" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "static" + }, + "name": "static" + } + ], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 25, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json deleted file mode 100644 index d4a2d92e5b45..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'static' in strict mode (1:9)" -} 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 new file mode 100644 index 000000000000..be76a2099b54 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0234/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "static" + }, + "name": "static" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json deleted file mode 100644 index 1eb91299eb1b..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:9)" -} 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 new file mode 100644 index 000000000000..df217b6af2bc --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0235/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "eval" + }, + "name": "eval" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json deleted file mode 100644 index c903c1205ce8..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'arguments' in strict mode (1:9)" -} 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 new file mode 100644 index 000000000000..0de7c6ba2ac0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0236/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "arguments" + }, + "name": "arguments" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "a" + }, + "name": "a" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 24, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json deleted file mode 100644 index 91bc36d3f360..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'static' (1:23)" -} 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 new file mode 100644 index 000000000000..03212ebf3a29 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0239/output.json @@ -0,0 +1,128 @@ +{ + "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: Binding 'static' in strict mode (1:23)", + "SyntaxError: Binding 'static' in strict mode (1:23)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "static" + }, + "name": "static" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json deleted file mode 100644 index 8b20b9a7df36..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:14)" -} 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 new file mode 100644 index 000000000000..f945eeb57491 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0240/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json deleted file mode 100644 index 85fd3822f433..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:11)" -} 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 new file mode 100644 index 000000000000..f2ff5d38de33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0241/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 19, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json deleted file mode 100644 index 604b5896c2c5..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'package' in strict mode (1:11)" -} 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 new file mode 100644 index 000000000000..2f734055a47a --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0242/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "package" + }, + "name": "package" + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json deleted file mode 100644 index 9d2a58081596..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:43)" -} 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 new file mode 100644 index 000000000000..60ac3ce8c98c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0243/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:43)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 29, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "id": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 39 + }, + "identifierName": "b" + }, + "name": "b" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 44 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "EmptyStatement", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 50 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json deleted file mode 100644 index 61c3bbb5abe0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:15)" -} 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 new file mode 100644 index 000000000000..766ec14c5a33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0244/output.json @@ -0,0 +1,180 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json deleted file mode 100644 index ae469fbd59da..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:44)" -} 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 new file mode 100644 index 000000000000..0f2e3c5dce01 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0245/output.json @@ -0,0 +1,233 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:44)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 29, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 30, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "b" + }, + "name": "b" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "t" + }, + "name": "t" + }, + { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "t" + }, + "name": "t" + } + ], + "body": { + "type": "BlockStatement", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 29 + } + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 15, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "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" + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json deleted file mode 100644 index b60957f217a4..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'eval' in strict mode (1:12)" -} 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 new file mode 100644 index 000000000000..7945e482ca86 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0246/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "eval" + }, + "name": "eval" + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json deleted file mode 100644 index 62075401e782..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Binding 'package' in strict mode (1:12)" -} 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 new file mode 100644 index 000000000000..304b4237e9e7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0247/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "package" + }, + "name": "package" + } + ], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 23, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "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" + } + } + } + ] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json deleted file mode 100644 index cb5abd9f7401..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Label '__proto__' is already declared (1:11)" -} 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 new file mode 100644 index 000000000000..2b1e638019cc --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "LabeledStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": { + "type": "LabeledStatement", + "start": 11, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + }, + "label": { + "type": "Identifier", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + } + }, + "label": { + "type": "Identifier", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json deleted file mode 100644 index 505798d5a203..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Argument name clash (1:36)" -} 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 new file mode 100644 index 000000000000..45d9e76d63b8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0249/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "errors": [ + "SyntaxError: Argument name clash (1:36)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 14, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "t" + }, + "name": "t" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 34 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + { + "type": "Identifier", + "start": 36, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + } + ], + "body": { + "type": "BlockStatement", + "start": 47, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json deleted file mode 100644 index 8e9b9f585996..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Redefinition of __proto__ property (1:21)" -} 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 new file mode 100644 index 000000000000..6c9cf3db90bb --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json @@ -0,0 +1,213 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 6, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + }, + { + "type": "ObjectProperty", + "start": 21, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "__proto__" + }, + "name": "__proto__" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "extra": { + "rawValue": 43, + "raw": "43" + }, + "value": 43 + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json deleted file mode 100644 index 8df109cb3c33..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Classes may not have static property named prototype (1:16)" -} 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 new file mode 100644 index 000000000000..3c3b792e5b9b --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "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": 30, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "static": true, + "key": { + "type": "Identifier", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "prototype" + }, + "name": "prototype" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json deleted file mode 100644 index 8df109cb3c33..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Classes may not have static property named prototype (1:16)" -} 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 new file mode 100644 index 000000000000..0c00e7e06841 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json @@ -0,0 +1,147 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "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": 32, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 9, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "static": true, + "key": { + "type": "StringLiteral", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": "prototype", + "raw": "\"prototype\"" + }, + "value": "prototype" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json deleted file mode 100644 index f4b1d256a4ab..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Constructor can't have get/set modifier (1:13)" -} 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 new file mode 100644 index 000000000000..d583a2ec1119 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "errors": [ + "SyntaxError: Constructor can't have get/set modifier (1:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "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": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json deleted file mode 100644 index f4b1d256a4ab..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Constructor can't have get/set modifier (1:13)" -} 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 new file mode 100644 index 000000000000..532d8ebe70a8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "errors": [ + "SyntaxError: Constructor can't have get/set modifier (1:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "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": 30, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "m" + }, + "name": "m" + } + ], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json deleted file mode 100644 index 4d892adceff9..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Duplicate constructor in the same class (1:25)" -} 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 new file mode 100644 index 000000000000..4337adcf6eb6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json @@ -0,0 +1,203 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 9, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassMethod", + "start": 25, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "static": false, + "key": { + "type": "StringLiteral", + "start": 25, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "extra": { + "rawValue": "constructor", + "raw": "\"constructor\"" + }, + "value": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json deleted file mode 100644 index aef7f56007e9..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'enum' (1:11)" -} 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 new file mode 100644 index 000000000000..52f289f37f98 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json @@ -0,0 +1,163 @@ +{ + "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: Binding 'enum' in strict mode (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "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": 19, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 11, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "enum" + }, + "name": "enum" + } + ], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json deleted file mode 100644 index 757b207f0ef2..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected reserved word 'static' (1:17)" -} 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 new file mode 100644 index 000000000000..275b0d3ee35a --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json @@ -0,0 +1,144 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "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": 30, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "static": true, + "computed": true, + "key": { + "type": "Identifier", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "static" + }, + "name": "static" + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json deleted file mode 100644 index 0006fbf98e5c..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "setter function argument must not be a rest parameter (1:6)" -} 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 new file mode 100644 index 000000000000..30ec6b3832e2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json @@ -0,0 +1,192 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 6, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "f" + }, + "name": "f" + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "RestElement", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "argument": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "y" + }, + "name": "y" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/options.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..e418d699ca2c --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json @@ -0,0 +1,70 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "\\a" + }, + "name": "\\a" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/options.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/options.json deleted file mode 100644 index 18c53b997b56..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:2)" -} 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 new file mode 100644 index 000000000000..6f022e5637c6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json @@ -0,0 +1,70 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "aa\\a" + }, + "name": "aa\\a" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/options.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..c0f511826127 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json @@ -0,0 +1,70 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "\\aa" + }, + "name": "\\aa" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/options.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/options.json deleted file mode 100644 index 381fd12ce2d0..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expecting Unicode escape sequence \\uXXXX (1:1)" -} 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 new file mode 100644 index 000000000000..c0f511826127 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json @@ -0,0 +1,70 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "\\aa" + }, + "name": "\\aa" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json deleted file mode 100644 index 57893e4eee56..000000000000 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Complex binding patterns require an initialization value (1:6)" -} 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 new file mode 100644 index 000000000000..8c9fa87e494e --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json @@ -0,0 +1,88 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "id": { + "type": "ArrayPattern", + "start": 4, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [] + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/options.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/options.json deleted file mode 100644 index a1fd77a3341e..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid BigIntLiteral (1:0)" } diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/output.json new file mode 100644 index 000000000000..26cbd0245288 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-decimal/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "errors": [ + "SyntaxError: Invalid BigIntLiteral (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "BigIntLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": "1.0", + "raw": "1.0n" + }, + "value": "1.0" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/options.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/options.json deleted file mode 100644 index a1fd77a3341e..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid BigIntLiteral (1:0)" } diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/output.json new file mode 100644 index 000000000000..527c53215960 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-e/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "errors": [ + "SyntaxError: Invalid BigIntLiteral (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "BigIntLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": "2e9", + "raw": "2e9n" + }, + "value": "2e9" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json index a1fd77a3341e..8078d8f00dad 100644 --- a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json +++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json @@ -1 +1,5 @@ -{ "throws": "Invalid BigIntLiteral (1:0)" } +{ + "plugins": [ + "bigInt" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/output.json new file mode 100644 index 000000000000..86220085cd71 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "errors": [ + "SyntaxError: Invalid BigIntLiteral (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "BigIntLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": "089", + "raw": "089n" + }, + "value": "089" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/options.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/options.json deleted file mode 100644 index a1fd77a3341e..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid BigIntLiteral (1:0)" } diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/output.json new file mode 100644 index 000000000000..baa4133652f9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-octal-legacy/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "errors": [ + "SyntaxError: Invalid BigIntLiteral (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "BigIntLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": "016432", + "raw": "016432n" + }, + "value": "016432" + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index d702f4db972b..a6ccef275874 100644 --- 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 @@ -1,4 +1,5 @@ { - "throws": "Classes may not have a private field named '#constructor' (2:2)", - "plugins": ["classPrivateMethods"] -} + "plugins": [ + "classPrivateMethods" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..342fc174b592 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json @@ -0,0 +1,158 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "constructor" + }, + "name": "constructor" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 9914950b66fe..8d265ec66c23 100644 --- 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 @@ -1,4 +1,3 @@ { - "throws": "Unexpected space between # and identifier (2:3)", "plugins": ["classPrivateMethods"] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json new file mode 100644 index 000000000000..e126bf7fb5fb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Unexpected space between # and identifier (2:3)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "Spaces" + }, + "name": "Spaces" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 13, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 17, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "wrongSpaces" + }, + "name": "wrongSpaces" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 40, + "end": 54, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "argument": { + "type": "CallExpression", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "callee": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "fail" + }, + "name": "fail" + }, + "arguments": [] + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index e9f18e93d1d5..1ca5069a3a2f 100644 --- 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 @@ -1,4 +1,5 @@ { - "throws": "Deleting a private field is not allowed (4:4)", - "plugins": ["classPrivateProperties"] -} + "plugins": [ + "classPrivateProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..1f5d18e55096 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json @@ -0,0 +1,289 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": null + }, + { + "type": "ClassMethod", + "start": 20, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 40, + "end": 55, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "expression": { + "type": "UnaryExpression", + "start": 40, + "end": 54, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "operator": "delete", + "prefix": true, + "argument": { + "type": "MemberExpression", + "start": 47, + "end": 54, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "object": { + "type": "ThisExpression", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "property": { + "type": "PrivateName", + "start": 52, + "end": 54, + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 18 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false + } + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 51343aac3b23..1ca5069a3a2f 100644 --- 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 @@ -1,4 +1,5 @@ { - "throws": "Classes may not have a private field named '#constructor' (2:2)", - "plugins": ["classPrivateProperties"] -} + "plugins": [ + "classPrivateProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..1f4da38f9f9f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 14, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "constructor" + }, + "name": "constructor" + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 9914950b66fe..f26e916957c8 100644 --- 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 @@ -1,4 +1,3 @@ { - "throws": "Unexpected space between # and identifier (2:3)", - "plugins": ["classPrivateMethods"] + "plugins": ["classPrivateProperties"] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json new file mode 100644 index 000000000000..34003e4e9209 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json @@ -0,0 +1,137 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Unexpected space between # and identifier (2:3)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "Spaces" + }, + "name": "Spaces" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 13, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 17, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "wrongSpaces" + }, + "name": "wrongSpaces" + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 2154c844bfd7..1ca5069a3a2f 100644 --- 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 @@ -1,4 +1,5 @@ { - "plugins": ["classPrivateProperties"], - "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? (4:13)" -} + "plugins": [ + "classPrivateProperties" + ] +} \ 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 new file mode 100644 index 000000000000..26e00894a7a7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json @@ -0,0 +1,306 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 95, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 95, + "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": "A" + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "B" + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 95, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 22, + "end": 93, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 93, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 42, + "end": 89, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": { + "type": "Identifier", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 21 + }, + "identifierName": "D" + }, + "name": "D" + }, + "body": { + "type": "ClassBody", + "start": 60, + "end": 89, + "loc": { + "start": { + "line": 3, + "column": 22 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 68, + "end": 83, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 68, + "end": 72, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 69, + "end": 72, + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 10 + }, + "identifierName": "foo" + }, + "name": "foo" + } + }, + "value": { + "type": "CallExpression", + "start": 75, + "end": 82, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "callee": { + "type": "Super", + "start": 75, + "end": 80, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 18 + } + } + }, + "arguments": [] + } + } + ] + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 162c282e64a2..1ca5069a3a2f 100644 --- 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 @@ -1,6 +1,5 @@ { "plugins": [ "classPrivateProperties" - ], - "throws": "Private fields can't be accessed on super (5:4)" -} + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..bf5051685be7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json @@ -0,0 +1,288 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 59, + "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": "A" + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "B" + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": null + }, + { + "type": "ClassMethod", + "start": 29, + "end": 57, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 57, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 44, + "end": 53, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "expression": { + "type": "MemberExpression", + "start": 44, + "end": 52, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "object": { + "type": "Super", + "start": 44, + "end": 49, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 9 + } + } + }, + "property": { + "type": "PrivateName", + "start": 50, + "end": 52, + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 51, + "end": 52, + "loc": { + "start": { + "line": 5, + "column": 11 + }, + "end": { + "line": 5, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ 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 index a567b19a72cb..7f9944b56296 100644 --- 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 @@ -1,4 +1,5 @@ { - "plugins": ["classProperties"], - "throws": "'arguments' is not allowed in class field initializer (3:16)" -} + "plugins": [ + "classProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..7cd90e6e9021 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json @@ -0,0 +1,211 @@ +{ + "type": "File", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: 'arguments' is not allowed in class field initializer (3:16)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 18, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 26, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 32, + "end": 54, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "value": { + "type": "ArrowFunctionExpression", + "start": 38, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 25 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "Identifier", + "start": 44, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 25 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + } + ] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index e79a44db0bef..7f9944b56296 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/options.json @@ -1,4 +1,5 @@ { - "plugins": ["classProperties"], - "throws": "'arguments' is not allowed in class field initializer (3:10)" -} + "plugins": [ + "classProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..f2522558f086 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json @@ -0,0 +1,192 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: 'arguments' is not allowed in class field initializer (3:10)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 18, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 26, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 32, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "value": { + "type": "Identifier", + "start": 38, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 19 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + ] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 8d36a47b9f64..7f9944b56296 100644 --- 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 @@ -1,4 +1,5 @@ { - "plugins": ["classProperties"], - "throws": "new.target can only be used in functions or class properties (1:8)" -} + "plugins": [ + "classProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..a44ee2efc222 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "MetaProperty", + "start": 8, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "meta": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "target" + }, + "name": "target" + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 5560d1052435..7c697d760098 100644 --- 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 @@ -1,4 +1,5 @@ { - "throws": "Classes may not have a field named 'constructor' (2:2)", - "plugins": ["classProperties"] + "plugins": [ + "classProperties" + ] } 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 new file mode 100644 index 000000000000..0678d1917926 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json @@ -0,0 +1,179 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "value": null + }, + { + "type": "ClassMethod", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "static": false, + "kind": "method", + "key": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "id": null, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 5560d1052435..7c697d760098 100644 --- 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 @@ -1,4 +1,5 @@ { - "throws": "Classes may not have a field named 'constructor' (2:2)", - "plugins": ["classProperties"] + "plugins": [ + "classProperties" + ] } 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 new file mode 100644 index 000000000000..2a969d61e76e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json @@ -0,0 +1,123 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 5bde2716ebdd..7f9944b56296 100644 --- 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 @@ -1,4 +1,5 @@ { - "throws": "Classes may not have static property named prototype (2:9)", - "plugins": ["classProperties"] -} + "plugins": [ + "classProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..975df8dd8199 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json @@ -0,0 +1,179 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 14, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "static": true, + "key": { + "type": "Identifier", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "prototype" + }, + "name": "prototype" + }, + "computed": false, + "value": null + }, + { + "type": "ClassMethod", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "static": false, + "kind": "method", + "key": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "id": null, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 5bde2716ebdd..7f9944b56296 100644 --- 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 @@ -1,4 +1,5 @@ { - "throws": "Classes may not have static property named prototype (2:9)", - "plugins": ["classProperties"] -} + "plugins": [ + "classProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..fb3005664209 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json @@ -0,0 +1,123 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 14, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "static": true, + "key": { + "type": "Identifier", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "prototype" + }, + "name": "prototype" + }, + "computed": false, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 36858dc626ae..7f9944b56296 100644 --- 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 @@ -1,4 +1,5 @@ { - "throws": "Classes may not have a field named 'constructor' (2:11)", - "plugins": ["classProperties"] -} + "plugins": [ + "classProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..74fd91c747c5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json @@ -0,0 +1,123 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 16, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "static": true, + "key": { + "type": "Identifier", + "start": 23, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 22 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index e8d509e27740..7f9944b56296 100644 --- 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 @@ -1,4 +1,5 @@ { - "plugins": ["classProperties"], - "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? (4:12)" -} + "plugins": [ + "classProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..987d1eef5055 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json @@ -0,0 +1,292 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 94, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 94, + "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": "A" + }, + "name": "A" + }, + "superClass": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "B" + }, + "name": "B" + }, + "body": { + "type": "ClassBody", + "start": 18, + "end": 94, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 22, + "end": 92, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 92, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 42, + "end": 88, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": { + "type": "Identifier", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 21 + }, + "identifierName": "D" + }, + "name": "D" + }, + "body": { + "type": "ClassBody", + "start": 60, + "end": 88, + "loc": { + "start": { + "line": 3, + "column": 22 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 68, + "end": 82, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 68, + "end": 71, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "value": { + "type": "CallExpression", + "start": 74, + "end": 81, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "callee": { + "type": "Super", + "start": 74, + "end": 79, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 17 + } + } + }, + "arguments": [] + } + } + ] + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 386c2968e7b0..7f9944b56296 100644 --- 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 @@ -1,4 +1,5 @@ { - "plugins": ["classProperties"], - "throws": "super is only allowed in object methods and classes (3:4)" -} + "plugins": [ + "classProperties" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..b129c88406f6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json @@ -0,0 +1,254 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "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": 54, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 12, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "value": { + "type": "FunctionExpression", + "start": 18, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 52, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 38, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "expression": { + "type": "CallExpression", + "start": 38, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "callee": { + "type": "MemberExpression", + "start": 38, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "object": { + "type": "Super", + "start": 38, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "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": [] + } + } + ], + "directives": [] + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/options.json index 39592e4eb294..70c2c7a17676 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/options.json @@ -1,5 +1,11 @@ { - "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:15)" -} + "plugins": [ + [ + "decorators", + { + "decoratorsBeforeExport": true + } + ] + ], + "sourceType": "module" +} \ 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 new file mode 100644 index 000000000000..2ac3ce6a5954 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json @@ -0,0 +1,136 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "declaration": { + "type": "ClassDeclaration", + "start": 15, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "Identifier", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "decorator" + }, + "name": "decorator" + } + } + ], + "id": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/options.json deleted file mode 100644 index 7b4e6dc626ae..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Stage 2 decorators cannot be used to decorate parameters (2:14)" -} 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 new file mode 100644 index 000000000000..9f8814a38f61 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json @@ -0,0 +1,196 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (2:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "x" + }, + "name": "x", + "decorators": [ + { + "type": "Decorator", + "start": 26, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "expression": { + "type": "Identifier", + "start": 27, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/options.json deleted file mode 100644 index a26ed7cacb84..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "You can't attach decorators to a class constructor (2:2)" -} diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json new file mode 100644 index 000000000000..c6d81bd74bd6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json @@ -0,0 +1,179 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: You can't attach decorators to a class constructor (2:2)", + "SyntaxError: Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "abc" + }, + "name": "abc" + } + } + ], + "static": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/options.json index cb54fc794402..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/options.json @@ -1,4 +1,3 @@ { - "sourceType": "module", - "throws": "Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (2:0)" + "sourceType": "module" } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json new file mode 100644 index 000000000000..733e482e120a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json @@ -0,0 +1,120 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "errors": [ + "SyntaxError: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (2:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportDefaultDeclaration", + "start": 5, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "declaration": { + "type": "ClassDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "body": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/options.json deleted file mode 100644 index 6637fc7f8345..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Stage 2 decorators cannot be used to decorate parameters (1:14)" -} 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 new file mode 100644 index 000000000000..ec6b85a88a6b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json @@ -0,0 +1,142 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "errors": [ + "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "func" + }, + "name": "func" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "x" + }, + "name": "x", + "decorators": [ + { + "type": "Decorator", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/options.json deleted file mode 100644 index b1730696933e..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Stage 2 decorators cannot be used to decorate parameters (2:9)" -} 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 new file mode 100644 index 000000000000..2819428d5aef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json @@ -0,0 +1,213 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "errors": [ + "SyntaxError: Stage 2 decorators cannot be used to decorate parameters (2:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "obj" + }, + "name": "obj" + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 14, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "method" + }, + "name": "method" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x", + "decorators": [ + { + "type": "Decorator", + "start": 21, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "expression": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json index 7dd4ed9e2837..302bc76824f7 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json @@ -1,3 +1,11 @@ { - "throws": "Stage 2 decorators disallow object literal property decorators (2:2)" -} + "plugins": [ + [ + "decorators", + { + "decoratorsBeforeExport": false + } + ] + ], + "throws": "Unexpected token (2:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/options.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/options.json deleted file mode 100644 index a26ed7cacb84..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "You can't attach decorators to a class constructor (2:2)" -} diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json new file mode 100644 index 000000000000..c6d81bd74bd6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json @@ -0,0 +1,179 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: You can't attach decorators to a class constructor (2:2)", + "SyntaxError: Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "abc" + }, + "name": "abc" + } + } + ], + "static": false, + "key": { + "type": "Identifier", + "start": 21, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json index 599298db4614..fae0a8fe39ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json @@ -1,3 +1,5 @@ { - "throws": "Dynamic imports require a parameter: import('a.js') (2:9)" -} + "plugins": [ + "dynamicImport" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json new file mode 100644 index 000000000000..07f26c50d81d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json @@ -0,0 +1,172 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Dynamic imports require a parameter: import('a.js') (2:9)", + "SyntaxError: The only valid meta property for import is import.meta (2:16)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "failsParse" + }, + "name": "failsParse" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 26, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "argument": { + "type": "CallExpression", + "start": 33, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "callee": { + "type": "MetaProperty", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "meta": { + "type": "Identifier", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "import" + }, + "name": "import" + }, + "property": { + "type": "Identifier", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "then" + }, + "name": "then" + } + }, + "arguments": [] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json index c4e1e2ffeb50..fae0a8fe39ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json @@ -1,3 +1,5 @@ { - "throws": "... is not allowed in import() (1:7)" -} + "plugins": [ + "dynamicImport" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json new file mode 100644 index 000000000000..d6eaecc7e5c0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Import", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + "arguments": [ + { + "type": "SpreadElement", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "argument": { + "type": "ArrayExpression", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json index 26e64ffc5d96..fae0a8fe39ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json @@ -1,3 +1,5 @@ { - "throws": "Cannot use new with import(...) (1:4)" -} + "plugins": [ + "dynamicImport" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json new file mode 100644 index 000000000000..a0b8467953bc --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json @@ -0,0 +1,105 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "callee": { + "type": "Import", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json index ae6f5f18ff31..329bfdd92330 100644 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json @@ -1,3 +1,5 @@ { - "throws": "Trailing comma is disallowed inside import(...) arguments (1:12)" + "plugins": [ + "dynamicImport" + ] } diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json new file mode 100644 index 000000000000..fde34fb849ab --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json @@ -0,0 +1,108 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Import", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + "extra": { + "trailingComma": 12 + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json index 95a99c52ae49..fae0a8fe39ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json @@ -1,3 +1,5 @@ { - "throws": "import() requires exactly one argument (1:0)" -} + "plugins": [ + "dynamicImport" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json new file mode 100644 index 000000000000..f66dbbf22885 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json @@ -0,0 +1,125 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "errors": [ + "SyntaxError: import() requires exactly one argument (1:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Import", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": "hello", + "raw": "'hello'" + }, + "value": "hello" + }, + { + "type": "StringLiteral", + "start": 16, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "extra": { + "rawValue": "world", + "raw": "'world'" + }, + "value": "world" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json index 95a99c52ae49..fae0a8fe39ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json @@ -1,3 +1,5 @@ { - "throws": "import() requires exactly one argument (1:0)" -} + "plugins": [ + "dynamicImport" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json new file mode 100644 index 000000000000..9f50d0da240c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json @@ -0,0 +1,84 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "callee": { + "type": "Import", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + } + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/options.json b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/options.json index eb1e545759e8..cdbf46968b69 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/options.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/options.json @@ -1,5 +1,7 @@ { - "throws": "import.meta may appear only with 'sourceType: \"module\"' (1:10)", - "plugins": ["dynamicImport", "importMeta"], + "plugins": [ + "dynamicImport", + "importMeta" + ], "sourceType": "script" -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json new file mode 100644 index 000000000000..12e01e17c23c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json @@ -0,0 +1,137 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "errors": [ + "SyntaxError: import.meta may appear only with 'sourceType: \"module\"' (1:10)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "MetaProperty", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "meta": { + "type": "Identifier", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "import" + }, + "name": "import" + }, + "property": { + "type": "Identifier", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "meta" + }, + "name": "meta" + } + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json index 97ba83ec465d..e05ac2744632 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json @@ -1,5 +1,7 @@ { - "throws": "The only valid meta property for import is import.meta (1:7)", "sourceType": "module", - "plugins": ["dynamicImport", "importMeta"] -} + "plugins": [ + "dynamicImport", + "importMeta" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json new file mode 100644 index 000000000000..9b2370d8c3ec --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json @@ -0,0 +1,102 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "MetaProperty", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "meta": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "import" + }, + "name": "import" + }, + "property": { + "type": "Identifier", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "notMeta" + }, + "name": "notMeta" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/options.json b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/options.json index 647ad9f65dee..e05ac2744632 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/options.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/options.json @@ -1,5 +1,7 @@ { - "throws": "Invalid left-hand side in assignment expression (1:0)", "sourceType": "module", - "plugins": ["dynamicImport", "importMeta"] -} + "plugins": [ + "dynamicImport", + "importMeta" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json new file mode 100644 index 000000000000..914869881742 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json @@ -0,0 +1,135 @@ +{ + "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", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "MetaProperty", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "meta": { + "type": "Identifier", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "import" + }, + "name": "import" + }, + "property": { + "type": "Identifier", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "meta" + }, + "name": "meta" + } + }, + "right": { + "type": "BooleanLiteral", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": true + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/options.json deleted file mode 100644 index 27e4acfa8f65..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:1)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json new file mode 100644 index 000000000000..bed1899ddc7e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1_" + }, + "value": 1 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json new file mode 100644 index 000000000000..c1dac7764035 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1_" + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json new file mode 100644 index 000000000000..6839504edf6c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json new file mode 100644 index 000000000000..c7f4877e2059 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 1 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json new file mode 100644 index 000000000000..1b343c302559 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json new file mode 100644 index 000000000000..2ab61fd7bb04 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json @@ -0,0 +1,76 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1__", + "parenthesized": true, + "parenStart": 0 + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json new file mode 100644 index 000000000000..e799ede442c5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json @@ -0,0 +1,76 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1__1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json new file mode 100644 index 000000000000..7eef10ad862b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1_.1_1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 11.11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json new file mode 100644 index 000000000000..5a3cc58cada8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1._1_1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 11.11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json new file mode 100644 index 000000000000..45e0aecd2129 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_e1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json new file mode 100644 index 000000000000..73400bf8fd10 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_E1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json new file mode 100644 index 000000000000..6c6aa937ac70 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1e_1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json new file mode 100644 index 000000000000..a646828811ea --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1E_1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json new file mode 100644 index 000000000000..0a1b0a11038e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 161, + "raw": "0xa_1_" + }, + "value": 161 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json new file mode 100644 index 000000000000..34647c6e63c9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x1_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json new file mode 100644 index 000000000000..e33208bf5970 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 161, + "raw": "0xa_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 161 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json new file mode 100644 index 000000000000..48e2d915883b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 161, + "raw": "0x_a_1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 161 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json new file mode 100644 index 000000000000..af714540b44f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json @@ -0,0 +1,77 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x__1_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json new file mode 100644 index 000000000000..151f29fb87dc --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json @@ -0,0 +1,77 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1__1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json new file mode 100644 index 000000000000..3ec08e9eab54 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json @@ -0,0 +1,76 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json new file mode 100644 index 000000000000..b79700fd396f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json new file mode 100644 index 000000000000..c0bcbc71a47a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_11", + "parenthesized": true, + "parenStart": 0 + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json new file mode 100644 index 000000000000..00976d92c50f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json @@ -0,0 +1,76 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_01_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json new file mode 100644 index 000000000000..1858a06292b1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_0_1_1", + "parenthesized": true, + "parenStart": 0 + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json new file mode 100644 index 000000000000..a3ac3d5828d0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 161, + "raw": "0x_a_1" + }, + "value": 161 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json new file mode 100644 index 000000000000..0b18241bc1c5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json @@ -0,0 +1,76 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_01_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json new file mode 100644 index 000000000000..c478966220d4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b01_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json new file mode 100644 index 000000000000..3c73b3979a52 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o1_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json new file mode 100644 index 000000000000..7b4538c88e9c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json @@ -0,0 +1,76 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1_", + "parenthesized": true, + "parenStart": 0 + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json new file mode 100644 index 000000000000..55f03701d9db --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1_" + }, + "value": 1 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json new file mode 100644 index 000000000000..4c87cc2b22a7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1_" + }, + "value": 11 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json new file mode 100644 index 000000000000..65bec6bcbd60 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json @@ -0,0 +1,92 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1__" + }, + "value": 11 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json new file mode 100644 index 000000000000..740a870e3ad3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json @@ -0,0 +1,92 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1__1" + }, + "value": 11 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json new file mode 100644 index 000000000000..8b3ea170250c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1_.1_1" + }, + "value": 11.11 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json new file mode 100644 index 000000000000..a30df38017e0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1._1_1" + }, + "value": 11.11 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json new file mode 100644 index 000000000000..78257d308a98 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x__1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json new file mode 100644 index 000000000000..a3ea6fad2e5a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_e1" + }, + "value": 111 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json new file mode 100644 index 000000000000..6461d8dba2bd --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_E1" + }, + "value": 111 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json new file mode 100644 index 000000000000..d27ae3b4fadf --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1e_1" + }, + "value": 111 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json new file mode 100644 index 000000000000..ee4395d21f55 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1E_1" + }, + "value": 111 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json new file mode 100644 index 000000000000..29dc70b2487f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json new file mode 100644 index 000000000000..f08afb905eac --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 161, + "raw": "0xa_1_" + }, + "value": 161 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json new file mode 100644 index 000000000000..2507a579d6de --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 161, + "raw": "0x_a_1" + }, + "value": 161 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json new file mode 100644 index 000000000000..89afd3efde35 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json @@ -0,0 +1,93 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x__1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json new file mode 100644 index 000000000000..8cad1428818e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json @@ -0,0 +1,93 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1__1" + }, + "value": 17 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json new file mode 100644 index 000000000000..9d86aac2191a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json @@ -0,0 +1,92 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json new file mode 100644 index 000000000000..477b3c1f3cf4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1__1" + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json new file mode 100644 index 000000000000..73b694a6656c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1" + }, + "value": 9 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json new file mode 100644 index 000000000000..3e602cf8e35b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_11" + }, + "value": 9 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json new file mode 100644 index 000000000000..7b96b478be97 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json @@ -0,0 +1,92 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_01_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json new file mode 100644 index 000000000000..bd3c89e95560 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_0_1_1" + }, + "value": 3 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json new file mode 100644 index 000000000000..df4e4858faae --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json @@ -0,0 +1,92 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_01_1_" + }, + "value": 3 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json new file mode 100644 index 000000000000..f9203546d16c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b01_1_" + }, + "value": 3 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json new file mode 100644 index 000000000000..3138ed92346a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o1_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json new file mode 100644 index 000000000000..5cd647c2bf7d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json @@ -0,0 +1,92 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "BlockStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json new file mode 100644 index 000000000000..a43596db0e4e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json new file mode 100644 index 000000000000..c6b51546660e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json new file mode 100644 index 000000000000..4788bc887407 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_11" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json new file mode 100644 index 000000000000..e797620a329e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_01_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json new file mode 100644 index 000000000000..509fa7be5376 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_0_1_1" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json new file mode 100644 index 000000000000..71b523cdc3f5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1__" + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json new file mode 100644 index 000000000000..386c54cac8e1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_01_1_" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json new file mode 100644 index 000000000000..99329263441c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b01_1_" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json new file mode 100644 index 000000000000..031ce3f9fcf2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o1_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json new file mode 100644 index 000000000000..cf60b4557bd1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json new file mode 100644 index 000000000000..0de8505e1170 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 8, + "raw": "0o01_8" + }, + "value": 8 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/options.json deleted file mode 100644 index 7f37dbb4686b..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Expected number in radix 2 (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json new file mode 100644 index 000000000000..ab45a08cb897 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 1, + "raw": "0b2_1" + }, + "value": 1 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-27/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-27/options.json index fab06a453d2f..ee18527964e7 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-27/options.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-27/options.json @@ -1 +1,3 @@ -{ "throws": "Expected number in radix 16 (1:2)" } +{ + "throws": "Identifier directly after number (1:2)" +} diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/options.json deleted file mode 100644 index 27e4acfa8f65..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:1)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json new file mode 100644 index 000000000000..22352b5f300f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1_" + }, + "value": 1 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json new file mode 100644 index 000000000000..109e14677751 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1_" + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/options.json deleted file mode 100644 index 27e4acfa8f65..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:1)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json new file mode 100644 index 000000000000..39f6afe910ec --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 11, + "raw": "1__1" + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json new file mode 100644 index 000000000000..422bdd6c6384 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1__" + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/options.json deleted file mode 100644 index 27e4acfa8f65..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:1)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json new file mode 100644 index 000000000000..4cf178b2082e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 11, + "raw": "1__1" + }, + "value": 11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json new file mode 100644 index 000000000000..3ac121a5eece --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1_.1_1" + }, + "value": 11.11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json new file mode 100644 index 000000000000..4e344f6fd3bf --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1._1_1" + }, + "value": 11.11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json new file mode 100644 index 000000000000..d8a2a2deda67 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_e1" + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json new file mode 100644 index 000000000000..0b63b9681805 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_E1" + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json new file mode 100644 index 000000000000..6a9efc69296c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1e_1" + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json new file mode 100644 index 000000000000..f68c59283508 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1E_1" + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json new file mode 100644 index 000000000000..0c35b0296649 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json new file mode 100644 index 000000000000..8076713df223 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 161, + "raw": "0xa_1_" + }, + "value": 161 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json new file mode 100644 index 000000000000..ad70ca6fc270 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1_.1_1" + }, + "value": 11.11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json new file mode 100644 index 000000000000..31bfeccc15a7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 161, + "raw": "0x_a_1" + }, + "value": 161 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json new file mode 100644 index 000000000000..ca8eaf7c7c31 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x__1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json new file mode 100644 index 000000000000..689560a3bb3c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json @@ -0,0 +1,75 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1__1" + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json new file mode 100644 index 000000000000..b92b88fa4a19 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1_1_" + }, + "value": 17 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json new file mode 100644 index 000000000000..9487edc545b8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json new file mode 100644 index 000000000000..1c39ba7a1d72 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_11" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json new file mode 100644 index 000000000000..2890e46ca71d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_01_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json new file mode 100644 index 000000000000..6de8c77bf903 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_0_1_1" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json new file mode 100644 index 000000000000..ae93a109760c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_01_1_" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json new file mode 100644 index 000000000000..fdede7a21ac0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b01_1_" + }, + "value": 3 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json new file mode 100644 index 000000000000..ae808dbc99cf --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1._1_1" + }, + "value": 11.11 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json new file mode 100644 index 000000000000..784d1a34983e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o1_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json new file mode 100644 index 000000000000..678bccf4fa1e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1_" + }, + "value": 9 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/input.js index b6b4f448099d..475f52e0eb50 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/input.js @@ -1 +1 @@ -1_, +1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/options.json deleted file mode 100644 index 27e4acfa8f65..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:1)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json new file mode 100644 index 000000000000..2c53bf532cbd --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1_" + }, + "value": 1 + }, + { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/input.js index 4b8047ea34a5..ce3480ab5810 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/input.js @@ -1 +1 @@ -1_1_, +1_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json new file mode 100644 index 000000000000..f3956eac0884 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1_" + }, + "value": 11 + }, + { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/input.js index cac8642d14e7..be4906c68d09 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/input.js @@ -1 +1 @@ -1_1__, +1_1__, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json new file mode 100644 index 000000000000..fa8e18cac1a1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json @@ -0,0 +1,111 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1__" + }, + "value": 11 + }, + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/input.js index a9051bb2db71..10191f1bd355 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/input.js @@ -1 +1 @@ -1__1, +1__1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/options.json deleted file mode 100644 index 27e4acfa8f65..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:1)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json new file mode 100644 index 000000000000..d2ac83f6572e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json @@ -0,0 +1,111 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 11, + "raw": "1__1" + }, + "value": 11 + }, + { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/input.js index 7213755d0f38..be9c6e14d226 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/input.js @@ -1 +1 @@ -1_1_.1_1, +1_1_.1_1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json new file mode 100644 index 000000000000..154d9a6f4641 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1_.1_1" + }, + "value": 11.11 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/input.js index db8717756d2a..e2a13541725e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/input.js @@ -1 +1 @@ -1_1._1_1, +1_1._1_1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json new file mode 100644 index 000000000000..6e462c0e07d4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1._1_1" + }, + "value": 11.11 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/input.js index 5e5e356da976..49539d8e1686 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/input.js @@ -1 +1 @@ -1_1.1_e1, +1_1.1_e1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json new file mode 100644 index 000000000000..95a795d633b6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_e1" + }, + "value": 111 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/input.js index b07556e6d95e..b06fd2edbbc4 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/input.js @@ -1 +1 @@ -1_1.1_E1, +1_1.1_E1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json new file mode 100644 index 000000000000..51953305e0c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_E1" + }, + "value": 111 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json new file mode 100644 index 000000000000..d0b1538b39dc --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_e1" + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/input.js index 0186dfaccb82..61f6290af574 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/input.js @@ -1 +1 @@ -1_1.1e_1, +1_1.1e_1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json new file mode 100644 index 000000000000..a394466973f3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1e_1" + }, + "value": 111 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/input.js index 85594dea3099..026cf8e40d3a 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/input.js @@ -1 +1 @@ -1_1.1E_1, +1_1.1E_1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json new file mode 100644 index 000000000000..36605277710f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1E_1" + }, + "value": 111 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/input.js index e0ed0c98f626..b34d9ea95a4d 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/input.js @@ -1 +1 @@ -0x1_1_, +0x1_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json new file mode 100644 index 000000000000..347125ca2b1d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x1_1_" + }, + "value": 17 + }, + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/input.js index d1b793f8dfed..28a917a7aca3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/input.js @@ -1 +1 @@ -0xa_1_, +0xa_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json new file mode 100644 index 000000000000..ac06aae7f847 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 161, + "raw": "0xa_1_" + }, + "value": 161 + }, + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/input.js index e5543066d000..8e1c3c4399a1 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/input.js @@ -1 +1 @@ -0x_a_1, +0x_a_1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json new file mode 100644 index 000000000000..a70fc4a0fa0f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 161, + "raw": "0x_a_1" + }, + "value": 161 + }, + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/input.js index 68e6a0d63fea..d8039a473eb0 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/input.js @@ -1 +1 @@ -0x__1_1_, +0x__1_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json new file mode 100644 index 000000000000..b75b68e18c5f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json @@ -0,0 +1,112 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x__1_1_" + }, + "value": 17 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/input.js index fd959c9609a9..3853dd5ba743 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/input.js @@ -1 +1 @@ -0x_1__1, +0x_1__1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json new file mode 100644 index 000000000000..7ddf567a2967 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json @@ -0,0 +1,112 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1__1" + }, + "value": 17 + }, + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/input.js index dc2301a00ea7..90213eb4c896 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/input.js @@ -1 +1 @@ -0x_1_1_, +0x_1_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json new file mode 100644 index 000000000000..849bdb6de9a8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json @@ -0,0 +1,111 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1_1_" + }, + "value": 17 + }, + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/input.js index 3a7f53b8dc81..56f62d261b65 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/input.js @@ -1 +1 @@ -0o_1_1, +0o_1_1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json new file mode 100644 index 000000000000..112bef72c91a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1" + }, + "value": 9 + }, + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/input.js index ed870aa937cd..fe56d1a3c36d 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/input.js @@ -1 +1 @@ -0o_11, +0o_11, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json new file mode 100644 index 000000000000..e702d612d243 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_11" + }, + "value": 9 + }, + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json new file mode 100644 index 000000000000..13d9caf030b8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_E1" + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/input.js index e9fcb15ff998..d395282140ef 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/input.js @@ -1 +1 @@ -0o_01_1_, +0o_01_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json new file mode 100644 index 000000000000..5f86cf161b9a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json @@ -0,0 +1,111 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_01_1_" + }, + "value": 9 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/input.js index 86cc54d9ed2d..4f5cb5c1e06b 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/input.js @@ -1 +1 @@ -0b_0_1_1, +0b_0_1_1, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json new file mode 100644 index 000000000000..5ce3d7e5f1db --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_0_1_1" + }, + "value": 3 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/input.js index 0c52a13346c0..1589fddd67c3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/input.js @@ -1 +1 @@ -0b_01_1_, +0b_01_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json new file mode 100644 index 000000000000..3364a2a11b7b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json @@ -0,0 +1,111 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_01_1_" + }, + "value": 3 + }, + { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/input.js index 95c45fd025be..c730763e66fa 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/input.js @@ -1 +1 @@ -0b01_1_, +0b01_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json new file mode 100644 index 000000000000..77046a4ee17f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b01_1_" + }, + "value": 3 + }, + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/input.js index 58ff35dd6c36..3a3aa0484726 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/input.js @@ -1 +1 @@ -0o1_1_, +0o1_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json new file mode 100644 index 000000000000..fdc0933003a0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json @@ -0,0 +1,110 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o1_1_" + }, + "value": 9 + }, + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/input.js index bd44d425a6fa..a4d36757d478 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/input.js +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/input.js @@ -1 +1 @@ -0o_1_1_, +0o_1_1_, 0 diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json new file mode 100644 index 000000000000..7f14d41f530d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json @@ -0,0 +1,111 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1_" + }, + "value": 9 + }, + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json new file mode 100644 index 000000000000..f505cbb81666 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 1, + "raw": "1_" + }, + "value": 1 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json new file mode 100644 index 000000000000..2648664f298c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1_" + }, + "value": 11 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json new file mode 100644 index 000000000000..a270c2420610 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 11, + "raw": "1_1__" + }, + "value": 11 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/options.json deleted file mode 100644 index 8cb6bf4866a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json new file mode 100644 index 000000000000..650a98a4cbff --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 11, + "raw": "1__1" + }, + "value": 11 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json new file mode 100644 index 000000000000..037c60cbef6f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1e_1" + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/options.json deleted file mode 100644 index 91c5decd9c42..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json new file mode 100644 index 000000000000..1410809bebec --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1_.1_1" + }, + "value": 11.11 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/options.json deleted file mode 100644 index a65e1ff322a7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json new file mode 100644 index 000000000000..5ac0337bfe64 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 11.11, + "raw": "1_1._1_1" + }, + "value": 11.11 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json new file mode 100644 index 000000000000..417003e07eaa --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_e1" + }, + "value": 111 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json new file mode 100644 index 000000000000..9aa4e5c834d8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1_E1" + }, + "value": 111 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json new file mode 100644 index 000000000000..859e6d5d5325 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1e_1" + }, + "value": 111 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json new file mode 100644 index 000000000000..5020300be097 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1E_1" + }, + "value": 111 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json new file mode 100644 index 000000000000..3f132f054796 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x1_1_" + }, + "value": 17 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json new file mode 100644 index 000000000000..173a126235b1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 161, + "raw": "0xa_1_" + }, + "value": 161 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json new file mode 100644 index 000000000000..4f7277b6d914 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 161, + "raw": "0x_a_1" + }, + "value": 161 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json new file mode 100644 index 000000000000..1e5f3a747c34 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json @@ -0,0 +1,92 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x__1_1_" + }, + "value": 17 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json new file mode 100644 index 000000000000..ea1d5804721a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 111, + "raw": "1_1.1E_1" + }, + "value": 111 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json new file mode 100644 index 000000000000..9723cfbd4fda --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json @@ -0,0 +1,92 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1__1" + }, + "value": 17 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json new file mode 100644 index 000000000000..e802a59e0737 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 17, + "raw": "0x_1_1_" + }, + "value": 17 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json new file mode 100644 index 000000000000..ffc792a8db4d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1" + }, + "value": 9 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json new file mode 100644 index 000000000000..583643ac786d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_11" + }, + "value": 9 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json new file mode 100644 index 000000000000..71984f0f6d53 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_01_1_" + }, + "value": 9 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json new file mode 100644 index 000000000000..92169c50ab72 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_0_1_1" + }, + "value": 3 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json new file mode 100644 index 000000000000..8775652f6e4e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b_01_1_" + }, + "value": 3 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/options.json deleted file mode 100644 index badcb4c1b655..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:7)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json new file mode 100644 index 000000000000..8427ff4fefb2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 3, + "raw": "0b01_1_" + }, + "value": 3 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/options.json deleted file mode 100644 index 9c49308645fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json new file mode 100644 index 000000000000..ab96b90e5fb1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json @@ -0,0 +1,90 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o1_1_" + }, + "value": 9 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/options.json deleted file mode 100644 index 477511a87822..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/options.json +++ /dev/null @@ -1 +0,0 @@ -{ "throws": "Invalid or unexpected token (1:3)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json new file mode 100644 index 000000000000..a3925ad6c8e8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 9, + "raw": "0o_1_1_" + }, + "value": 9 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json index fd0b1c7f0a7d..45b66a114bf9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json @@ -1 +1,6 @@ -{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:4)" } +{ + "plugins": [ + "bigInt", + "numericSeparator" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json new file mode 100644 index 000000000000..f47a3612a995 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json index 57c99a94dbd6..45b66a114bf9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json @@ -1 +1,6 @@ -{ "throws": "Numeric separator can not be used after leading 0 (1:1)" } +{ + "plugins": [ + "bigInt", + "numericSeparator" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json new file mode 100644 index 000000000000..b9271342b1f5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "extra": { + "rawValue": 8, + "raw": "0_8" + }, + "value": 8 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json index 5a4fb4525d02..45b66a114bf9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json @@ -1 +1,6 @@ -{ "throws": "Numeric separator can not be used after leading 0 (1:2)" } +{ + "plugins": [ + "bigInt", + "numericSeparator" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json new file mode 100644 index 000000000000..9677b88e4b27 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "NumericLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "extra": { + "rawValue": 0, + "raw": "00_0" + }, + "value": 0 + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json index 5a4fb4525d02..45b66a114bf9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json @@ -1 +1,6 @@ -{ "throws": "Numeric separator can not be used after leading 0 (1:2)" } +{ + "plugins": [ + "bigInt", + "numericSeparator" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json new file mode 100644 index 000000000000..da24fe2bdd7d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json @@ -0,0 +1,74 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "BigIntLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": "080", + "raw": "08_0n" + }, + "value": "080" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json index ca0ceaeaaea6..45b66a114bf9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json @@ -1 +1,6 @@ -{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:5)" } +{ + "plugins": [ + "bigInt", + "numericSeparator" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json new file mode 100644 index 000000000000..b3d5564b9494 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "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" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json index e42d95d86acf..45b66a114bf9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json @@ -1 +1,6 @@ -{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:6)" } +{ + "plugins": [ + "bigInt", + "numericSeparator" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json new file mode 100644 index 000000000000..e30a6e6b7370 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json @@ -0,0 +1,73 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [], + "directives": [ + { + "type": "Directive", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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}" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json index ed5e3c16bf68..0011d898807d 100644 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json @@ -1,4 +1,5 @@ { - "plugins": ["optionalChaining"], - "throws": "constructors in/after an Optional Chain are not allowed (1:10)" -} + "plugins": [ + "optionalChaining" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json new file mode 100644 index 000000000000..8ecf52133d5f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json @@ -0,0 +1,154 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "OptionalMemberExpression", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "object": { + "type": "OptionalMemberExpression", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "object": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "C" + }, + "name": "C" + }, + "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 + }, + "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": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json index 10cef4d48073..0011d898807d 100644 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json @@ -1,4 +1,5 @@ { - "plugins": ["optionalChaining"], - "throws": "constructors in/after an Optional Chain are not allowed (1:7)" -} + "plugins": [ + "optionalChaining" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json new file mode 100644 index 000000000000..6c643fbdd8ab --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json @@ -0,0 +1,86 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "arguments": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json index 631741b044e0..0011d898807d 100644 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json @@ -1,4 +1,5 @@ { - "plugins": ["optionalChaining"], - "throws": "Tagged Template Literals are not allowed in optionalChain (1:0)" -} + "plugins": [ + "optionalChaining" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json new file mode 100644 index 000000000000..9dff15f15eda --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json @@ -0,0 +1,157 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "TaggedTemplateExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "tag": { + "type": "OptionalMemberExpression", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "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": { + "type": "TemplateLiteral", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "value": { + "raw": "foo", + "cooked": "foo" + }, + "tail": true + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/options.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/options.json index 58192a87fd99..982b7cd1dab5 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/options.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/options.json @@ -1,4 +1,5 @@ { - "plugins": ["partialApplication"], - "throws": "Unexpected argument placeholder (3:16)" -} + "plugins": [ + "partialApplication" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..14f531a7e147 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json @@ -0,0 +1,390 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "Bar" + }, + "name": "Bar" + }, + "body": { + "type": "ClassBody", + "start": 22, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 26, + "end": 84, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 26, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 40, + "end": 84, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 46, + "end": 64, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "expression": { + "type": "CallExpression", + "start": 46, + "end": 63, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "callee": { + "type": "Super", + "start": 46, + "end": 51, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "arguments": [ + { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "NumericLiteral", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + { + "type": "ArgumentPlaceholder", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + } + } + }, + { + "type": "ArgumentPlaceholder", + "start": 61, + "end": 62, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 20 + } + } + } + ] + } + }, + { + "type": "ExpressionStatement", + "start": 69, + "end": 80, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 69, + "end": 79, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 14 + } + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "start": 69, + "end": 75, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "object": { + "type": "ThisExpression", + "start": 69, + "end": 73, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 8 + } + } + }, + "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", + "start": 78, + "end": 79, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/options.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/options.json index 3b09c84c03eb..982b7cd1dab5 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/options.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/options.json @@ -1,4 +1,5 @@ { - "plugins": ["partialApplication"], - "throws": "Unexpected argument placeholder (1:11)" -} + "plugins": [ + "partialApplication" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..d12380e4820c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json @@ -0,0 +1,155 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "arguments": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x" + }, + { + "type": "ArgumentPlaceholder", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + }, + { + "type": "ArgumentPlaceholder", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + ] + } + } + ], + "directives": [] + } +} \ 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/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/options.json index cc2c16a778e7..abf908b86e3e 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/options.json @@ -1,4 +1,10 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline head should not be a comma-separated sequence expression (1:0)" -} + "plugins": [ + [ + "pipelineOperator", + { + "proposal": "smart" + } + ] + ] +} \ 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 new file mode 100644 index 000000000000..b06186702668 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json @@ -0,0 +1,162 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "left": { + "type": "SequenceExpression", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + { + "type": "NumericLiteral", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "operator": "|>", + "right": { + "type": "PipelineBareFunction", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callee": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "f" + }, + "name": "f" + } + } + } + } + ], + "directives": [] + } +} \ 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/options.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/options.json index d2b32f77521a..17e4e327bbad 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:5)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..9aceb13325af --- /dev/null +++ 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 @@ -0,0 +1,207 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "$" + }, + "name": "$" + } + ], + "body": { + "type": "BinaryExpression", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "$" + }, + "name": "$" + }, + "operator": "|>", + "right": { + "type": "PipelineBareFunction", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "callee": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "f" + }, + "name": "f" + } + } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 + } + } + } + } + } + ], + "directives": [] + } +} \ 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-topic-style,-no-inner-topic-reference/options.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/options.json index e9eab6b46fe9..17e4e327bbad 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:16)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..a4b95926f362 --- /dev/null +++ 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 @@ -0,0 +1,241 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 5, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 6, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "$" + }, + "name": "$" + } + ], + "body": { + "type": "BinaryExpression", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "PipelinePrimaryTopicReference", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + } + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "$" + }, + "name": "$" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 + } + } + } + } + } + ], + "directives": [] + } +} \ 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-topic-style,-no-outer-topic-reference/options.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/options.json index d2b32f77521a..17e4e327bbad 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:5)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..257c98280e2e --- /dev/null +++ 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 @@ -0,0 +1,205 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 5, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "$" + }, + "name": "$" + } + ], + "body": { + "type": "BinaryExpression", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "$" + }, + "name": "$" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "PipelinePrimaryTopicReference", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 + } + } + } + } + } + ], + "directives": [] + } +} \ 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-inner-topic-style,-no-inner-topic-reference/options.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/options.json index bdf0547df8f9..17e4e327bbad 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:11)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..5644ff01406b --- /dev/null +++ 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 @@ -0,0 +1,184 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "PipelinePrimaryTopicReference", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + } + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "CallExpression", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callee": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "f" + }, + "name": "f" + }, + "arguments": [] + } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 + } + } + } + } + } + ], + "directives": [] + } +} \ 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-inner-topic-style,-no-outer-topic-reference/options.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/options.json index d2b32f77521a..17e4e327bbad 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:5)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..f274dbc1ad48 --- /dev/null +++ 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 @@ -0,0 +1,170 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "$" + }, + "name": "$" + }, + "operator": "|>", + "right": { + "type": "PipelineBareFunction", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "callee": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "f" + }, + "name": "f" + } + }, + "extra": { + "parenthesized": true, + "parenStart": 5 + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/options.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/options.json index fe3873ecc67f..abf908b86e3e 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/options.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/options.json @@ -1,4 +1,10 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline body may not be a comma-separated sequence expression (1:6)" -} + "plugins": [ + [ + "pipelineOperator", + { + "proposal": "smart" + } + ] + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..b0b8ec5955df --- /dev/null +++ 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 @@ -0,0 +1,203 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "PipelinePrimaryTopicReference", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "PipelinePrimaryTopicReference", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } + } + } + }, + "operator": "|>", + "right": { + "type": "PipelineBareFunction", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "callee": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "h" + }, + "name": "h" + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json index fe3873ecc67f..abf908b86e3e 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json @@ -1,4 +1,10 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline body may not be a comma-separated sequence expression (1:6)" -} + "plugins": [ + [ + "pipelineOperator", + { + "proposal": "smart" + } + ] + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..89c673d0bc0c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json @@ -0,0 +1,155 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "left": { + "type": "NumericLiteral", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 7, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expressions": [ + { + "type": "PipelinePrimaryTopicReference", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + { + "type": "PipelinePrimaryTopicReference", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json index 7a4451381c91..17e4e327bbad 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:9)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..feca14ebaf5b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json @@ -0,0 +1,151 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "MemberExpression", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "object": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "property": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": true + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json index 7a4451381c91..17e4e327bbad 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:9)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..c1399c71afa2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json @@ -0,0 +1,151 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "left": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "b" + }, + "name": "b" + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json index 7a4451381c91..17e4e327bbad 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:9)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..da79f8d294e8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json @@ -0,0 +1,134 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "ClassExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "body": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json index 7a4451381c91..17e4e327bbad 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Pipeline is in topic style but does not use topic reference (1:9)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..63e37b46042d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 24, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "argument": null + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/input.js 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/input.js index c1005576b7d5..8b34c84f521f 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/input.js +++ 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/input.js @@ -1 +1 @@ -value |> do { do x += # while (x < 50); } +value |> do { do x += #; while (x < 50); } 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/options.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/options.json index 3b7a52d71cf7..edb7679c6a74 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"], - "throws": "Topic reference was used in a lexical context without topic binding (1:22)" + "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] } 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 new file mode 100644 index 000000000000..95125a326a21 --- /dev/null +++ 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 @@ -0,0 +1,266 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "expression": { + "type": "DoExpression", + "start": 9, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "body": [ + { + "type": "DoWhileStatement", + "start": 14, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "operator": "+=", + "left": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "PipelinePrimaryTopicReference", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + } + }, + "test": { + "type": "BinaryExpression", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "left": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "extra": { + "rawValue": 50, + "raw": "50" + }, + "value": 50 + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/options.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/options.json index d117d235099d..680f780892b7 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/options.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/options.json @@ -3,6 +3,5 @@ ["pipelineOperator", { "proposal": "smart" }], "doExpressions", "asyncGenerators" - ], - "throws": "Topic reference was used in a lexical context without topic binding (2:48)" + ] } 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 new file mode 100644 index 000000000000..372a871e8b7b --- /dev/null +++ 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 @@ -0,0 +1,302 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "af" + }, + "name": "af" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 77, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 52 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 25, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 52 + } + }, + "left": { + "type": "Identifier", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 34, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 52 + } + }, + "expression": { + "type": "DoExpression", + "start": 34, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 52 + } + }, + "body": { + "type": "BlockStatement", + "start": 37, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 52 + } + }, + "body": [ + { + "type": "ForOfStatement", + "start": 39, + "end": 73, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 50 + } + }, + "await": true, + "left": { + "type": "VariableDeclaration", + "start": 50, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 56, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 56, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 34 + }, + "identifierName": "e" + }, + "name": "e" + }, + "init": null + } + ], + "kind": "const" + }, + "right": { + "type": "Identifier", + "start": 61, + "end": 69, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 46 + }, + "identifierName": "sequence" + }, + "name": "sequence" + }, + "body": { + "type": "ExpressionStatement", + "start": 71, + "end": 73, + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 50 + } + }, + "expression": { + "type": "PipelinePrimaryTopicReference", + "start": 71, + "end": 72, + "loc": { + "start": { + "line": 2, + "column": 48 + }, + "end": { + "line": 2, + "column": 49 + } + } + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/options.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/options.json index 35e8658a93da..edb7679c6a74 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"], - "throws": "Topic reference was used in a lexical context without topic binding (1:45)" + "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] } 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 new file mode 100644 index 000000000000..58ca8064b581 --- /dev/null +++ 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 @@ -0,0 +1,353 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "expression": { + "type": "DoExpression", + "start": 9, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 49 + } + }, + "body": [ + { + "type": "ForStatement", + "start": 14, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "init": { + "type": "VariableDeclaration", + "start": 19, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "i" + }, + "name": "i" + }, + "init": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "let" + }, + "test": { + "type": "BinaryExpression", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "left": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 31 + }, + "identifierName": "i" + }, + "name": "i" + }, + "operator": "<", + "right": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "n" + }, + "name": "n" + } + }, + "update": { + "type": "AssignmentExpression", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "operator": "+=", + "left": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 38 + }, + "identifierName": "i" + }, + "name": "i" + }, + "right": { + "type": "NumericLiteral", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "expression": { + "type": "PipelinePrimaryTopicReference", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 46 + } + } + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/options.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/options.json index 6e8b4a6f0d95..edb7679c6a74 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"], - "throws": "Topic reference was used in a lexical context without topic binding (1:32)" + "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] } 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 new file mode 100644 index 000000000000..6f197479125e --- /dev/null +++ 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 @@ -0,0 +1,214 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "DoExpression", + "start": 9, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "body": [ + { + "type": "ForInStatement", + "start": 14, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "left": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "e" + }, + "name": "e" + }, + "right": { + "type": "Identifier", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "object" + }, + "name": "object" + }, + "body": { + "type": "ExpressionStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "expression": { + "type": "PipelinePrimaryTopicReference", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 33 + } + } + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/options.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/options.json index a3707cc91710..edb7679c6a74 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"], - "throws": "Topic reference was used in a lexical context without topic binding (1:34)" + "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] } 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 new file mode 100644 index 000000000000..b4bdcb7bcd7d --- /dev/null +++ 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 @@ -0,0 +1,215 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "DoExpression", + "start": 9, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "ForOfStatement", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "await": false, + "left": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "e" + }, + "name": "e" + }, + "right": { + "type": "Identifier", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "sequence" + }, + "name": "sequence" + }, + "body": { + "type": "ExpressionStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "PipelinePrimaryTopicReference", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + } + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/options.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/options.json index 0f40a90d2204..edb7679c6a74 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"], - "throws": "Topic reference was used in a lexical context without topic binding (3:32)" + "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] } 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 new file mode 100644 index 000000000000..f168982f9d91 --- /dev/null +++ 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 @@ -0,0 +1,412 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "expression": { + "type": "DoExpression", + "start": 9, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 78, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "TryStatement", + "start": 16, + "end": 76, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 37 + } + }, + "block": { + "type": "BlockStatement", + "start": 20, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 22, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "expression": { + "type": "CallExpression", + "start": 22, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "callee": { + "type": "MemberExpression", + "start": 22, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "object": { + "type": "Identifier", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "JSON" + }, + "name": "JSON" + }, + "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": [ + { + "type": "PipelinePrimaryTopicReference", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + } + } + ] + } + } + ], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start": 41, + "end": 76, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 37 + } + }, + "param": { + "type": "Identifier", + "start": 48, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 14 + }, + "identifierName": "error" + }, + "name": "error" + }, + "body": { + "type": "BlockStatement", + "start": 55, + "end": 76, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 37 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 57, + "end": 74, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 35 + } + }, + "expression": { + "type": "CallExpression", + "start": 57, + "end": 73, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 34 + } + }, + "callee": { + "type": "MemberExpression", + "start": 57, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 31 + } + }, + "object": { + "type": "Identifier", + "start": 57, + "end": 64, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 25 + }, + "identifierName": "console" + }, + "name": "console" + }, + "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": [ + { + "type": "PipelinePrimaryTopicReference", + "start": 71, + "end": 72, + "loc": { + "start": { + "line": 3, + "column": 32 + }, + "end": { + "line": 3, + "column": 33 + } + } + } + ] + } + } + ], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/options.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/options.json index a3707cc91710..edb7679c6a74 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"], - "throws": "Topic reference was used in a lexical context without topic binding (1:34)" + "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] } 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 new file mode 100644 index 000000000000..899a06650593 --- /dev/null +++ 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 @@ -0,0 +1,266 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "expression": { + "type": "DoExpression", + "start": 9, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [ + { + "type": "WhileStatement", + "start": 14, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "test": { + "type": "BinaryExpression", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "left": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "<", + "right": { + "type": "NumericLiteral", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "extra": { + "rawValue": 50, + "raw": "50" + }, + "value": 50 + } + }, + "body": { + "type": "ExpressionStatement", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "operator": "+=", + "left": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "PipelinePrimaryTopicReference", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + } + } + } + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file 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/options.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/options.json index fee1ffebc044..edb7679c6a74 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/options.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/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"], - "throws": "Topic reference was used in a lexical context without topic binding (1:24)" + "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] } 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 new file mode 100644 index 000000000000..a185b5983604 --- /dev/null +++ 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 @@ -0,0 +1,196 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "value" + }, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "expression": { + "type": "DoExpression", + "start": 9, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": { + "type": "BlockStatement", + "start": 12, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "body": [ + { + "type": "WithStatement", + "start": 14, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "object": { + "type": "ObjectExpression", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "properties": [] + }, + "body": { + "type": "ExpressionStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "expression": { + "type": "PipelinePrimaryTopicReference", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ 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/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/options.json index 6401af97db12..17e4e327bbad 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Topic reference was used in a lexical context without topic binding (1:39)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..64fb49d7358b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json @@ -0,0 +1,287 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 5, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "expression": { + "type": "ClassExpression", + "start": 5, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 11, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 13, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 30, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 30, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "operator": "=", + "left": { + "type": "MemberExpression", + "start": 30, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "object": { + "type": "ThisExpression", + "start": 30, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 34 + } + } + }, + "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", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + } + } + } + } + } + ], + "directives": [] + } + } + ] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json index e6731253189f..17e4e327bbad 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Topic reference was used in a lexical context without topic binding (1:19)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..df16ab34e48b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json @@ -0,0 +1,169 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 5, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 5, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "PipelinePrimaryTopicReference", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json index e6731253189f..17e4e327bbad 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json @@ -1,4 +1,3 @@ { - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Topic reference was used in a lexical context without topic binding (1:19)" + "plugins": [["pipelineOperator", { "proposal": "smart" }]] } 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 new file mode 100644 index 000000000000..0023723944ac --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json @@ -0,0 +1,215 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 5, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 5, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "left": { + "type": "PipelinePrimaryTopicReference", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + } + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "PipelinePrimaryTopicReference", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + } + } + } + ], + "directives": [] + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..f2d99c02f8f3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..84ac3db2b3e5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..ad1bda1a1fbc --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..5c60a91a9482 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..76b845845cea --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..6dd7932c623a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..46ca5191adb2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..b050c973d652 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\xAg", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..5876338e6e3c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..ab51dae8c74a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..7e0fe1f7af88 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..05034cfa43af --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..4daf639555aa --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\u0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..93487dccb244 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..d90c680f758c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..11b9589834ce --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..aef068ff0dcb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u0g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..83c602cde696 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..b775d5821aeb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..7bfe8f7bc378 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..b148595b1c8c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u00g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..b0e6a55f8b9d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..0d3190ef7f95 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..a7b5e0bd1bfd --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..ac3a71555369 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..5163754673d0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u000g", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..2273b5e141cf --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..fecd37e4b169 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..83150d31dec6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..f5d1e7ad2ec7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u{}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..1f51bd46894e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..2654eccc8ca8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 11, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..b3b301d701b4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..1d30df1fa402 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\01", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..124c7c8c9d41 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "\\u{-0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..e22b35045789 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..e25755bdf0c5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..3dfeb7480fa4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..8da7d9e51bdf --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{g}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..07b00d61949a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..b03d29b7821a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..dab814bd833d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..28b0d47818c9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "\\u{", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..0c1f9bcd5045 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..6ce800288f9a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..2e283e2f77c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..151b718a43f4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..0ca0c69ed03d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{\\\\", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..eb1dc9edcf28 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..a0df02ed0394 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 10, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..b757f165c1ee --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..8ee240a36baf --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "\\u{\\`", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..1450743b5caa --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..24b6f69d7f38 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..26af843c60e5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..cf4eef5577aa --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..ad94447a587d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": { + "raw": "\\u{0", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..c1f7f255feb4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..5782d9c9baef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 13, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..2c3d41a7a407 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..4dccbdb5cd3d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "value": { + "raw": "\\u{\\u{0}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..ae5fba46a8cd --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..ea93f11c4126 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..a37b45899de0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..22154057933d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "value": { + "raw": "\\u{110000}", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..ce27b82a7d1e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json deleted file mode 100644 index 27524e2b1f49..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:10)" -} 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 new file mode 100644 index 000000000000..81d9e807fc24 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expressions": [ + { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + }, + { + "type": "NumericLiteral", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "value": { + "raw": "left", + "cooked": "left" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "value": { + "raw": "\\1", + "cooked": null + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": { + "raw": "right", + "cooked": "right" + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json deleted file mode 100644 index fd4da953a419..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid escape sequence in template (1:2)" -} 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 new file mode 100644 index 000000000000..67d2c1d0b2d0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json @@ -0,0 +1,91 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "value": { + "raw": "\\xg", + "cooked": null + }, + "tail": true + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 382ffd0c6970..493880101c16 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,8 @@ { - "throws": "Classes may not have a field named 'constructor' (2:2)", - "plugins": ["jsx", "flow", "classProperties"] -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow", + "classProperties" + ] +} \ 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 new file mode 100644 index 000000000000..3d9ad56d93cd --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json @@ -0,0 +1,172 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 10, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 14, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "variance": null, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 27, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "params": [], + "rest": null, + "returnType": { + "type": "ThisTypeAnnotation", + "start": 33, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 25 + } + } + }, + "typeParameters": null + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/options.json b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/options.json deleted file mode 100644 index 9a7e0e3402af..000000000000 --- a/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unterminated flow-comment (1:13)" -} 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 new file mode 100644 index 000000000000..bd82aabe61e4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/comment/12-line-comment-nested-invalid/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "errors": [ + "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 + } + } + } + ] + }, + "comments": [ + { + "type": "CommentLine", + "value": "asd */", + "start": 5, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 13 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json deleted file mode 100644 index adfde3236356..000000000000 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "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)" -} 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 new file mode 100644 index 000000000000..43cb8ee092f2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json @@ -0,0 +1,214 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 87 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 87 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 87 + } + }, + "body": [ + { + "type": "DeclareModuleExports", + "start": 23, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 45, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 53 + } + } + } + } + }, + { + "type": "DeclareExportDeclaration", + "start": 55, + "end": 84, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 84 + } + }, + "declaration": { + "type": "DeclareVariable", + "start": 70, + "end": 84, + "loc": { + "start": { + "line": 1, + "column": 70 + }, + "end": { + "line": 1, + "column": 84 + } + }, + "id": { + "type": "Identifier", + "start": 74, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 74 + }, + "end": { + "line": 1, + "column": 83 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 75, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 75 + }, + "end": { + "line": 1, + "column": 83 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 77, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 77 + }, + "end": { + "line": 1, + "column": 83 + } + } + } + } + } + }, + "default": false + } + ] + }, + "kind": "ES" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/options.json deleted file mode 100644 index b40239a5609c..000000000000 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "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)" -} 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 new file mode 100644 index 000000000000..536157fab722 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json @@ -0,0 +1,214 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 86 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 86 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 86 + } + }, + "body": [ + { + "type": "DeclareExportDeclaration", + "start": 23, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "declaration": { + "type": "DeclareVariable", + "start": 38, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 51 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 43, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 43 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 45, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 51 + } + } + } + } + } + }, + "default": false + }, + { + "type": "DeclareModuleExports", + "start": 53, + "end": 84, + "loc": { + "start": { + "line": 1, + "column": 53 + }, + "end": { + "line": 1, + "column": 84 + } + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 75, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 75 + }, + "end": { + "line": 1, + "column": 83 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 77, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 77 + }, + "end": { + "line": 1, + "column": 83 + } + } + } + } + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/options.json deleted file mode 100644 index c237bb99a73b..000000000000 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Imports within a `declare module` body must always be `import type` or `import typeof` (1:21)" -} 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 new file mode 100644 index 000000000000..2d33b963c778 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json @@ -0,0 +1,161 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "extra": { + "rawValue": "M", + "raw": "\"M\"" + }, + "value": "M" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "body": [ + { + "type": "ImportDeclaration", + "start": 21, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "local": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "T" + }, + "name": "T" + } + } + ], + "importKind": "value", + "source": { + "type": "StringLiteral", + "start": 35, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "extra": { + "rawValue": "TM", + "raw": "\"TM\"" + }, + "value": "TM" + } + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/options.json deleted file mode 100644 index cd823bd7c4e0..000000000000 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "`declare module` cannot be used inside another `declare module` (1:27)" -} 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 new file mode 100644 index 000000000000..0a3fe70d8611 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json @@ -0,0 +1,137 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "A" + }, + "name": "A" + }, + "body": { + "type": "BlockStatement", + "start": 17, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "body": [ + { + "type": "DeclareModule", + "start": 19, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "B" + }, + "name": "B" + }, + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [] + }, + "kind": "CommonJS" + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json deleted file mode 100644 index 1520d766b062..000000000000 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Duplicate `declare module.exports` statement (1:55)" -} 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 new file mode 100644 index 000000000000..4339f6dbf5c6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json @@ -0,0 +1,181 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareModule", + "start": 0, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "id": { + "type": "StringLiteral", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "body": { + "type": "BlockStatement", + "start": 21, + "end": 88, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 88 + } + }, + "body": [ + { + "type": "DeclareModuleExports", + "start": 23, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 45, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 53 + } + } + } + } + }, + { + "type": "DeclareModuleExports", + "start": 55, + "end": 86, + "loc": { + "start": { + "line": 1, + "column": 55 + }, + "end": { + "line": 1, + "column": 86 + } + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 77, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 77 + }, + "end": { + "line": 1, + "column": 85 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 79, + "end": 85, + "loc": { + "start": { + "line": 1, + "column": 79 + }, + "end": { + "line": 1, + "column": 85 + } + } + } + } + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json index c9188366d4e8..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json @@ -1,5 +1,3 @@ { - "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Spread operator cannot appear in class or interface definitions (3:2)" + "sourceType": "module" } 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 new file mode 100644 index 000000000000..55a902eabcc2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/output.json @@ -0,0 +1,131 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Spread operator cannot appear in class or interface definitions (3:2)", + "SyntaxError: Explicit inexact syntax is only allowed inside inexact objects (4:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareClass", + "start": 8, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 24, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "callProperties": [], + "properties": [], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json index 658f8c434773..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json @@ -1,5 +1,3 @@ { - "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Spread operator cannot appear in class or interface definitions (4:2)" + "sourceType": "module" } 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 new file mode 100644 index 000000000000..606719c4d035 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/output.json @@ -0,0 +1,185 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Spread operator cannot appear in class or interface definitions (4:2)", + "SyntaxError: Explicit inexact syntax is only allowed inside inexact objects (5:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareClass", + "start": 8, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "B" + }, + "name": "B" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 24, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 28, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 13 + } + } + }, + "variance": null, + "optional": false + } + ], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json index c9188366d4e8..b2a58e3017eb 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json @@ -1,5 +1,5 @@ { "sourceType": "module", "plugins": ["jsx", "flow"], - "throws": "Spread operator cannot appear in class or interface definitions (3:2)" + "throws": "Explicit inexact syntax must appear at the end of an inexact object (4:2)" } diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json index 658f8c434773..efe48e962e0b 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json @@ -1,5 +1,5 @@ { "sourceType": "module", "plugins": ["jsx", "flow"], - "throws": "Spread operator cannot appear in class or interface definitions (4:2)" + "throws": "Explicit inexact syntax must appear at the end of an inexact object (5:2)" } diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json deleted file mode 100644 index 658f8c434773..000000000000 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Spread operator cannot appear in class or interface definitions (4:2)" -} 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 new file mode 100644 index 000000000000..03bb789a85bb --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/output.json @@ -0,0 +1,185 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Spread operator cannot appear in class or interface definitions (4:2)", + "SyntaxError: Explicit inexact syntax is only allowed inside inexact objects (5:0)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 8, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "F" + }, + "name": "F" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 20, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 13 + } + } + }, + "variance": null, + "optional": false + } + ], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json index c9188366d4e8..b2a58e3017eb 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json @@ -1,5 +1,5 @@ { "sourceType": "module", "plugins": ["jsx", "flow"], - "throws": "Spread operator cannot appear in class or interface definitions (3:2)" + "throws": "Explicit inexact syntax must appear at the end of an inexact object (4:2)" } diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json index 658f8c434773..efe48e962e0b 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json @@ -1,5 +1,5 @@ { "sourceType": "module", "plugins": ["jsx", "flow"], - "throws": "Spread operator cannot appear in class or interface definitions (4:2)" + "throws": "Explicit inexact syntax must appear at the end of an inexact object (5:2)" } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/options.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/options.json deleted file mode 100644 index b945b9a0a123..000000000000 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:10)" -} 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 new file mode 100644 index 000000000000..b4b12c31dccb --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json @@ -0,0 +1,94 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "string" + }, + "name": "string" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/options.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/options.json deleted file mode 100644 index 7aecee1ff0ae..000000000000 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:21)" -} 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 new file mode 100644 index 000000000000..1765354398c7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json @@ -0,0 +1,122 @@ +{ + "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:21)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "implements": [ + { + "type": "ClassImplements", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "string" + }, + "name": "string" + }, + "typeParameters": null + } + ], + "body": { + "type": "ClassBody", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/03/options.json b/packages/babel-parser/test/fixtures/flow/iterator/03/options.json deleted file mode 100644 index 7bad2fe143ae..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/03/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@asyncIterator (1:19)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/03/output.json b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json new file mode 100644 index 000000000000..cac241733955 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json @@ -0,0 +1,89 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@asyncIterator (1:19)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "@@asyncIterator" + }, + "name": "@@asyncIterator" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/04/options.json b/packages/babel-parser/test/fixtures/flow/iterator/04/options.json deleted file mode 100644 index ae3871cf99a0..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/04/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@iterator (1:14)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/04/output.json b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json new file mode 100644 index 000000000000..e86fe7ccc7a0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json @@ -0,0 +1,89 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@iterator (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "@@iterator" + }, + "name": "@@iterator" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/05/options.json b/packages/babel-parser/test/fixtures/flow/iterator/05/options.json deleted file mode 100644 index 9d235ec74a06..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/05/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@asyncIterator (2:17)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/05/output.json b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json new file mode 100644 index 000000000000..a5e29cf34dc2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@asyncIterator (2:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 33, + "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": "T" + }, + "name": "T" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "@@asyncIterator" + }, + "name": "@@asyncIterator" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/06/options.json b/packages/babel-parser/test/fixtures/flow/iterator/06/options.json deleted file mode 100644 index 515a2cba19f8..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/06/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@iterator (2:12)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/06/output.json b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json new file mode 100644 index 000000000000..08e5603a221c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json @@ -0,0 +1,144 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@iterator (2:12)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 28, + "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": "T" + }, + "name": "T" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "@@iterator" + }, + "name": "@@iterator" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/07/options.json b/packages/babel-parser/test/fixtures/flow/iterator/07/options.json deleted file mode 100644 index 4c1f323d1622..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/07/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@iterator (1:15)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/07/output.json b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json new file mode 100644 index 000000000000..60d612821347 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@iterator (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "@@iterator" + }, + "name": "@@iterator" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 18, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/08/options.json b/packages/babel-parser/test/fixtures/flow/iterator/08/options.json deleted file mode 100644 index 3efa2ffcd0a1..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/08/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@asyncIterator (1:20)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/08/output.json b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json new file mode 100644 index 000000000000..3994f46fa03e --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@asyncIterator (1:20)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "@@asyncIterator" + }, + "name": "@@asyncIterator" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 29 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/09/options.json b/packages/babel-parser/test/fixtures/flow/iterator/09/options.json deleted file mode 100644 index 515a2cba19f8..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/09/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@iterator (2:12)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/09/output.json b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json new file mode 100644 index 000000000000..95c09f5b7c60 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@iterator (2:12)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 12, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "@@iterator" + }, + "name": "@@iterator" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/10/options.json b/packages/babel-parser/test/fixtures/flow/iterator/10/options.json deleted file mode 100644 index 9d235ec74a06..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/10/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@asyncIterator (2:17)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/10/output.json b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json new file mode 100644 index 000000000000..9e58c564ebbf --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@asyncIterator (2:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 12, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 12, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "@@asyncIterator" + }, + "name": "@@asyncIterator" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/iterator/11/options.json b/packages/babel-parser/test/fixtures/flow/iterator/11/options.json deleted file mode 100644 index 248b8a4d9d0a..000000000000 --- a/packages/babel-parser/test/fixtures/flow/iterator/11/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid identifier @@random (2:10)" -} diff --git a/packages/babel-parser/test/fixtures/flow/iterator/11/output.json b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json new file mode 100644 index 000000000000..b43086a4226b --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json @@ -0,0 +1,161 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Invalid identifier @@random (2:10)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "@@random" + }, + "name": "@@random" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json index 06ad6ded6032..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json @@ -3,6 +3,5 @@ "plugins": [ "jsx", "flow" - ], - "throws": "Identifier 'C1' has already been declared (2:6)" + ] } \ 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 new file mode 100644 index 000000000000..c350f1ed1904 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json @@ -0,0 +1,143 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "C1" + }, + "name": "C1" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "ClassDeclaration", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "C1" + }, + "name": "C1" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json index 5672ce1b6444..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json @@ -3,6 +3,5 @@ "plugins": [ "jsx", "flow" - ], - "throws": "Identifier 'I' has already been declared (2:10)" + ] } \ No newline at end of file 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 new file mode 100644 index 000000000000..823ca9be9eac --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json @@ -0,0 +1,180 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "I" + }, + "name": "I" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "EmptyStatement", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + { + "type": "InterfaceDeclaration", + "start": 16, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "I" + }, + "name": "I" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "EmptyStatement", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json index 946261f4e872..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json @@ -3,6 +3,5 @@ "plugins": [ "jsx", "flow" - ], - "throws": "Identifier 'T1' has already been declared (2:5)" + ] } \ No newline at end of file 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 new file mode 100644 index 000000000000..080077918fd1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json @@ -0,0 +1,134 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "T1" + }, + "name": "T1" + }, + "typeParameters": null, + "right": { + "type": "StringTypeAnnotation", + "start": 10, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 16 + } + } + } + }, + { + "type": "TypeAlias", + "start": 18, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "T1" + }, + "name": "T1" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json deleted file mode 100644 index 65bc24a66fcd..000000000000 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "getter must not have any formal parameters (2:2)" -} 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 new file mode 100644 index 000000000000..efdc8832124e --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json @@ -0,0 +1,212 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "B" + }, + "name": "B" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 9, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 13, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "static": false, + "proto": false, + "kind": "get", + "method": true, + "value": { + "type": "FunctionTypeAnnotation", + "start": 13, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "params": [], + "rest": { + "type": "FunctionTypeParam", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "name": null, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + }, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 23 + } + } + } + }, + "optional": false + } + ], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/options.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/options.json deleted file mode 100644 index 65bc24a66fcd..000000000000 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "getter must not have any formal parameters (2:2)" -} 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 new file mode 100644 index 000000000000..66bd6ed1baf2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json @@ -0,0 +1,212 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "B" + }, + "name": "B" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 9, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 13, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "static": false, + "proto": false, + "kind": "get", + "method": true, + "value": { + "type": "FunctionTypeAnnotation", + "start": 13, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "params": [ + { + "type": "FunctionTypeParam", + "start": 19, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "name": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "optional": false, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 18 + } + } + } + } + ], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "NumberTypeAnnotation", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 27 + } + } + } + }, + "optional": false + } + ], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/options.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/options.json deleted file mode 100644 index 6a1567782202..000000000000 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "setter must have exactly one formal parameter (2:2)" -} 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 new file mode 100644 index 000000000000..b79f9a52c897 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "B" + }, + "name": "B" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 9, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "static": false, + "proto": false, + "kind": "set", + "method": true, + "value": { + "type": "FunctionTypeAnnotation", + "start": 13, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "params": [], + "rest": null, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + }, + "optional": false + } + ], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/options.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/options.json deleted file mode 100644 index 15ce6a4c5a51..000000000000 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "setter function argument must not be a rest parameter (2:2)" -} 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 new file mode 100644 index 000000000000..5171dbc8a45f --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json @@ -0,0 +1,212 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "B" + }, + "name": "B" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 9, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 13, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "key": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "static": false, + "proto": false, + "kind": "set", + "method": true, + "value": { + "type": "FunctionTypeAnnotation", + "start": 13, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "params": [], + "rest": { + "type": "FunctionTypeParam", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "name": null, + "optional": false, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "w" + }, + "name": "w" + } + } + }, + "typeParameters": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 26, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 19 + } + } + } + }, + "optional": false + } + ], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/options.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/options.json deleted file mode 100644 index 0c2cdd4d777c..000000000000 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:12)" -} 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 new file mode 100644 index 000000000000..bc568d5767be --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json @@ -0,0 +1,87 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "OpaqueType", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "string" + }, + "name": "string" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 27 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/optional-type/6/options.json b/packages/babel-parser/test/fixtures/flow/optional-type/6/options.json deleted file mode 100644 index fb2831d6188b..000000000000 --- a/packages/babel-parser/test/fixtures/flow/optional-type/6/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "A binding pattern parameter cannot be optional in an implementation signature. (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json b/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json new file mode 100644 index 000000000000..3ef0fdc07d93 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "errors": [ + "SyntaxError: A binding pattern parameter cannot be optional in an implementation signature. (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [], + "optional": true + }, + { + "type": "ObjectPattern", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [] + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/predicates/4/options.json b/packages/babel-parser/test/fixtures/flow/predicates/4/options.json deleted file mode 100644 index cec83fa54fba..000000000000 --- a/packages/babel-parser/test/fixtures/flow/predicates/4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:18)" -} diff --git a/packages/babel-parser/test/fixtures/flow/predicates/4/output.json b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json new file mode 100644 index 000000000000..e1e9eeffbc7b --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json @@ -0,0 +1,241 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "errors": [ + "SyntaxError: Spaces between ´%´ and ´checks´ are not allowed here. (1:20)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 54 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "f" + }, + "name": "f" + }, + "init": { + "type": "ArrowFunctionExpression", + "start": 8, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "predicate": { + "type": "InferredPredicate", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + } + }, + "returnType": null, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 10, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "typeAnnotation": { + "type": "MixedTypeAnnotation", + "start": 12, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + } + } + ], + "body": { + "type": "BinaryExpression", + "start": 32, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "left": { + "type": "UnaryExpression", + "start": 32, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "operator": "typeof", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 39 + }, + "end": { + "line": 1, + "column": 40 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "operator": "===", + "right": { + "type": "StringLiteral", + "start": 45, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 45 + }, + "end": { + "line": 1, + "column": 53 + } + }, + "extra": { + "rawValue": "string", + "raw": "\"string\"" + }, + "value": "string" + } + } + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/predicates/5/options.json b/packages/babel-parser/test/fixtures/flow/predicates/5/options.json deleted file mode 100644 index dbdc7697ac5b..000000000000 --- a/packages/babel-parser/test/fixtures/flow/predicates/5/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Spaces between ´%´ and ´checks´ are not allowed here. (1:17)" -} diff --git a/packages/babel-parser/test/fixtures/flow/predicates/5/output.json b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json new file mode 100644 index 000000000000..0d7a47afacfd --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json @@ -0,0 +1,210 @@ +{ + "type": "File", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Spaces between ´%´ and ´checks´ are not allowed here. (1:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "predicate": { + "type": "InferredPredicate", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + } + } + }, + "returnType": null, + "body": { + "type": "BlockStatement", + "start": 26, + "end": 61, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 30, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 37, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "left": { + "type": "UnaryExpression", + "start": 37, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "operator": "typeof", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "operator": "===", + "right": { + "type": "StringLiteral", + "start": 50, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "extra": { + "rawValue": "string", + "raw": "\"string\"" + }, + "value": "string" + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-ambiguous/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-ambiguous/options.json index 49dc6c3d5a6a..abfcf6f44eba 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-ambiguous/options.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-ambiguous/options.json @@ -1,3 +1,3 @@ { - "throws": "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate. (4:4)" + "throws": "Unexpected token, expected \":\" (4:27)" } diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/options.json deleted file mode 100644 index 215199590424..000000000000 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (2:11)" -} 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 new file mode 100644 index 000000000000..7f63927ff8ee --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json @@ -0,0 +1,234 @@ +{ + "type": "File", + "start": 0, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (2:11)", + "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 43, + "end": 67, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 43, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "test": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "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 + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "start": 53, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrowFunctionExpression", + "start": 54, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 54, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "c" + }, + "name": "c" + } + ], + "body": { + "type": "Identifier", + "start": 59, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "d" + }, + "name": "d" + } + } + ], + "body": { + "type": "Identifier", + "start": 65, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "e" + }, + "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": [] + }, + "comments": [ + { + "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 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/options.json deleted file mode 100644 index 36a678e0e538..000000000000 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (2:8)" -} 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 new file mode 100644 index 000000000000..329769ed64ff --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json @@ -0,0 +1,354 @@ +{ + "type": "File", + "start": 0, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (2:8)", + "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 83, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 47, + "end": 83, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 47, + "end": 82, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "test": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "consequent": { + "type": "ArrowFunctionExpression", + "start": 51, + "end": 73, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "predicate": null, + "returnType": { + "type": "TypeAnnotation", + "start": 63, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 65, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 65, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "d" + }, + "name": "d" + } + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrowFunctionExpression", + "start": 55, + "end": 61, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 55, + "end": 56, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "body": { + "type": "Identifier", + "start": 60, + "end": 61, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "c" + }, + "name": "c" + } + } + ], + "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 + } + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 51, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "name": "T", + "variance": null + } + ] + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "start": 76, + "end": 82, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 76, + "end": 77, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + }, + "identifierName": "f" + }, + "name": "f" + } + ], + "body": { + "type": "Identifier", + "start": 81, + "end": 82, + "loc": { + "start": { + "line": 2, + "column": 34 + }, + "end": { + "line": 2, + "column": 35 + }, + "identifierName": "g" + }, + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter after type parameters", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/options.json deleted file mode 100644 index 2fc0696df35a..000000000000 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (2:5)" -} 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 new file mode 100644 index 000000000000..32daf7d423fa --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json @@ -0,0 +1,271 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (2:5)", + "SyntaxError: Binding invalid left-hand side in function parameter list (2:5)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 47, + "end": 76, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 47, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "test": { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "consequent": { + "type": "ArrowFunctionExpression", + "start": 51, + "end": 66, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrowFunctionExpression", + "start": 52, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "body": { + "type": "Identifier", + "start": 57, + "end": 58, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "c" + }, + "name": "c" + } + } + ], + "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 + } + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "start": 69, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 69, + "end": 70, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "f" + }, + "name": "f" + } + ], + "body": { + "type": "Identifier", + "start": 74, + "end": 75, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 28 + }, + "identifierName": "g" + }, + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter after type parameters", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/options.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/options.json deleted file mode 100644 index 215199590424..000000000000 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Invalid left-hand side in arrow function parameters (2:11)" -} 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 new file mode 100644 index 000000000000..f7e58d708eb4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json @@ -0,0 +1,271 @@ +{ + "type": "File", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "errors": [ + "SyntaxError: Invalid left-hand side in arrow function parameters (2:11)", + "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 25, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 25, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "test": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "consequent": { + "type": "ArrowFunctionExpression", + "start": 29, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "ArrowFunctionExpression", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "b" + }, + "name": "b" + } + ], + "body": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "c" + }, + "name": "c" + } + } + ], + "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 + } + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "start": 53, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 34 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 53, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 29 + }, + "identifierName": "f" + }, + "name": "f" + } + ], + "body": { + "type": "Identifier", + "start": 58, + "end": 59, + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 34 + }, + "identifierName": "g" + }, + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Invalid LHS parameter", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json index 4a1b4e5c5cd4..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:14)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..a5fb057eb10c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json @@ -0,0 +1,164 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + }, + { + "type": "DeclareClass", + "start": 13, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json index 187fea591b95..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:18)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..93ec46f9bc31 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json @@ -0,0 +1,164 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + }, + { + "type": "DeclareInterface", + "start": 13, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json index 04242bd1565b..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:10)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..9de1cc4338cf --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json @@ -0,0 +1,164 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + }, + { + "type": "InterfaceDeclaration", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/options.json deleted file mode 100644 index 81dc2c90799f..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:12)" -} 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 new file mode 100644 index 000000000000..7b807528c3b9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + }, + { + "type": "OpaqueType", + "start": 13, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..a69cbb049a89 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json @@ -0,0 +1,162 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + }, + { + "type": "TypeAlias", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json index 187fea591b95..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:18)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..a5e92908c53a --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json @@ -0,0 +1,150 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "DeclareInterface", + "start": 19, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json index 4a1b4e5c5cd4..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:14)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..b2a4c51e2bc0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json @@ -0,0 +1,150 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareInterface", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "DeclareClass", + "start": 23, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json index b6ff3a4b0987..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:4)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..8389c568e814 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json @@ -0,0 +1,151 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareVariable", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "A" + }, + "name": "A", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + } + } + }, + { + "type": "VariableDeclaration", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json index 04242bd1565b..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:10)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..d79d846383cf --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json @@ -0,0 +1,150 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "InterfaceDeclaration", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json index 4a1b4e5c5cd4..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:14)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..2dbdc1e727c2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json @@ -0,0 +1,164 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + }, + { + "type": "DeclareClass", + "start": 11, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json index 187fea591b95..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:18)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..a13ba7dc082c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json @@ -0,0 +1,164 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + }, + { + "type": "DeclareInterface", + "start": 11, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json index 04242bd1565b..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:10)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..a8dc40e08d4c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json @@ -0,0 +1,164 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + }, + { + "type": "InterfaceDeclaration", + "start": 11, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/options.json deleted file mode 100644 index 81dc2c90799f..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:12)" -} 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 new file mode 100644 index 000000000000..07a5a53fbc08 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + }, + { + "type": "OpaqueType", + "start": 11, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..6833e37c4de1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json @@ -0,0 +1,162 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + }, + { + "type": "TypeAlias", + "start": 11, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/options.json deleted file mode 100644 index 336686170eb0..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:6)" -} 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 new file mode 100644 index 000000000000..b374e2bcebd9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "OpaqueType", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "VariableDeclaration", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/options.json deleted file mode 100644 index b6ff3a4b0987..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:4)" -} 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 new file mode 100644 index 000000000000..9f326dfe3e5e --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "OpaqueType", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "VariableDeclaration", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/options.json deleted file mode 100644 index 81dc2c90799f..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:12)" -} 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 new file mode 100644 index 000000000000..86b98af15006 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json @@ -0,0 +1,148 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "OpaqueType", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "OpaqueType", + "start": 20, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..76300249f569 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json @@ -0,0 +1,147 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "OpaqueType", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "TypeAlias", + "start": 20, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/options.json deleted file mode 100644 index b6ff3a4b0987..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:4)" -} 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 new file mode 100644 index 000000000000..b5b462a59cf5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "OpaqueType", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "VariableDeclaration", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/options.json deleted file mode 100644 index 336686170eb0..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:6)" -} 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 new file mode 100644 index 000000000000..916e60eaa94a --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json @@ -0,0 +1,162 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": "ObjectTypeAnnotation", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "VariableDeclaration", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 19, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json index 04242bd1565b..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:10)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..0aa57e51c3ff --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json @@ -0,0 +1,142 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "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": "NumberTypeAnnotation", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + }, + { + "type": "InterfaceDeclaration", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/options.json deleted file mode 100644 index b6ff3a4b0987..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:4)" -} 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 new file mode 100644 index 000000000000..6e394ffbcda1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json @@ -0,0 +1,162 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": "ObjectTypeAnnotation", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "VariableDeclaration", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/options.json deleted file mode 100644 index 81dc2c90799f..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:12)" -} 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 new file mode 100644 index 000000000000..95d0b22f7cfd --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json @@ -0,0 +1,147 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": "ObjectTypeAnnotation", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "OpaqueType", + "start": 13, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..09c73482f8f1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json @@ -0,0 +1,146 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": "ObjectTypeAnnotation", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "TypeAlias", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/options.json deleted file mode 100644 index b6ff3a4b0987..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:4)" -} 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 new file mode 100644 index 000000000000..52626b852e33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json @@ -0,0 +1,162 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": "ObjectTypeAnnotation", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + }, + { + "type": "VariableDeclaration", + "start": 13, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json index 187fea591b95..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:18)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..f60940e178bf --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json @@ -0,0 +1,164 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + { + "type": "DeclareInterface", + "start": 11, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json index 04242bd1565b..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json @@ -1,3 +1,7 @@ { - "throws": "Identifier 'A' has already been declared (2:10)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..271c66e47dd7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json @@ -0,0 +1,164 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + { + "type": "InterfaceDeclaration", + "start": 11, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/options.json deleted file mode 100644 index 81dc2c90799f..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:12)" -} 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 new file mode 100644 index 000000000000..d41f91a9d947 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json @@ -0,0 +1,163 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + { + "type": "OpaqueType", + "start": 11, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "supertype": null, + "impltype": { + "type": "ObjectTypeAnnotation", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..4f1dcc135976 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json @@ -0,0 +1,162 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "A" + }, + "name": "A" + }, + "init": { + "type": "NumericLiteral", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ], + "kind": "var" + }, + { + "type": "TypeAlias", + "start": 11, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/131/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/131/options.json deleted file mode 100644 index 50bea8a5db27..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/131/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type number (1:5)" -} 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 new file mode 100644 index 000000000000..ef2bc17e2d96 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json @@ -0,0 +1,86 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "number" + }, + "name": "number" + }, + "typeParameters": null, + "right": { + "type": "StringTypeAnnotation", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/132/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/132/options.json deleted file mode 100644 index 257d651b33e2..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/132/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type number (1:9)" -} 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 new file mode 100644 index 000000000000..aa2b8b19ecb0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json @@ -0,0 +1,119 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "errors": [ + "SyntaxError: Cannot overwrite reserved type number (1:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 8, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "name": "number", + "variance": null + } + ] + }, + "right": { + "type": "StringTypeAnnotation", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/133/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/133/options.json deleted file mode 100644 index 2c7a5836d8bc..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/133/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:11)" -} 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 new file mode 100644 index 000000000000..bb722c84feec --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json @@ -0,0 +1,236 @@ +{ + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Cannot overwrite reserved type string (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "generator": false, + "async": false, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "name": "string", + "variance": null + } + ] + }, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 28 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + } + } + } + } + ], + "predicate": null, + "returnType": { + "type": "TypeAnnotation", + "start": 29, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 37 + } + } + } + }, + "body": { + "type": "BlockStatement", + "start": 38, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 38 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "argument": { + "type": "Identifier", + "start": 49, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/134/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/134/options.json deleted file mode 100644 index 396a14ca22d4..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/134/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type bool (1:13)" -} 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 new file mode 100644 index 000000000000..c88abb4a585c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json @@ -0,0 +1,86 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareTypeAlias", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "bool" + }, + "name": "bool" + }, + "typeParameters": null, + "right": { + "type": "AnyTypeAnnotation", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/137/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/137/options.json deleted file mode 100644 index 786acad32af0..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/137/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Spread operator cannot appear in class or interface definitions (2:1)" -} 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 new file mode 100644 index 000000000000..2e33b31f6c8f --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json @@ -0,0 +1,140 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeSpreadProperty", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "argument": { + "type": "AnyTypeAnnotation", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + } + } + } + ], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "EmptyStatement", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 2 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/139/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/139/options.json deleted file mode 100644 index 2b0782bcbc3e..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/139/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Spread properties cannot have variance (3:1)" -} 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 new file mode 100644 index 000000000000..6d1756ac6212 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json @@ -0,0 +1,190 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "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": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [] + } + }, + { + "type": "TypeAlias", + "start": 11, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 4, + "column": 2 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "C" + }, + "name": "C" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeSpreadProperty", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 1 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "argument": { + "type": "GenericTypeAnnotation", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 5 + }, + "end": { + "line": 3, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + } + } + } + ], + "indexers": [], + "internalSlots": [], + "exact": false, + "inexact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/options.json deleted file mode 100644 index 24792311b3e9..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25` (1:20)" -} 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 new file mode 100644 index 000000000000..a08797bcf335 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json @@ -0,0 +1,173 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 11, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "left": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "right": { + "type": "StringLiteral", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "1", + "raw": "\"1\"" + }, + "value": "1" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 20, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 28 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + } + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/options.json deleted file mode 100644 index 7624c4d3b99a..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:14)" -} 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 new file mode 100644 index 000000000000..5ac98d7b46b7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "imported": { + "type": "Identifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "string" + }, + "name": "string" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "string" + }, + "name": "string" + } + } + ], + "importKind": "type", + "source": { + "type": "StringLiteral", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/options.json deleted file mode 100644 index 7624c4d3b99a..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:14)" -} 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 new file mode 100644 index 000000000000..3a1010d807fe --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json @@ -0,0 +1,108 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "local": { + "type": "Identifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "string" + }, + "name": "string" + } + } + ], + "importKind": "typeof", + "source": { + "type": "StringLiteral", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/options.json deleted file mode 100644 index d64a5d353bf8..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:19)" -} 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 new file mode 100644 index 000000000000..dcbca6978a12 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json @@ -0,0 +1,108 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "local": { + "type": "Identifier", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "string" + }, + "name": "string" + } + } + ], + "importKind": "typeof", + "source": { + "type": "StringLiteral", + "start": 31, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/options.json index 5133797973d2..3962be507d38 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/options.json @@ -1,3 +1,7 @@ { - "throws": "Unexpected keyword 'debugger' (1:17)" -} + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} \ No newline at end of file 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 new file mode 100644 index 000000000000..05cc09533a23 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json @@ -0,0 +1,126 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'debugger' (1:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "imported": { + "type": "Identifier", + "start": 9, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "type" + }, + "name": "type" + }, + "importKind": null, + "local": { + "type": "Identifier", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "debugger" + }, + "name": "debugger" + } + } + ], + "importKind": "value", + "source": { + "type": "StringLiteral", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json deleted file mode 100644 index 036229c5b95a..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "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)" -} 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 new file mode 100644 index 000000000000..90585f1b4f80 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 13, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "imported": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "t" + }, + "name": "t" + }, + "importKind": "type", + "local": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "t" + }, + "name": "t" + } + } + ], + "importKind": "type", + "source": { + "type": "StringLiteral", + "start": 26, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/options.json deleted file mode 100644 index e425b795f180..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:16)" -} 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 new file mode 100644 index 000000000000..4969f577a320 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "imported": { + "type": "Identifier", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "string" + }, + "name": "string" + }, + "importKind": "typeof", + "local": { + "type": "Identifier", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "string" + }, + "name": "string" + } + } + ], + "importKind": "value", + "source": { + "type": "StringLiteral", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/options.json deleted file mode 100644 index 7624c4d3b99a..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:14)" -} 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 new file mode 100644 index 000000000000..2b57e99a30e7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "imported": { + "type": "Identifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "string" + }, + "name": "string" + }, + "importKind": "type", + "local": { + "type": "Identifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "string" + }, + "name": "string" + } + } + ], + "importKind": "value", + "source": { + "type": "StringLiteral", + "start": 28, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json deleted file mode 100644 index 7aa4274c7160..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "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)" -} 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 new file mode 100644 index 000000000000..174e856304f7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "imported": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "t" + }, + "name": "t" + }, + "importKind": "typeof", + "local": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "t" + }, + "name": "t" + } + } + ], + "importKind": "typeof", + "source": { + "type": "StringLiteral", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/options.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/options.json deleted file mode 100644 index 0c2cdd4d777c..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Cannot overwrite reserved type string (1:12)" -} 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 new file mode 100644 index 000000000000..95872d960a5c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json @@ -0,0 +1,108 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "local": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "string" + }, + "name": "string" + } + } + ], + "importKind": "type", + "source": { + "type": "StringLiteral", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/options.json deleted file mode 100644 index 022607b81797..000000000000 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Type parameter declaration needs a default, since a preceding type parameter declaration has a default. (1:28)" -} diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json new file mode 100644 index 000000000000..b902d88e157e --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json @@ -0,0 +1,169 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "errors": [ + "SyntaxError: Type parameter declaration needs a default, since a preceding type parameter declaration has a default. (1:28)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 6, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 7, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "name": "HasDefault", + "variance": null, + "default": { + "type": "StringTypeAnnotation", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + } + } + }, + { + "type": "TypeParameter", + "start": 28, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "name": "NoDefault", + "variance": null + } + ] + }, + "right": { + "type": "GenericTypeAnnotation", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 42 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/options.json index f45196d78df9..a282a109bf16 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/options.json @@ -1,4 +1,7 @@ { - "throws": "Unexpected keyword 'delete' (1:14)", - "plugins": ["flow", "jsx"] -} + "sourceType": "module", + "plugins": [ + "flow", + "jsx" + ] +} \ 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 new file mode 100644 index 000000000000..a86c5b5aebde --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json @@ -0,0 +1,94 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'delete' (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareClass", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "delete" + }, + "name": "delete" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/options.json deleted file mode 100644 index 101e77f3861c..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "`_` is only allowed as a type argument to call or new (2:16)" -} 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 new file mode 100644 index 000000000000..297c8d177689 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_param_instantiation_otherwise/output.json @@ -0,0 +1,241 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 8, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 12, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 13, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 15, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "typeParameters": { + "type": "TypeParameterInstantiation", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "params": [ + { + "type": "GenericTypeAnnotation", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "_" + }, + "name": "_" + } + } + ] + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "Generic" + }, + "name": "Generic" + } + } + } + }, + "init": { + "type": "NumericLiteral", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "extra": { + "rawValue": 3, + "raw": "3" + }, + "value": 3 + } + } + ], + "kind": "var", + "leadingComments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json index 85a0456eceff..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Cannot overwrite reserved type _ (2:5)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..53ac01f6fe9a --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "_" + }, + "name": "_" + }, + "typeParameters": null, + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/options.json deleted file mode 100644 index 872ad2f73408..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Cannot overwrite reserved type _ (2:13)" -} 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 new file mode 100644 index 000000000000..e89da7ec21b6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_param_name/output.json @@ -0,0 +1,174 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Cannot overwrite reserved type _ (2:13)", + "SyntaxError: `_` is only allowed as a type argument to call or new (2:19)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 8, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "Generic" + }, + "name": "Generic" + }, + "typeParameters": { + "type": "TypeParameterDeclaration", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "params": [ + { + "type": "TypeParameter", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "name": "_", + "variance": null + } + ] + }, + "right": { + "type": "GenericTypeAnnotation", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/options.json deleted file mode 100644 index e4012a53ad5d..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The type cast expression is expected to be wrapped with parenthesis (1:10)" -} 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 new file mode 100644 index 000000000000..098b44cec651 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json @@ -0,0 +1,149 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "funccall" + }, + "name": "funccall" + }, + "arguments": [ + { + "type": "TypeCastExpression", + "start": 9, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "expression": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "b" + }, + "name": "b" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 10, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/options.json deleted file mode 100644 index 3f861de320eb..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The type cast expression is expected to be wrapped with parenthesis (1:13)" -} 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 new file mode 100644 index 000000000000..6b5b957074e0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json @@ -0,0 +1,166 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "funccall" + }, + "name": "funccall" + }, + "arguments": [ + { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "TypeCastExpression", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "b" + }, + "name": "b" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/options.json deleted file mode 100644 index 847e987ef0af..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The type cast expression is expected to be wrapped with parenthesis (1:5)" -} 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 new file mode 100644 index 000000000000..0e18e29a41ea --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-without-parens/output.json @@ -0,0 +1,171 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "SequenceExpression", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "A" + }, + "name": "A" + }, + { + "type": "TypeCastExpression", + "start": 4, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "B" + }, + "name": "B" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json deleted file mode 100644 index 18cdf0d35e40..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The type cast expression is expected to be wrapped with parenthesis (1:2)" -} 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 new file mode 100644 index 000000000000..8170ccf4c8d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "elements": [ + { + "type": "TypeCastExpression", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "expression": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 2, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 4, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 10 + } + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json deleted file mode 100644 index 624681c0d415..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The type cast expression is expected to be wrapped with parenthesis (1:3)" -} 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 new file mode 100644 index 000000000000..c5ba396b8101 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-2/output.json @@ -0,0 +1,136 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 1, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "elements": [ + { + "type": "TypeCastExpression", + "start": 2, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 3, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + } + } + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json deleted file mode 100644 index 7f8da08031af..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The type cast expression is expected to be wrapped with parenthesis (1:7)" -} 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 new file mode 100644 index 000000000000..d8bfbe9b1216 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-3/output.json @@ -0,0 +1,170 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "ArrayExpression", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ArrayExpression", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [ + { + "type": "TypeCastExpression", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + } + } + ] + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json deleted file mode 100644 index 23c75013dad4..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The type cast expression is expected to be wrapped with parenthesis (1:9)" -} 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 new file mode 100644 index 000000000000..517f9d043755 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json @@ -0,0 +1,166 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "async" + }, + "name": "async" + }, + "arguments": [ + { + "type": "ArrayExpression", + "start": 7, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "TypeCastExpression", + "start": 8, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 9, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 11, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 17 + } + } + } + } + } + ] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json deleted file mode 100644 index 3f861de320eb..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "The type cast expression is expected to be wrapped with parenthesis (1:13)" -} 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 new file mode 100644 index 000000000000..5ae330ce23f7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json @@ -0,0 +1,200 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "async" + }, + "name": "async" + }, + "arguments": [ + { + "type": "ArrayExpression", + "start": 7, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "ArrayExpression", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "elements": [ + { + "type": "TypeCastExpression", + "start": 12, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "b" + }, + "name": "b" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 13, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 15, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 21 + } + } + } + } + } + ] + } + ] + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/options.json b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/options.json deleted file mode 100644 index d5960e11a308..000000000000 --- a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "JSX attributes must only be assigned a non-empty expression (1:9)" -} 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 new file mode 100644 index 000000000000..a58504569cb5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json @@ -0,0 +1,165 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "JSXElement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "foo" + }, + "attributes": [ + { + "type": "JSXAttribute", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": "bar" + }, + "value": { + "type": "JSXExpressionContainer", + "start": 9, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "JSXEmptyExpression", + "start": 10, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 10 + } + } + } + } + } + ], + "selfClosing": true + }, + "closingElement": null, + "children": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/options.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/options.json deleted file mode 100644 index 4ca478c5b41f..000000000000 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected corresponding JSX closing tag for <> (1:2)" -} 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 new file mode 100644 index 000000000000..8a88583570c3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json @@ -0,0 +1,115 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "JSXFragment", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "openingFragment": { + "type": "JSXOpeningFragment", + "start": 0, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 2 + } + } + }, + "closingFragment": { + "type": "JSXClosingElement", + "start": 2, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 4, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": "something" + } + }, + "children": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/options.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/options.json deleted file mode 100644 index 25d9465b06be..000000000000 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected corresponding JSX closing tag for (1:11)" -} 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 new file mode 100644 index 000000000000..63350c9eb5d8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json @@ -0,0 +1,117 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "JSXElement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "something" + }, + "attributes": [], + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingFragment", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + "children": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/options.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/options.json index a307a35df63e..92404e501295 100644 --- a/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/options.json +++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/options.json @@ -1,4 +1,3 @@ { - "plugins": ["placeholders"], - "throws": "Unexpected space in placeholder. (1:5)" + "plugins": ["placeholders"] } diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json new file mode 100644 index 000000000000..4d13018c3020 --- /dev/null +++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json @@ -0,0 +1,71 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: Unexpected space in placeholder. (1:5)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "Placeholder", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": { + "type": "Identifier", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "FOO" + }, + "name": "FOO" + }, + "expectedNode": "Statement" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/options.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/options.json index 2d76cfab7e2f..92404e501295 100644 --- a/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/options.json +++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/options.json @@ -1,4 +1,3 @@ { - "plugins": ["placeholders"], - "throws": "Unexpected space in placeholder. (1:2)" + "plugins": ["placeholders"] } diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json new file mode 100644 index 000000000000..0bd5ffb6bd40 --- /dev/null +++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json @@ -0,0 +1,71 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: Unexpected space in placeholder. (1:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "Placeholder", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "name": { + "type": "Identifier", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "FOO" + }, + "name": "FOO" + }, + "expectedNode": "Statement" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/options.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/options.json deleted file mode 100644 index 69d91502496d..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected type cast in parameter position. (1:7)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json new file mode 100644 index 000000000000..84bb9f048205 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Unexpected type cast in parameter position. (1:7)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "TSAsExpression", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "expression": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "typeName": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/options.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/options.json deleted file mode 100644 index 69d91502496d..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected type cast in parameter position. (1:7)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json new file mode 100644 index 000000000000..5825bdc4db33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Unexpected type cast in parameter position. (1:7)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "TSTypeAssertion", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "typeName": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "T" + }, + "name": "T" + } + }, + "expression": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/options.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/options.json deleted file mode 100644 index b5bdba868c9f..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected type cast in parameter position. (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json new file mode 100644 index 000000000000..369ec9d0eb08 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "errors": [ + "SyntaxError: Unexpected type cast in parameter position. (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "TSAsExpression", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "typeName": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/options.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/options.json deleted file mode 100644 index b5bdba868c9f..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected type cast in parameter position. (1:1)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json new file mode 100644 index 000000000000..52cb7ee9d5a9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "errors": [ + "SyntaxError: Unexpected type cast in parameter position. (1:1)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "TSTypeAssertion", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + } + }, + "typeName": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "T" + }, + "name": "T" + } + }, + "expression": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json b/packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json deleted file mode 100644 index 3de0ab8596c4..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/class/extends-empty/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'extends' list cannot be empty. (1:22)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json new file mode 100644 index 000000000000..0fe556a129e5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "errors": [ + "SyntaxError: 'extends' list cannot be empty. (1:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "extends": [], + "body": { + "type": "TSInterfaceBody", + "start": 22, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json b/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json deleted file mode 100644 index 950506446835..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'implements' list cannot be empty. (1:33)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json new file mode 100644 index 000000000000..a84755dbbeb5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json @@ -0,0 +1,104 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "errors": [ + "SyntaxError: 'implements' list cannot be empty. (1:33)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "Bar" + }, + "name": "Bar" + }, + "implements": [], + "body": { + "type": "ClassBody", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json b/packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json deleted file mode 100644 index 6751fbcc5443..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/class/implements-empty/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "'implements' list cannot be empty. (1:21)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json new file mode 100644 index 000000000000..bcf3445883b0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json @@ -0,0 +1,88 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "errors": [ + "SyntaxError: 'implements' list cannot be empty. (1:21)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "superClass": null, + "implements": [], + "body": { + "type": "ClassBody", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/options.json b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/options.json deleted file mode 100644 index b84b0421721a..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "A parameter property may not be declared using a binding pattern. (2:16)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json new file mode 100644 index 000000000000..9436fb7283a9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json @@ -0,0 +1,177 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: A parameter property may not be declared using a binding pattern. (2:16)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 41, + "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": 41, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 14, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "constructor" + }, + "name": "constructor" + }, + "computed": false, + "kind": "constructor", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "TSParameterProperty", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "accessibility": "public", + "parameter": { + "type": "ArrayPattern", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "elements": [] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/options.json b/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/options.json deleted file mode 100644 index fb2831d6188b..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "A binding pattern parameter cannot be optional in an implementation signature. (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json new file mode 100644 index 000000000000..3ef0fdc07d93 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "errors": [ + "SyntaxError: A binding pattern parameter cannot be optional in an implementation signature. (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "ArrayPattern", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [], + "optional": true + }, + { + "type": "ObjectPattern", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "properties": [] + } + ], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/options.json deleted file mode 100644 index 336686170eb0..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:6)" -} 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 new file mode 100644 index 000000000000..5642df62a53c --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json @@ -0,0 +1,136 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "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": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [] + } + }, + { + "type": "ClassDeclaration", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..6d6bbe962695 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json @@ -0,0 +1,120 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "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": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [] + } + }, + { + "type": "TSEnumDeclaration", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "members": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..c6886d19470d --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json @@ -0,0 +1,134 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "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": 10, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "body": [] + } + }, + { + "type": "TSTypeAliasDeclaration", + "start": 11, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/options.json deleted file mode 100644 index ee82975e59a3..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'X' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..b6b67ebef96c --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json @@ -0,0 +1,105 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSEnumDeclaration", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "const": true, + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "X" + }, + "name": "X" + }, + "members": [] + }, + { + "type": "TSEnumDeclaration", + "start": 16, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "X" + }, + "name": "X" + }, + "members": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/options.json deleted file mode 100644 index 69462b29a995..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'X' has already been declared (2:6)" -} 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 new file mode 100644 index 000000000000..8518fac0e7e9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json @@ -0,0 +1,120 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSEnumDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "X" + }, + "name": "X" + }, + "members": [] + }, + { + "type": "ClassDeclaration", + "start": 10, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "X" + }, + "name": "X" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 18, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/options.json deleted file mode 100644 index c77fcb7927ac..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'X' has already been declared (2:11)" -} 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 new file mode 100644 index 000000000000..8a9778e36851 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json @@ -0,0 +1,105 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSEnumDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "X" + }, + "name": "X" + }, + "members": [] + }, + { + "type": "TSEnumDeclaration", + "start": 10, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "const": true, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "X" + }, + "name": "X" + }, + "members": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/options.json deleted file mode 100644 index ee47ddce75a8..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'Foo' has already been declared (2:9)" -} 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 new file mode 100644 index 000000000000..ab31065f580b --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json @@ -0,0 +1,123 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSEnumDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "members": [] + }, + { + "type": "FunctionDeclaration", + "start": 12, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/options.json deleted file mode 100644 index a5f623f4e212..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'X' has already been declared (2:10)" -} 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 new file mode 100644 index 000000000000..80905a927dc9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json @@ -0,0 +1,119 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSEnumDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "X" + }, + "name": "X" + }, + "members": [] + }, + { + "type": "TSInterfaceDeclaration", + "start": 10, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "X" + }, + "name": "X" + }, + "body": { + "type": "TSInterfaceBody", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/options.json deleted file mode 100644 index 4172f917bdb1..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'Foo' has already been declared (2:4)" -} 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 new file mode 100644 index 000000000000..4f8b4783578a --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSEnumDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "members": [] + }, + { + "type": "VariableDeclaration", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/options.json deleted file mode 100644 index ee82975e59a3..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'X' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..e347d9e0a548 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json @@ -0,0 +1,118 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSEnumDeclaration", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "X" + }, + "name": "X" + }, + "members": [] + }, + { + "type": "TSTypeAliasDeclaration", + "start": 10, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "X" + }, + "name": "X" + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/options.json deleted file mode 100644 index 4172f917bdb1..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'Foo' has already been declared (2:4)" -} 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 new file mode 100644 index 000000000000..4f8b4783578a --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSEnumDeclaration", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "members": [] + }, + { + "type": "VariableDeclaration", + "start": 12, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/options.json deleted file mode 100644 index 92349410e8cf..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'Foo' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..c8a1a8f8dc65 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json @@ -0,0 +1,123 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "TSEnumDeclaration", + "start": 18, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "members": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/options.json deleted file mode 100644 index ee82975e59a3..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'X' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..63b26bca4458 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json @@ -0,0 +1,119 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "X" + }, + "name": "X" + }, + "body": { + "type": "TSInterfaceBody", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [] + } + }, + { + "type": "TSEnumDeclaration", + "start": 15, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "X" + }, + "name": "X" + }, + "members": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/options.json deleted file mode 100644 index 92349410e8cf..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'Foo' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..1c1cfb5c1696 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "TSEnumDeclaration", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "members": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/options.json deleted file mode 100644 index 336686170eb0..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:6)" -} 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 new file mode 100644 index 000000000000..3e63a0f7f298 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json @@ -0,0 +1,134 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + }, + { + "type": "ClassDeclaration", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..ba27b683a4b7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json @@ -0,0 +1,118 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + }, + { + "type": "TSEnumDeclaration", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "members": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/options.json deleted file mode 100644 index 04242bd1565b..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:10)" -} 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 new file mode 100644 index 000000000000..4983be36642d --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json @@ -0,0 +1,133 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + }, + { + "type": "TSInterfaceDeclaration", + "start": 17, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "body": { + "type": "TSInterfaceBody", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/options.json deleted file mode 100644 index 1eed93f49a0e..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..02fde75620f0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json @@ -0,0 +1,132 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 9, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + }, + { + "type": "TSTypeAliasDeclaration", + "start": 17, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/options.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/options.json deleted file mode 100644 index 92349410e8cf..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'Foo' has already been declared (2:5)" -} 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 new file mode 100644 index 000000000000..1c1cfb5c1696 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json @@ -0,0 +1,122 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "init": null + } + ], + "kind": "let" + }, + { + "type": "TSEnumDeclaration", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "members": [] + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/options.json b/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/options.json deleted file mode 100644 index 856a8477d1ca..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["typescript"], - "throws": "Template literal types cannot have any substitution (1:14)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json new file mode 100644 index 000000000000..ee3c9e5da012 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json @@ -0,0 +1,195 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "errors": [ + "SyntaxError: Template literal types cannot have any substitution (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 5, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "typeAnnotation": { + "type": "TSLiteralType", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "literal": { + "type": "TemplateLiteral", + "start": 7, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expressions": [ + { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "bar" + }, + "name": "bar" + } + ], + "quasis": [ + { + "type": "TemplateElement", + "start": 8, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": { + "raw": "foo-", + "cooked": "foo-" + }, + "tail": false + }, + { + "type": "TemplateElement", + "start": 18, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "value": { + "raw": "", + "cooked": "" + }, + "tail": true + } + ] + } + } + } + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-1/options.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-1/options.json deleted file mode 100644 index 0a91d0015278..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/read-only-1/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["typescript"], - "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json new file mode 100644 index 000000000000..ced722e79dd3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json @@ -0,0 +1,137 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "errors": [ + "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "T30" + }, + "name": "T30" + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start": 11, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "operator": "readonly", + "typeAnnotation": { + "type": "TSStringKeyword", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 26 + } + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start": 29, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 37 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Error", + "start": 29, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 37 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-2/options.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-2/options.json deleted file mode 100644 index 0a91d0015278..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/read-only-2/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["typescript"], - "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json new file mode 100644 index 000000000000..73c4d7d4cd3f --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "errors": [ + "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "T31" + }, + "name": "T31" + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start": 11, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "operator": "readonly", + "typeAnnotation": { + "type": "TSTypeReference", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "typeName": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 32 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Error", + "start": 24, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 32 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-3/options.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-3/options.json deleted file mode 100644 index 0a91d0015278..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/read-only-3/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["typescript"], - "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json new file mode 100644 index 000000000000..8a977f1e3987 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json @@ -0,0 +1,168 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "errors": [ + "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "T32" + }, + "name": "T32" + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start": 11, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "operator": "readonly", + "typeAnnotation": { + "type": "TSTypeOperator", + "start": 20, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "operator": "readonly", + "typeAnnotation": { + "type": "TSArrayType", + "start": 29, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "elementType": { + "type": "TSStringKeyword", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 35 + } + } + } + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start": 40, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 48 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Error", + "start": 40, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 48 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-4/options.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-4/options.json deleted file mode 100644 index 0a91d0015278..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/read-only-4/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["typescript"], - "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json new file mode 100644 index 000000000000..0e0dd2eb9f49 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json @@ -0,0 +1,186 @@ +{ + "type": "File", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "errors": [ + "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 34 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "T33" + }, + "name": "T33" + }, + "typeAnnotation": { + "type": "TSTypeOperator", + "start": 11, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "operator": "readonly", + "typeAnnotation": { + "type": "TSTypeReference", + "start": 20, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "typeName": { + "type": "Identifier", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + }, + "identifierName": "Array" + }, + "name": "Array" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start": 25, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 33 + } + }, + "params": [ + { + "type": "TSStringKeyword", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } + } + } + ] + } + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Error", + "start": 36, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 44 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " Error", + "start": 36, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 44 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/options.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/options.json deleted file mode 100644 index 15111b29065f..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/options.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["typescript"], - "throws": "A required element cannot follow an optional element. (1:17)" -} diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json new file mode 100644 index 000000000000..b66ac1ec7326 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json @@ -0,0 +1,166 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "errors": [ + "SyntaxError: A required element cannot follow an optional element. (1:17)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 5, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "typeAnnotation": { + "type": "TSTupleType", + "start": 7, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "elementTypes": [ + { + "type": "TSOptionalType", + "start": 8, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + } + } + }, + { + "type": "TSNumberKeyword", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + ] + } + } + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json b/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json index 57893e4eee56..c4c1edaca3c6 100644 --- a/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json +++ b/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json @@ -1,3 +1,3 @@ { - "throws": "Complex binding patterns require an initialization value (1:6)" + "throws": "Unexpected token, expected \";\" (1:6)" } From 43cfec4c0597b1dedf8752c79883fa066d12b73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 1 Sep 2019 01:56:01 +0200 Subject: [PATCH 05/29] Fix tests out of @babel/parser --- packages/babel-core/test/fixtures/parse/output.json | 1 + .../test/fixtures/jsx-compat/ts-invalid/options.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/babel-core/test/fixtures/parse/output.json b/packages/babel-core/test/fixtures/parse/output.json index 06fb684869dc..5c48f0e09836 100644 --- a/packages/babel-core/test/fixtures/parse/output.json +++ b/packages/babel-core/test/fixtures/parse/output.json @@ -2,6 +2,7 @@ "type": "File", "start": 0, "end": 91, + "errors": [], "loc": { "start": { "line": 1, diff --git a/packages/babel-preset-typescript/test/fixtures/jsx-compat/ts-invalid/options.json b/packages/babel-preset-typescript/test/fixtures/jsx-compat/ts-invalid/options.json index 4c0aa124656f..c11cb6fdfbdf 100644 --- a/packages/babel-preset-typescript/test/fixtures/jsx-compat/ts-invalid/options.json +++ b/packages/babel-preset-typescript/test/fixtures/jsx-compat/ts-invalid/options.json @@ -1,3 +1,3 @@ { - "throws": "Unexpected token, expected \"/<=/>=\" (1:6)" + "throws": "Unexpected token, expected \",\" (1:6)" } From ea3c4e45bcdda13933875cc0b837fb43a85fb727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 22 Aug 2019 15:19:59 +0200 Subject: [PATCH 06/29] Do not use try/catch for control flow --- packages/babel-parser/src/parser/location.js | 4 +- packages/babel-parser/src/parser/util.js | 63 +++++ packages/babel-parser/src/plugins/flow.js | 235 ++++++++++-------- .../babel-parser/src/plugins/jsx/index.js | 12 +- .../src/plugins/typescript/index.js | 168 +++++++------ packages/babel-parser/src/tokenizer/state.js | 2 +- .../jsx/errors/adjacent-tags/options.json | 3 - .../jsx/errors/adjacent-tags/output.json | 189 ++++++++++++++ .../jsx/errors/wrong-closing-tag/options.json | 3 - .../jsx/errors/wrong-closing-tag/output.json | 133 ++++++++++ 10 files changed, 619 insertions(+), 193 deletions(-) delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/options.json create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json diff --git a/packages/babel-parser/src/parser/location.js b/packages/babel-parser/src/parser/location.js index d3a0bf47c244..3694a567090a 100644 --- a/packages/babel-parser/src/parser/location.js +++ b/packages/babel-parser/src/parser/location.js @@ -10,6 +10,8 @@ import CommentsParser from "./comments"; // message. export default class LocationParser extends CommentsParser { + +isLookahead: boolean; + getLocationForPosition(pos: number): Position { let loc; if (pos === this.state.start) loc = this.state.startLoc; @@ -49,7 +51,7 @@ export default class LocationParser extends CommentsParser { } if (this.options.errorRecovery) { - this.state.errors.push(err); + if (!this.isLookahead) this.state.errors.push(err); return err; } else { throw err; diff --git a/packages/babel-parser/src/parser/util.js b/packages/babel-parser/src/parser/util.js index d66671551ee2..f1093f31b57f 100644 --- a/packages/babel-parser/src/parser/util.js +++ b/packages/babel-parser/src/parser/util.js @@ -2,6 +2,7 @@ import { types as tt, type TokenType } from "../tokenizer/types"; import Tokenizer from "../tokenizer"; +import State from "../tokenizer/state"; import type { Node } from "../types"; import { lineBreak, skipWhiteSpace } from "../util/whitespace"; import { isIdentifierChar } from "../util/identifier"; @@ -9,6 +10,14 @@ import * as charCodes from "charcodes"; const literal = /^('|")((?:\\?.)*?)\1/; +type TryParse = { + node: Node, + error: Error, + thrown: Thrown, + aborted: Aborted, + failState: FailState, +}; + // ## Parser utilities export default class UtilParser extends Tokenizer { @@ -215,4 +224,58 @@ export default class UtilParser extends Tokenizer { return false; } + + // tryParse will clone parser state. + // It is expensive and should be used with cautions + tryParse>( + fn: (abort: (node?: T) => empty) => T, + oldState: State = this.state.clone(), + ): + | TryParse + | TryParse + | TryParse { + const abortSignal: { node: T | null } = { node: null }; + try { + const node = fn((node = null) => { + abortSignal.node = node; + throw abortSignal; + }); + if (this.state.errors.length > oldState.errors.length) { + const failState = this.state; + this.state = oldState; + return { + node, + error: (failState.errors[oldState.errors.length]: SyntaxError), + thrown: false, + aborted: false, + failState, + }; + } + + return { + node, + error: null, + thrown: false, + aborted: false, + failState: null, + }; + } catch (error) { + const failState = this.state; + this.state = oldState; + if (error instanceof SyntaxError) { + return { node: null, error, thrown: true, aborted: false, failState }; + } + if (error === abortSignal) { + return { + node: abortSignal.node, + error: null, + thrown: false, + aborted: true, + failState, + }; + } + + throw error; + } + } } diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 2cd3983020d6..1e497633ad1c 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -1,5 +1,7 @@ // @flow +/*:: declare var invariant; */ + import type Parser from "../parser"; import { types as tt, type TokenType } from "../tokenizer/types"; import * as N from "../types"; @@ -1722,20 +1724,20 @@ export default (superClass: Class): Class => // only use the expensive "tryParse" method if there is a question mark // and if we come from inside parens if (refNeedsArrowPos) { - const state = this.state.clone(); - try { - return super.parseConditional(expr, noIn, startPos, startLoc); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - refNeedsArrowPos.start = err.pos || this.state.start; - return expr; - } else { - // istanbul ignore next: no such error is expected - throw err; - } + const result = this.tryParse(() => + super.parseConditional(expr, noIn, startPos, startLoc), + ); + + if (!result.node) { + // $FlowIgnore + refNeedsArrowPos.start = result.error.pos || this.state.start; + return expr; } + + if (result.error) this.state = result.failState; + return result.node; } + this.expect(tt.question); const state = this.state.clone(); const originalNoArrowAt = this.state.noArrowAt; @@ -1860,17 +1862,15 @@ export default (superClass: Class): Class => } return partition(arrows, node => { - try { + const result = this.tryParse(() => this.toAssignableList( ((node.params: any): N.Expression[]), true, "arrow function parameters", node.extra?.trailingComma, - ); - return true; - } catch (err) { - return false; - } + ), + ); + return !result.error; }); } @@ -2532,45 +2532,50 @@ export default (superClass: Class): Class => afterLeftParse?: Function, refNeedsArrowPos?: ?Pos, ): N.Expression { - let jsxError = null; + let state = null; + + let jsx; + if ( this.hasPlugin("jsx") && (this.match(tt.jsxTagStart) || this.isRelational("<")) ) { - const state = this.state.clone(); - try { - return super.parseMaybeAssign( - noIn, - refShorthandDefaultPos, - afterLeftParse, - refNeedsArrowPos, - ); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - - // Remove `tc.j_expr` and `tc.j_oTag` from context added - // by parsing `jsxTagStart` to stop the JSX plugin from - // messing with the tokens - const cLength = this.state.context.length; - if (this.state.context[cLength - 1] === tc.j_oTag) { - this.state.context.length -= 2; - } + state = this.state.clone(); + + jsx = this.tryParse( + () => + super.parseMaybeAssign( + noIn, + refShorthandDefaultPos, + afterLeftParse, + refNeedsArrowPos, + ), + state, + ); + /*:: invariant(!jsx.aborted) */ - jsxError = err; - } else { - // istanbul ignore next: no such error is expected - throw err; - } + if (!jsx.error) return jsx.node; + + // Remove `tc.j_expr` and `tc.j_oTag` from context added + // by parsing `jsxTagStart` to stop the JSX plugin from + // messing with the tokens + const { context } = this.state; + if (context[context.length - 1] === tc.j_oTag) { + context.length -= 2; + } else if (context[context.length - 1] === tc.j_expr) { + context.length -= 1; } } - if (jsxError != null || this.isRelational("<")) { - let arrowExpression; + if ((jsx && jsx.error) || this.isRelational("<")) { + state = state || this.state.clone(); + let typeParameters; - try { + + const arrow = this.tryParse(() => { typeParameters = this.flowParseTypeParameterDeclaration(); - arrowExpression = this.forwardNoArrowParamsConversionAt( + + const arrowExpression = this.forwardNoArrowParamsConversionAt( typeParameters, () => super.parseMaybeAssign( @@ -2582,20 +2587,43 @@ export default (superClass: Class): Class => ); arrowExpression.typeParameters = typeParameters; this.resetStartLocationFromNode(arrowExpression, typeParameters); - } catch (err) { - throw jsxError || err; + + return arrowExpression; + }, state); + + const arrowExpression: ?N.ArrowFunctionExpression = + arrow.node && arrow.node.type === "ArrowFunctionExpression" + ? arrow.node + : null; + + if (!arrow.error && arrowExpression) return arrowExpression; + + // If we are here, both JSX and Flow parsing attemps failed. + // Give the precedence to the JSX error, except if JSX had an + // unrecoverable error while Flow didn't. + // If the error is recoverable, we can only re-report it if there is + // a node we can return. + + if (jsx && jsx.node) { + /*:: invariant(jsx.failState) */ + this.state = jsx.failState; + return jsx.node; } - if (arrowExpression.type === "ArrowFunctionExpression") { + if (arrowExpression) { + /*:: invariant(arrow.failState) */ + this.state = arrow.failState; return arrowExpression; - } else if (jsxError != null) { - throw jsxError; - } else { - throw this.raise( - typeParameters.start, - "Expected an arrow function after this type parameter declaration", - ); } + + if (jsx && jsx.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + + /*:: invariant(typeParameters) */ + throw this.raise( + typeParameters.start, + "Expected an arrow function after this type parameter declaration", + ); } return super.parseMaybeAssign( @@ -2609,8 +2637,7 @@ export default (superClass: Class): Class => // handle return types for arrow functions parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression { if (this.match(tt.colon)) { - const state = this.state.clone(); - try { + const result = this.tryParse(() => { const oldNoAnonFunctionType = this.state.noAnonFunctionType; this.state.noAnonFunctionType = true; @@ -2628,18 +2655,18 @@ export default (superClass: Class): Class => if (this.canInsertSemicolon()) this.unexpected(); if (!this.match(tt.arrow)) this.unexpected(); - // assign after it is clear it is an arrow - node.returnType = typeNode.typeAnnotation - ? this.finishNode(typeNode, "TypeAnnotation") - : null; - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - } else { - // istanbul ignore next: no such error is expected - throw err; - } - } + return typeNode; + }); + + if (result.thrown) return null; + /*:: invariant(result.node) */ + + if (result.error) this.state = result.failState; + + // assign after it is clear it is an arrow + node.returnType = result.node.typeAnnotation + ? this.finishNode(result.node, "TypeAnnotation") + : null; } return super.parseArrow(node); @@ -2704,23 +2731,33 @@ export default (superClass: Class): Class => this.isRelational("<") ) { const state = this.state.clone(); - let error; - try { - const node = this.parseAsyncArrowWithTypeParameters( - startPos, - startLoc, - ); - if (node) return node; - } catch (e) { - error = e; + const arrow = this.tryParse( + abort => + this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || + abort(), + state, + ); + + if (!arrow.error && !arrow.aborted) return arrow.node; + + const result = this.tryParse( + () => super.parseSubscripts(base, startPos, startLoc, noCalls), + state, + ); + + if (result.node && !result.error) return result.node; + + if (arrow.node) { + this.state = arrow.failState; + return arrow.node; } - this.state = state; - try { - return super.parseSubscripts(base, startPos, startLoc, noCalls); - } catch (e) { - throw error || e; + if (result.node) { + this.state = result.failState; + return result.node; } + + throw arrow.error || result.error; } return super.parseSubscripts(base, startPos, startLoc, noCalls); @@ -2759,8 +2796,8 @@ export default (superClass: Class): Class => ) { const node = this.startNodeAt(startPos, startLoc); node.callee = base; - const state = this.state.clone(); - try { + + const result = this.tryParse(() => { node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew(); this.expect(tt.parenL); node.arguments = this.parseCallExpressionArguments(tt.parenR, false); @@ -2769,12 +2806,11 @@ export default (superClass: Class): Class => node, subscriptState.optionalChainMember, ); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - } else { - throw e; - } + }); + + if (result.node) { + if (result.error) this.state = result.failState; + return result.node; } } @@ -2790,16 +2826,9 @@ export default (superClass: Class): Class => parseNewArguments(node: N.NewExpression): void { let targs = null; if (this.shouldParseTypes() && this.isRelational("<")) { - const state = this.state.clone(); - try { - targs = this.flowParseTypeParameterInstantiationCallOrNew(); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - } else { - throw e; - } - } + targs = this.tryParse(() => + this.flowParseTypeParameterInstantiationCallOrNew(), + ).node; } node.typeArguments = targs; diff --git a/packages/babel-parser/src/plugins/jsx/index.js b/packages/babel-parser/src/plugins/jsx/index.js index fc2324ce6f2e..523702f0dd84 100644 --- a/packages/babel-parser/src/plugins/jsx/index.js +++ b/packages/babel-parser/src/plugins/jsx/index.js @@ -465,7 +465,7 @@ export default (superClass: Class): Class => getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name) ) { - throw this.raise( + this.raise( // $FlowIgnore closingElement.start, "Expected corresponding JSX closing tag for <" + @@ -484,12 +484,18 @@ export default (superClass: Class): Class => node.closingElement = closingElement; } node.children = children; - if (this.match(tt.relational) && this.state.value === "<") { - throw this.raise( + while (this.isRelational("<")) { + // In case we encounter an lt token here it will always be the start of + // jsx as the lt sign is not allowed in places that expect an expression + this.finishToken(tt.jsxTagStart); + + this.raise( this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag. " + "Did you want a JSX fragment <>...?", ); + + this.jsxParseElement(); } return isFragment(openingElement) diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 056826392540..d42628a68bac 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -1,6 +1,9 @@ // @flow +/*:: declare var invariant; */ + import type { TokenType } from "../../tokenizer/types"; +import type State from "../../tokenizer/state"; import { types as tt } from "../../tokenizer/types"; import { types as ct } from "../../tokenizer/context"; import * as N from "../../types"; @@ -1276,17 +1279,12 @@ export default (superClass: Class): Class => return res; } - tsTryParseAndCatch(f: () => T): ?T { - const state = this.state.clone(); - try { - return f(); - } catch (e) { - if (e instanceof SyntaxError) { - this.state = state; - return undefined; - } - throw e; - } + tsTryParseAndCatch(f: () => T): ?T { + const result = this.tryParse(abort => f() || abort()); + + if (result.aborted || !result.node) return undefined; + if (result.error) this.state = result.failState; + return result.node; } tsTryParse(f: () => ?T): ?T { @@ -1946,19 +1944,17 @@ export default (superClass: Class): Class => ); } - const state = this.state.clone(); - try { - return super.parseConditional(expr, noIn, startPos, startLoc); - } catch (err) { - if (!(err instanceof SyntaxError)) { - // istanbul ignore next: no such error is expected - throw err; - } + const result = this.tryParse(() => + super.parseConditional(expr, noIn, startPos, startLoc), + ); - this.state = state; - refNeedsArrowPos.start = err.pos || this.state.start; + if (!result.node) { + // $FlowIgnore + refNeedsArrowPos.start = result.error.pos || this.state.start; return expr; } + if (result.error) this.state = result.failState; + return result.node; } // Note: These "type casts" are *not* valid TS expressions. @@ -2161,80 +2157,97 @@ export default (superClass: Class): Class => parseMaybeAssign(...args): N.Expression { // Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax. - let jsxError: ?SyntaxError; + let state: ?State; + let jsx; + let typeCast; if (this.match(tt.jsxTagStart)) { - const context = this.curContext(); - assert(context === ct.j_oTag); - // Only time j_oTag is pushed is right after j_expr. - assert(this.state.context[this.state.context.length - 2] === ct.j_expr); - // Prefer to parse JSX if possible. But may be an arrow fn. - const state = this.state.clone(); - try { - return super.parseMaybeAssign(...args); - } catch (err) { - if (!(err instanceof SyntaxError)) { - // istanbul ignore next: no such error is expected - throw err; - } + state = this.state.clone(); + + jsx = this.tryParse(() => super.parseMaybeAssign(...args), state); + /*:: invariant(!jsx.aborted) */ - this.state = state; - // Pop the context added by the jsxTagStart. - assert(this.curContext() === ct.j_oTag); - this.state.context.pop(); - assert(this.curContext() === ct.j_expr); - this.state.context.pop(); - jsxError = err; + if (!jsx.error) return jsx.node; + + // Remove `tc.j_expr` and `tc.j_oTag` from context added + // by parsing `jsxTagStart` to stop the JSX plugin from + // messing with the tokens + const { context } = this.state; + if (context[context.length - 1] === ct.j_oTag) { + context.length -= 2; + } else if (context[context.length - 1] === ct.j_expr) { + context.length -= 1; } } - if (jsxError === undefined && !this.isRelational("<")) { + if (!(jsx && jsx.error) && !this.isRelational("<")) { return super.parseMaybeAssign(...args); } // Either way, we're looking at a '<': tt.jsxTagStart or relational. - let arrowExpression; let typeParameters: N.TsTypeParameterDeclaration; - const state = this.state.clone(); - try { + state = state || this.state.clone(); + + const arrow = this.tryParse(abort => { // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. typeParameters = this.tsParseTypeParameters(); - arrowExpression = super.parseMaybeAssign(...args); + const expr = super.parseMaybeAssign(...args); + if ( - arrowExpression.type !== "ArrowFunctionExpression" || - (arrowExpression.extra && arrowExpression.extra.parenthesized) + expr.type !== "ArrowFunctionExpression" || + (expr.extra && expr.extra.parenthesized) ) { - this.unexpected(); // Go to the catch block (needs a SyntaxError). - } - } catch (err) { - if (!(err instanceof SyntaxError)) { - // istanbul ignore next: no such error is expected - throw err; + abort(); } - if (jsxError) { - throw jsxError; + // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code. + if (typeParameters && typeParameters.params.length !== 0) { + this.resetStartLocationFromNode(expr, typeParameters); } + expr.typeParameters = typeParameters; + return expr; + }, state); + + if (!arrow.error && !arrow.aborted) return arrow.node; + if (!jsx) { // Try parsing a type cast instead of an arrow function. // This will never happen outside of JSX. // (Because in JSX the '<' should be a jsxTagStart and not a relational. assert(!this.hasPlugin("jsx")); - // Parsing an arrow function failed, so try a type cast. - this.state = state; + // This will start with a type assertion (via parseMaybeUnary). // But don't directly call `this.tsParseTypeAssertion` because we want to handle any binary after it. - return super.parseMaybeAssign(...args); + typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state); + /*:: invariant(!typeCast.aborted) */ + if (!typeCast.error) return typeCast.node; + } + + if (jsx && jsx.node) { + /*:: invariant(jsx.failState) */ + this.state = jsx.failState; + return jsx.node; + } + + if (arrow.node) { + /*:: invariant(arrow.failState) */ + this.state = arrow.failState; + return arrow.node; } - // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code. - if (typeParameters && typeParameters.params.length !== 0) { - this.resetStartLocationFromNode(arrowExpression, typeParameters); + if (typeCast && typeCast.node) { + /*:: invariant(typeCast.failState) */ + this.state = typeCast.failState; + return typeCast.node; } - arrowExpression.typeParameters = typeParameters; - return arrowExpression; + + if (jsx && jsx.thrown) throw jsx.error; + if (arrow.thrown) throw arrow.error; + if (typeCast && typeCast.thrown) throw typeCast.error; + + throw (jsx && jsx.error) || arrow.error || (typeCast && typeCast.error); } // Handle type assertions @@ -2250,23 +2263,20 @@ export default (superClass: Class): Class => if (this.match(tt.colon)) { // This is different from how the TS parser does it. // TS uses lookahead. The Babel Parser parses it as a parenthesized expression and converts. - const state = this.state.clone(); - try { + + const result = this.tryParse(abort => { const returnType = this.tsParseTypeOrTypePredicateAnnotation( tt.colon, ); - if (this.canInsertSemicolon() || !this.match(tt.arrow)) { - this.state = state; - return undefined; - } - node.returnType = returnType; - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - } else { - // istanbul ignore next: no such error is expected - throw err; - } + if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort(); + return returnType; + }); + + if (result.aborted) return; + + if (!result.thrown) { + if (result.error) this.state = result.failState; + node.returnType = result.node; } } diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index e41504d9d1cf..6ff711f373c6 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -38,7 +38,7 @@ export default class State { this.startLoc = this.endLoc = this.curPosition(); } - errors: Error[] = []; + errors: SyntaxError[] = []; // Used to signify the start of a potential arrow function potentialArrowAt: number = -1; diff --git a/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json deleted file mode 100644 index 182a3a9016d8..000000000000 --- a/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...? (1:22)" -} diff --git a/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json new file mode 100644 index 000000000000..b657e0982552 --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json @@ -0,0 +1,189 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "errors": [ + "SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...? (1:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "JSXElement", + "start": 8, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "name": "div" + }, + "attributes": [], + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 16, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "name": "div" + } + }, + "children": [ + { + "type": "JSXText", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "extra": { + "rawValue": "one", + "raw": "one" + }, + "value": "one" + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/options.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/options.json deleted file mode 100644 index f3afda9ee91d..000000000000 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Expected corresponding JSX closing tag for (1:5)" -} 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 new file mode 100644 index 000000000000..29ab5696546f --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json @@ -0,0 +1,133 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "JSXElement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "name": "Foo" + }, + "attributes": [], + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 5, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "name": { + "type": "JSXIdentifier", + "start": 7, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "name": "Bar" + } + }, + "children": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file From 44be4978dfe677f44b00a23f18aa5d7db61a931d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 23 Aug 2019 14:26:29 +0200 Subject: [PATCH 07/29] Update invalid fixtures --- .../destructuring/binding-this/input.js | 2 +- .../destructuring/binding-this/output.json | 36 +++-- .../generators/invalid-escape-yield/input.js | 2 +- .../invalid-escape-yield/options.json | 3 - .../invalid-escape-yield/output.json | 126 +++++++++++++++ .../meta-properties/new-invalid-prop/input.js | 4 +- .../new-invalid-prop/output.json | 152 ++++++++++++------ .../es2015/uncategorised/222/input.js | 2 +- .../es2015/uncategorised/222/output.json | 29 ++-- .../es2015/uncategorised/223/input.js | 2 +- .../es2015/uncategorised/223/output.json | 29 ++-- .../es2015/uncategorised/233/input.js | 2 +- .../es2015/uncategorised/233/output.json | 29 ++-- .../es2015/uncategorised/234/input.js | 2 +- .../es2015/uncategorised/234/output.json | 29 ++-- 15 files changed, 318 insertions(+), 131 deletions(-) delete mode 100644 packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/input.js b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/input.js index 11cebfa18894..42403a50ea26 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/input.js +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/binding-this/input.js @@ -1 +1 @@ -var { this }; +var { this } = {}; 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 a246297545bc..7d830d569103 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 13, + "end": 18, "loc": { "start": { "line": 1, @@ -9,17 +9,16 @@ }, "end": { "line": 1, - "column": 13 + "column": 18 } }, "errors": [ - "SyntaxError: Unexpected keyword 'this' (1:6)", - "SyntaxError: Complex binding patterns require an initialization value (1:12)" + "SyntaxError: Unexpected keyword 'this' (1:6)" ], "program": { "type": "Program", "start": 0, - "end": 13, + "end": 18, "loc": { "start": { "line": 1, @@ -27,7 +26,7 @@ }, "end": { "line": 1, - "column": 13 + "column": 18 } }, "sourceType": "script", @@ -36,7 +35,7 @@ { "type": "VariableDeclaration", "start": 0, - "end": 13, + "end": 18, "loc": { "start": { "line": 1, @@ -44,14 +43,14 @@ }, "end": { "line": 1, - "column": 13 + "column": 18 } }, "declarations": [ { "type": "VariableDeclarator", "start": 4, - "end": 12, + "end": 17, "loc": { "start": { "line": 1, @@ -59,7 +58,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 17 } }, "id": { @@ -134,7 +133,22 @@ } ] }, - "init": null + "init": { + "type": "ObjectExpression", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [] + } } ], "kind": "var" diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/input.js b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/input.js index 521b91facbbc..8a89e37a1275 100644 --- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/input.js +++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/input.js @@ -1 +1 @@ -(function* () { y\u0069eld 10 }) +(function* () { y\u0069eld; }) diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json deleted file mode 100644 index 8d7589bff5a4..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token, expected \";\" (1:27)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..6d1a2d6c3fce --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-escape-yield/output.json @@ -0,0 +1,126 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "expression": { + "type": "FunctionExpression", + "start": 1, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": null, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 14, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "expression": { + "type": "Identifier", + "start": 16, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "yield" + }, + "name": "yield" + } + } + ], + "directives": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/input.js b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/input.js index d775807ddef1..1f159ebd65d2 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/input.js +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/input.js @@ -1 +1,3 @@ -new.prop \ No newline at end of file +function f() { + new.prop +} \ No newline at end of file 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 dcfdebf0f762..214b3e5417fe 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 @@ -1,100 +1,152 @@ { "type": "File", "start": 0, - "end": 8, + "end": 27, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 8 + "line": 3, + "column": 1 } }, "errors": [ - "SyntaxError: The only valid meta property for new is new.target (1:4)", - "SyntaxError: new.target can only be used in functions (1:0)" + "SyntaxError: The only valid meta property for new is new.target (2:6)" ], "program": { "type": "Program", "start": 0, - "end": 8, + "end": 27, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 8 + "line": 3, + "column": 1 } }, "sourceType": "script", "interpreter": null, "body": [ { - "type": "ExpressionStatement", + "type": "FunctionDeclaration", "start": 0, - "end": 8, + "end": 27, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 8 + "line": 3, + "column": 1 } }, - "expression": { - "type": "MetaProperty", - "start": 0, - "end": 8, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, "loc": { "start": { "line": 1, - "column": 0 + "column": 9 }, "end": { "line": 1, - "column": 8 - } + "column": 10 + }, + "identifierName": "f" }, - "meta": { - "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "new" + "name": "f" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 13, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 13 }, - "name": "new" + "end": { + "line": 3, + "column": 1 + } }, - "property": { - "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 + "body": [ + { + "type": "ExpressionStatement", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 10 + } }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "prop" - }, - "name": "prop" - } + "expression": { + "type": "MetaProperty", + "start": 17, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "meta": { + "type": "Identifier", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "new" + }, + "name": "new" + }, + "property": { + "type": "Identifier", + "start": 21, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "prop" + }, + "name": "prop" + } + } + } + ], + "directives": [] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/input.js index 67f4e9ae35f3..2e33b3f144ba 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/input.js +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/input.js @@ -1 +1 @@ -({ obj:20 }) = 42 \ No newline at end of file +({ obj:20 } = 42) \ No newline at end of file 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 d1731b24d0f8..3b566923a758 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json @@ -14,8 +14,7 @@ }, "errors": [ "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)", - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)", - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" + "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)" ], "program": { "type": "Program", @@ -50,16 +49,16 @@ }, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 17, + "start": 1, + "end": 16, "loc": { "start": { "line": 1, - "column": 0 + "column": 1 }, "end": { "line": 1, - "column": 17 + "column": 16 } }, "operator": "=", @@ -133,24 +132,20 @@ "value": 20 } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "NumericLiteral", - "start": 15, - "end": 17, + "start": 14, + "end": 16, "loc": { "start": { "line": 1, - "column": 15 + "column": 14 }, "end": { "line": 1, - "column": 17 + "column": 16 } }, "extra": { @@ -158,6 +153,10 @@ "raw": "42" }, "value": 42 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/input.js index 6c808fb17ea6..7cf8d0fb9429 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/input.js +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/input.js @@ -1 +1 @@ -( { get x() {} } ) = 0 \ No newline at end of file +( { get x() {} } = 0 ) \ No newline at end of file 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 e43fe16db1b6..5869dc9d8e95 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json @@ -14,8 +14,7 @@ }, "errors": [ "SyntaxError: Object pattern can't contain getter or setter (1:8)", - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)", - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:2)" + "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)" ], "program": { "type": "Program", @@ -50,16 +49,16 @@ }, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, + "start": 2, + "end": 20, "loc": { "start": { "line": 1, - "column": 0 + "column": 2 }, "end": { "line": 1, - "column": 22 + "column": 20 } }, "operator": "=", @@ -134,24 +133,20 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "NumericLiteral", - "start": 21, - "end": 22, + "start": 19, + "end": 20, "loc": { "start": { "line": 1, - "column": 21 + "column": 19 }, "end": { "line": 1, - "column": 22 + "column": 20 } }, "extra": { @@ -159,6 +154,10 @@ "raw": "0" }, "value": 0 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/input.js index 40ac1e2b4639..7afe6af895a0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/input.js +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/input.js @@ -1 +1 @@ -"use strict"; ({ v: eval }) = obj \ No newline at end of file +"use strict"; ({ v: eval } = obj) \ No newline at end of file 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 1fbc3ac656a7..bd58e38aa176 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Assigning to 'eval' in strict mode (1:20)", - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:15)" + "SyntaxError: Assigning to 'eval' in strict mode (1:20)" ], "program": { "type": "Program", @@ -49,16 +48,16 @@ }, "expression": { "type": "AssignmentExpression", - "start": 14, - "end": 33, + "start": 15, + "end": 32, "loc": { "start": { "line": 1, - "column": 14 + "column": 15 }, "end": { "line": 1, - "column": 33 + "column": 32 } }, "operator": "=", @@ -129,28 +128,28 @@ "name": "eval" } } - ], - "extra": { - "parenthesized": true, - "parenStart": 14 - } + ] }, "right": { "type": "Identifier", - "start": 30, - "end": 33, + "start": 29, + "end": 32, "loc": { "start": { "line": 1, - "column": 30 + "column": 29 }, "end": { "line": 1, - "column": 33 + "column": 32 }, "identifierName": "obj" }, "name": "obj" + }, + "extra": { + "parenthesized": true, + "parenStart": 14 } } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/input.js b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/input.js index cb924f3bb153..2e399474efe9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/input.js +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/input.js @@ -1 +1 @@ -"use strict"; ({ v: arguments }) = obj \ No newline at end of file +"use strict"; ({ v: arguments } = obj) \ No newline at end of file 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 ada5ea9281b8..60d3496c8663 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Assigning to 'arguments' in strict mode (1:20)", - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:15)" + "SyntaxError: Assigning to 'arguments' in strict mode (1:20)" ], "program": { "type": "Program", @@ -49,16 +48,16 @@ }, "expression": { "type": "AssignmentExpression", - "start": 14, - "end": 38, + "start": 15, + "end": 37, "loc": { "start": { "line": 1, - "column": 14 + "column": 15 }, "end": { "line": 1, - "column": 38 + "column": 37 } }, "operator": "=", @@ -129,28 +128,28 @@ "name": "arguments" } } - ], - "extra": { - "parenthesized": true, - "parenStart": 14 - } + ] }, "right": { "type": "Identifier", - "start": 35, - "end": 38, + "start": 34, + "end": 37, "loc": { "start": { "line": 1, - "column": 35 + "column": 34 }, "end": { "line": 1, - "column": 38 + "column": 37 }, "identifierName": "obj" }, "name": "obj" + }, + "extra": { + "parenthesized": true, + "parenStart": 14 } } } From 8546a6d5cbbf46bc5218267c7474762082b1475e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 15:36:11 +0200 Subject: [PATCH 08/29] Do not report invalid lhs in toAssignable --- packages/babel-parser/src/parser/lval.js | 12 ++-- packages/babel-parser/src/plugins/flow.js | 57 ++++++++----------- .../core/uncategorised/367/output.json | 1 - .../core/uncategorised/368/output.json | 1 - .../core/uncategorised/369/output.json | 1 - .../core/uncategorised/374/output.json | 1 - .../core/uncategorised/383/output.json | 1 - .../core/uncategorised/384/output.json | 1 - .../core/uncategorised/417/output.json | 1 - .../core/uncategorised/418/output.json | 1 - .../es2015/uncategorised/221/output.json | 1 - .../es2015/uncategorised/222/output.json | 1 - .../es2015/uncategorised/251/output.json | 1 - .../es2015/uncategorised/252/output.json | 2 - .../es2015/uncategorised/284/output.json | 1 - .../es2015/uncategorised/37/output.json | 1 - .../es2015/uncategorised/395/output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../invalid-lhs-01/output.json | 1 - .../invalid-lhs-02/output.json | 1 - .../invalid-group-assignment/output.json | 1 - .../invalid-lhs-init/output.json | 1 - .../output.json | 1 - .../output.json | 1 - .../invalid-syntax/migrated_0045/output.json | 1 - .../invalid-syntax/migrated_0046/output.json | 1 - .../invalid-syntax/migrated_0047/output.json | 1 - .../invalid-syntax/migrated_0056/output.json | 1 - .../invalid-syntax/migrated_0066/output.json | 1 - .../invalid-syntax/migrated_0067/output.json | 1 - .../invalid-syntax/migrated_0098/output.json | 1 - .../invalid-syntax/migrated_0099/output.json | 2 - .../invalid-syntax/migrated_0125/output.json | 1 - .../invalid-syntax/migrated_0126/output.json | 1 - .../import-meta/not-assignable/output.json | 1 - .../regression/issue-58-failing-1/output.json | 1 - .../regression/issue-58-failing-2/output.json | 1 - .../regression/issue-58-failing-3/output.json | 1 - .../regression/issue-58-failing-4/output.json | 1 - 44 files changed, 27 insertions(+), 86 deletions(-) diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index e11c027f257b..464cb68f3930 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -101,6 +101,7 @@ export default class LValParser extends NodeUtils { if (node.operator === "=") { node.type = "AssignmentPattern"; delete node.operator; + this.toAssignable(node.left, isBinding, contextDescription); } else { this.raise( node.left.end, @@ -120,14 +121,9 @@ export default class LValParser extends NodeUtils { case "MemberExpression": if (!isBinding) break; - default: { - const message = - "Invalid left-hand side" + - (contextDescription - ? " in " + contextDescription - : /* istanbul ignore next */ "expression"); - this.raise(node.start, message); - } + default: + // We don't know how to deal with this node. It will + // be reported by a later call to checkLVal } } return node; diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 1e497633ad1c..bb7b340e40ff 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -1777,10 +1777,10 @@ export default (superClass: Class): Class => this.state.noArrowAt = noArrowAt.concat(valid[0].start); ({ consequent, failed } = this.tryParseConditionalConsequent()); } - - this.getArrowLikeExpressions(consequent, true); } + this.getArrowLikeExpressions(consequent, true); + this.state.noArrowAt = originalNoArrowAt; this.expect(tt.colon); @@ -1826,19 +1826,7 @@ export default (superClass: Class): Class => if (node.type === "ArrowFunctionExpression") { if (node.typeParameters || !node.returnType) { // This is an arrow expression without ambiguity, so check its parameters - this.toAssignableList( - // node.params is Expression[] instead of $ReadOnlyArray because it - // has not been converted yet. - ((node.params: any): N.Expression[]), - true, - "arrow function parameters", - node.extra?.trailingComma, - ); - // Enter scope, as checkParams defines bindings - this.scope.enter(functionFlags(false, false) | SCOPE_ARROW); - // Use super's method to force the parameters to be checked - super.checkParams(node, false, true); - this.scope.exit(); + this.finishArrowValidation(node); } else { arrows.push(node); } @@ -1850,28 +1838,29 @@ export default (superClass: Class): Class => } if (disallowInvalid) { - for (let i = 0; i < arrows.length; i++) { - this.toAssignableList( - ((node.params: any): N.Expression[]), - true, - "arrow function parameters", - node.extra?.trailingComma, - ); - } + arrows.forEach(node => this.finishArrowValidation(node)); return [arrows, []]; } - return partition(arrows, node => { - const result = this.tryParse(() => - this.toAssignableList( - ((node.params: any): N.Expression[]), - true, - "arrow function parameters", - node.extra?.trailingComma, - ), - ); - return !result.error; - }); + return partition(arrows, node => + node.params.every(param => this.isAssignable(param, true)), + ); + } + + finishArrowValidation(node: N.ArrowFunctionExpression) { + this.toAssignableList( + // node.params is Expression[] instead of $ReadOnlyArray because it + // has not been converted yet. + ((node.params: any): N.Expression[]), + true, + "arrow function parameters", + node.extra?.trailingComma, + ); + // Enter scope, as checkParams defines bindings + this.scope.enter(functionFlags(false, false) | SCOPE_ARROW); + // Use super's method to force the parameters to be checked + super.checkParams(node, false, true); + this.scope.exit(); } forwardNoArrowParamsConversionAt(node: N.Node, parse: () => T): T { 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 466f4bd92254..99a3e74a04af 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "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 8a8d67a80a10..8770df4abba7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "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 b22f988e1aa7..42614106f157 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "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 d2ba76398677..f9e5df01e76a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "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 329a2a1e98b7..56547ff7be13 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "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 12ab663d4186..ece139488ea0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "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 9210a772c6e1..3844a4d151a7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "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 7300952311c2..9d008175f644 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "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 6932acaf94d1..58fa4ffd7fb9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:1)", "SyntaxError: Invalid left-hand side in array destructuring pattern (1:1)" ], "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 3b566923a758..e758dffee7fa 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)", "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)" ], "program": { 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 11b48d988225..a7c444dfbcdc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)" ], "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 fb79f18aa20a..2d80f047d283 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json @@ -13,8 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", - "SyntaxError: Invalid left-hand side in arrow function parameters (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)" ], 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 05a6a4bba833..68f6ccb7cefc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:3)", "SyntaxError: Binding invalid left-hand side in array destructuring pattern (1:3)" ], "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 0f0e4be597a6..074d84652acc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:2)", "SyntaxError: Binding member expression (1:2)" ], "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 0f0e4be597a6..074d84652acc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:2)", "SyntaxError: Binding member expression (1:2)" ], "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 b6f2f5c99bca..30bb59f8c609 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:8)", - "SyntaxError: Invalid left-hand side in arrow function parameters (2:8)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" ], "program": { 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 a528450c2999..1bec942c71ac 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:3)", - "SyntaxError: Invalid left-hand side in arrow function parameters (2:3)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" ], "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 fdd2c3dee906..3c16beba8cdf 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:3)", - "SyntaxError: Invalid left-hand side in arrow function parameters (2:3)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" ], "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 e7d047d9c0e0..18209649f3a6 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:9)", - "SyntaxError: Invalid left-hand side in arrow function parameters (2:9)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:9)" ], "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 8eb8960ae355..9e8858777646 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)", "SyntaxError: Binding member expression (1:4)" ], "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 2956af5c9a0e..a0f4f6168da6 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:24)", "SyntaxError: Binding member expression (1:24)" ], "program": { 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 89f16c86c886..b71ec1a70153 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)", "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)" ], "program": { 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 43142f71dcd8..0282d2b2a59c 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:5)", "SyntaxError: Invalid left-hand side in object destructuring pattern (1:5)" ], "program": { 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 104d3f520ff3..a6616604e7dd 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "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 58a3e4e97f69..bdb80af26d26 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in for-of statement (1:5)", "SyntaxError: Invalid left-hand side in for-of statement (1:5)" ], "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 3ce1bab5f80e..dfdc04d3c48b 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (1:16)", - "SyntaxError: Invalid left-hand side in arrow function parameters (1:16)", "SyntaxError: Binding invalid left-hand side in function parameter list (1:16)" ], "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 8f2ce5dd74e8..6bf7ee0d6108 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (1:25)", - "SyntaxError: Invalid left-hand side in arrow function parameters (1:25)", "SyntaxError: Binding invalid left-hand side in function parameter list (1:25)" ], "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 466f4bd92254..99a3e74a04af 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "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 8a8d67a80a10..8770df4abba7 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "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 b22f988e1aa7..42614106f157 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "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 d2ba76398677..f9e5df01e76a 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "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 329a2a1e98b7..56547ff7be13 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "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 12ab663d4186..ece139488ea0 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { 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 11b48d988225..a7c444dfbcdc 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)" ], "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 fb79f18aa20a..2d80f047d283 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 @@ -13,8 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (1:1)", - "SyntaxError: Invalid left-hand side in arrow function parameters (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)" ], 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 9210a772c6e1..3844a4d151a7 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "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 7300952311c2..9d008175f644 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in for-in statement (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json index 914869881742..7610536beafc 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in assignment expression (1:0)", "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "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 7f63927ff8ee..598107b6493b 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (2:11)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)" ], "program": { 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 329769ed64ff..c65e342557c3 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (2:8)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" ], "program": { 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 32daf7d423fa..ae2fe29bafc4 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (2:5)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:5)" ], "program": { 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 f7e58d708eb4..2479192b7877 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Invalid left-hand side in arrow function parameters (2:11)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)" ], "program": { From e2f8b45ecb66ac64dd9109a5c043f65795782f4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 15:53:16 +0200 Subject: [PATCH 09/29] Do not validate function id multiple times --- packages/babel-parser/src/parser/statement.js | 11 +++++------ packages/babel-parser/src/plugins/typescript/index.js | 6 ++++-- .../test/fixtures/core/uncategorised/482/output.json | 1 - .../test/fixtures/core/uncategorised/483/output.json | 1 - .../test/fixtures/core/uncategorised/513/output.json | 1 - .../fixtures/es2015/uncategorised/365/output.json | 1 - .../fixtures/es2015/uncategorised/377/output.json | 1 - .../es2015/yield/function-name-strict/output.json | 1 - .../output.json | 1 - .../esprima/invalid-syntax/migrated_0199/output.json | 1 - .../esprima/invalid-syntax/migrated_0200/output.json | 1 - .../esprima/invalid-syntax/migrated_0239/output.json | 1 - 12 files changed, 9 insertions(+), 18 deletions(-) diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 20c291db4405..6d1356c01186 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1080,7 +1080,7 @@ export default class StatementParser extends ExpressionParser { // We need to register this _after_ parsing the function body // because of TypeScript body-less function declarations, // which shouldn't be added to the scope. - this.checkFunctionStatementId(node); + this.registerFunctionStatementId(node); } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; @@ -1111,22 +1111,21 @@ export default class StatementParser extends ExpressionParser { this.checkYieldAwaitInDefaultParams(); } - checkFunctionStatementId(node: N.Function): void { + registerFunctionStatementId(node: N.Function): void { if (!node.id) return; // If it is a regular function declaration in sloppy mode, then it is // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding // mode depends on properties of the current scope (see // treatFunctionsAsVar). - this.checkLVal( - node.id, + this.scope.declareName( + node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, - null, - "function name", + node.id.start, ); } diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index d42628a68bac..e5d461b55e46 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -1595,11 +1595,13 @@ export default (superClass: Class): Class => super.parseFunctionBodyAndFinish(node, type, isMethod); } - checkFunctionStatementId(node: N.Function): void { + registerFunctionStatementId(node: N.Function): void { if (!node.body && node.id) { + // Function ids are validated after parsing their body. + // For bodyless function, we need to do it here. this.checkLVal(node.id, BIND_TS_AMBIENT, null, "function name"); } else { - super.checkFunctionStatementId(...arguments); + super.registerFunctionStatementId(...arguments); } } 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 a26597f806c1..35af060b7c6e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)", "SyntaxError: Binding 'eval' in strict mode (1:41)" ], "program": { 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 4c756f50ea07..7419ba446dc9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:41)", "SyntaxError: Binding 'arguments' in strict mode (1:41)" ], "program": { 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 03212ebf3a29..55fdd400dee8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Unexpected reserved word 'static' (1:23)", - "SyntaxError: Binding 'static' in strict mode (1:23)", "SyntaxError: Binding 'static' in strict mode (1:23)" ], "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 1182853d6b38..c6b64b219114 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json @@ -15,7 +15,6 @@ "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:9)", "SyntaxError: Unexpected reserved word 'await' (1:9)", - "SyntaxError: Binding 'await' in strict mode (1:9)", "SyntaxError: Binding 'await' in strict mode (1:9)" ], "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 690d556783a4..5d669da1b826 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:9)", - "SyntaxError: Binding 'enum' in strict mode (1:9)", "SyntaxError: Binding 'enum' in strict mode (1:9)" ], "program": { 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 33902efb1ed5..eccf3f74e5a2 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (2:9)", - "SyntaxError: Binding 'yield' in strict mode (2:9)", "SyntaxError: Binding 'yield' in strict mode (2:9)" ], "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 d38e74d2f5ca..884428945f9d 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:25)", - "SyntaxError: Binding 'yield' in strict mode (1:25)", "SyntaxError: Binding 'yield' in strict mode (1:25)" ], "program": { 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 a26597f806c1..35af060b7c6e 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Binding 'eval' in strict mode (1:41)", "SyntaxError: Binding 'eval' in strict mode (1:41)" ], "program": { 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 4c756f50ea07..7419ba446dc9 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: Binding 'arguments' in strict mode (1:41)", "SyntaxError: Binding 'arguments' in strict mode (1:41)" ], "program": { 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 03212ebf3a29..55fdd400dee8 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 @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Unexpected reserved word 'static' (1:23)", - "SyntaxError: Binding 'static' in strict mode (1:23)", "SyntaxError: Binding 'static' in strict mode (1:23)" ], "program": { From 51d55b52c608e29d786728d378531ad564425094 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 19:45:09 +0200 Subject: [PATCH 10/29] Dedupe reserved await errors --- packages/babel-parser/src/parser/expression.js | 10 ++++++++-- .../test/fixtures/es2015/uncategorised/357/output.json | 1 - .../test/fixtures/es2015/uncategorised/359/output.json | 1 - .../test/fixtures/es2015/uncategorised/361/output.json | 1 - .../test/fixtures/es2015/uncategorised/363/output.json | 1 - .../test/fixtures/es2015/uncategorised/365/output.json | 1 - .../test/fixtures/es2015/uncategorised/367/output.json | 1 - 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 5f4b4868337d..d9068b8552fa 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -2156,6 +2156,7 @@ export default class ExpressionParser extends LValParser { startLoc, "Can not use 'yield' as identifier inside a generator", ); + return; } if (word === "await") { @@ -2164,7 +2165,9 @@ export default class ExpressionParser extends LValParser { startLoc, "Can not use 'await' as identifier inside an async function", ); - } else if ( + return; + } + if ( this.state.awaitPos === -1 && (this.state.maybeInArrowParameters || this.isAwaitAllowed()) ) { @@ -2177,9 +2180,11 @@ export default class ExpressionParser extends LValParser { startLoc, "'arguments' is not allowed in class field initializer", ); + return; } if (checkKeywords && isKeyword(word)) { this.raise(startLoc, `Unexpected keyword '${word}'`); + return; } const reservedTest = !this.state.strict @@ -2194,8 +2199,9 @@ export default class ExpressionParser extends LValParser { startLoc, "Can not use keyword 'await' outside an async function", ); + } else { + this.raise(startLoc, `Unexpected reserved word '${word}'`); } - this.raise(startLoc, `Unexpected reserved word '${word}'`); } } 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 f2b991f74176..388f41a3ac17 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:0)", - "SyntaxError: Unexpected reserved word 'await' (1:0)", "SyntaxError: Assigning to 'await' in strict mode (1:0)" ], "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 2101c44304be..3226ef913449 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:6)", - "SyntaxError: Unexpected reserved word 'await' (1:6)", "SyntaxError: Binding 'await' in strict mode (1:6)" ], "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 8545de59cbf3..daf692a19d1d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:8)", - "SyntaxError: Unexpected reserved word 'await' (1:8)", "SyntaxError: Binding 'await' in strict mode (1:8)" ], "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 78a6181b6eae..eb316d5a818b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:15)", - "SyntaxError: Unexpected reserved word 'await' (1:15)", "SyntaxError: Binding 'await' in strict mode (1:15)" ], "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 c6b64b219114..36280a36621b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:9)", - "SyntaxError: Unexpected reserved word 'await' (1:9)", "SyntaxError: Binding 'await' in strict mode (1:9)" ], "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 3a4719110853..84af037a102a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json @@ -14,7 +14,6 @@ }, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:6)", - "SyntaxError: Unexpected reserved word 'await' (1:6)", "SyntaxError: Binding 'await' in strict mode (1:6)" ], "program": { From 774d6693257d860aeaff3e1e0e2f044e4bfd3d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 20:18:35 +0200 Subject: [PATCH 11/29] Remove duplicate errors about strict reserved bindings --- packages/babel-parser/src/parser/expression.js | 13 ++++++++++++- packages/babel-parser/src/parser/lval.js | 13 +++++++++++-- packages/babel-parser/src/plugins/flow.js | 2 +- packages/babel-parser/src/util/identifier.js | 16 ++++++++++++---- .../fixtures/core/uncategorised/504/output.json | 3 +-- .../fixtures/core/uncategorised/505/output.json | 3 +-- .../fixtures/core/uncategorised/506/output.json | 3 +-- .../fixtures/core/uncategorised/507/output.json | 3 +-- .../fixtures/core/uncategorised/508/output.json | 3 +-- .../fixtures/core/uncategorised/509/output.json | 3 +-- .../fixtures/core/uncategorised/510/output.json | 3 +-- .../fixtures/core/uncategorised/513/output.json | 3 +-- .../fixtures/core/uncategorised/544/output.json | 3 +-- .../fixtures/core/uncategorised/545/output.json | 3 +-- .../es2015/uncategorised/357/output.json | 3 +-- .../es2015/uncategorised/359/output.json | 3 +-- .../es2015/uncategorised/361/output.json | 3 +-- .../es2015/uncategorised/363/output.json | 3 +-- .../es2015/uncategorised/365/output.json | 3 +-- .../es2015/uncategorised/367/output.json | 3 +-- .../es2015/uncategorised/369/output.json | 3 +-- .../es2015/uncategorised/371/output.json | 3 +-- .../es2015/uncategorised/373/output.json | 3 +-- .../es2015/uncategorised/375/output.json | 3 +-- .../es2015/uncategorised/377/output.json | 3 +-- .../es2015/uncategorised/378/output.json | 3 +-- .../es2015/uncategorised/379/output.json | 3 +-- .../yield/function-name-strict/output.json | 3 +-- .../yield/parameter-name-strict/output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../output.json | 3 +-- .../invalid-syntax/migrated_0224/output.json | 3 +-- .../invalid-syntax/migrated_0225/output.json | 3 +-- .../invalid-syntax/migrated_0226/output.json | 3 +-- .../invalid-syntax/migrated_0227/output.json | 3 +-- .../invalid-syntax/migrated_0228/output.json | 3 +-- .../invalid-syntax/migrated_0229/output.json | 3 +-- .../invalid-syntax/migrated_0230/output.json | 3 +-- .../invalid-syntax/migrated_0231/output.json | 3 +-- .../invalid-syntax/migrated_0232/output.json | 3 +-- .../invalid-syntax/migrated_0239/output.json | 3 +-- .../invalid-syntax/migrated_0277/output.json | 3 +-- 50 files changed, 82 insertions(+), 100 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index d9068b8552fa..d724ce08262a 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1970,6 +1970,7 @@ export default class ExpressionParser extends LValParser { node, !oldStrict && !useStrict && !allowExpression && !isMethod && !nonSimple, allowExpression, + !oldStrict && useStrict, ); node.body = this.parseBlock(true, false); this.state.labels = oldLabels; @@ -1978,7 +1979,14 @@ export default class ExpressionParser extends LValParser { this.state.inParameters = oldInParameters; // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' if (this.state.strict && node.id) { - this.checkLVal(node.id, BIND_OUTSIDE, undefined, "function name"); + this.checkLVal( + node.id, + BIND_OUTSIDE, + undefined, + "function name", + undefined, + !oldStrict && useStrict, + ); } this.state.strict = oldStrict; } @@ -1997,6 +2005,7 @@ export default class ExpressionParser extends LValParser { allowDuplicates: boolean, // eslint-disable-next-line no-unused-vars isArrowFunction: ?boolean, + strictModeChanged?: boolean = true, ): void { // $FlowIssue const nameHash: {} = Object.create(null); @@ -2006,6 +2015,8 @@ export default class ExpressionParser extends LValParser { BIND_VAR, allowDuplicates ? null : nameHash, "function parameter list", + undefined, + strictModeChanged, ); } } diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index 464cb68f3930..c8dc31b39eaf 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -15,7 +15,10 @@ import type { SpreadElement, } from "../types"; import type { Pos, Position } from "../util/location"; -import { isStrictBindReservedWord } from "../util/identifier"; +import { + isStrictBindOnlyReservedWord, + isStrictBindReservedWord, +} from "../util/identifier"; import { NodeUtils } from "./node"; import { type BindingTypes, BIND_NONE } from "../util/scopeflags"; @@ -347,12 +350,18 @@ export default class LValParser extends NodeUtils { checkClashes: ?{ [key: string]: boolean }, contextDescription: string, disallowLetBinding?: boolean, + strictModeChanged?: boolean = false, ): void { switch (expr.type) { case "Identifier": if ( this.state.strict && - isStrictBindReservedWord(expr.name, this.inModule) + // "Global" reserved words have already been checked by parseIdentifier, + // unless they have been found in the id or parameters of a strict-mode + // function in a sloppy context. + (strictModeChanged + ? isStrictBindReservedWord(expr.name, this.inModule) + : isStrictBindOnlyReservedWord(expr.name)) ) { this.raise( expr.start, diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index bb7b340e40ff..569175ad217c 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -2688,7 +2688,7 @@ export default (superClass: Class): Class => return; } - return super.checkParams(node, allowDuplicates, isArrowFunction); + return super.checkParams(...arguments); } parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression { diff --git a/packages/babel-parser/src/util/identifier.js b/packages/babel-parser/src/util/identifier.js index 7fda0e27de71..cbcc59cb6f81 100644 --- a/packages/babel-parser/src/util/identifier.js +++ b/packages/babel-parser/src/util/identifier.js @@ -21,9 +21,7 @@ const reservedWords = { }; const reservedWordsStrictSet = new Set(reservedWords.strict); -const reservedWordsStrictBindSet = new Set( - reservedWords.strict.concat(reservedWords.strictBind), -); +const reservedWordsStrictBindSet = new Set(reservedWords.strictBind); /** * Checks if word is a reserved word in non-strict mode @@ -41,6 +39,14 @@ export function isStrictReservedWord(word: string, inModule: boolean): boolean { return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word); } +/** + * Checks if word is a reserved word in binding strict mode, but it is allowed as + * a normal identifier. + */ +export function isStrictBindOnlyReservedWord(word: string): boolean { + return reservedWordsStrictBindSet.has(word); +} + /** * Checks if word is a reserved word in binding strict mode * @@ -50,7 +56,9 @@ export function isStrictBindReservedWord( word: string, inModule: boolean, ): boolean { - return isReservedWord(word, inModule) || reservedWordsStrictBindSet.has(word); + return ( + isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word) + ); } export function isKeyword(word: string): boolean { 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 0f64682a8eb0..2201ea3de8c6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'implements' (1:37)", - "SyntaxError: Binding 'implements' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'implements' (1:37)" ], "program": { "type": "Program", 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 8222afc6a0e6..be76deabc7a1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:37)", - "SyntaxError: Binding 'interface' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'interface' (1:37)" ], "program": { "type": "Program", 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 f977c4c528e0..414e229fac38 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'package' (1:37)", - "SyntaxError: Binding 'package' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'package' (1:37)" ], "program": { "type": "Program", 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 b1147bbff4e1..32efcd46a632 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'private' (1:37)", - "SyntaxError: Binding 'private' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'private' (1:37)" ], "program": { "type": "Program", 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 1b1c3bcecf8b..e3d3f255c253 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'protected' (1:37)", - "SyntaxError: Binding 'protected' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'protected' (1:37)" ], "program": { "type": "Program", 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 8c06677a9156..2e801038c78d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:37)", - "SyntaxError: Binding 'public' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'public' (1:37)" ], "program": { "type": "Program", 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 12f9d4d5420d..4ed420518d6d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:37)", - "SyntaxError: Binding 'static' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'static' (1:37)" ], "program": { "type": "Program", 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 55fdd400dee8..c249f39209bf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:23)", - "SyntaxError: Binding 'static' in strict mode (1:23)" + "SyntaxError: Unexpected reserved word 'static' (1:23)" ], "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 eb3ded152bb0..d3b1ca7ae09c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (2:8)", - "SyntaxError: Binding 'public' in strict mode (2:8)" + "SyntaxError: Unexpected reserved word 'public' (2:8)" ], "program": { "type": "Program", 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 14bc7d51e260..34af0a196c39 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:8)", - "SyntaxError: Binding 'public' in strict mode (1:8)" + "SyntaxError: Unexpected reserved word 'public' (1:8)" ], "program": { "type": "Program", 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 388f41a3ac17..b5f573a72f13 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Can not use keyword 'await' outside an async function (1:0)", - "SyntaxError: Assigning to 'await' in strict mode (1:0)" + "SyntaxError: Can not use keyword 'await' outside an async function (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 3226ef913449..cc297fab6b9f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Can not use keyword 'await' outside an async function (1:6)", - "SyntaxError: Binding 'await' in strict mode (1:6)" + "SyntaxError: Can not use keyword 'await' outside an async function (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 daf692a19d1d..1bbb6a10ec2c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Can not use keyword 'await' outside an async function (1:8)", - "SyntaxError: Binding 'await' in strict mode (1:8)" + "SyntaxError: Can not use keyword 'await' outside an async function (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 eb316d5a818b..8734398fed74 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Can not use keyword 'await' outside an async function (1:15)", - "SyntaxError: Binding 'await' in strict mode (1:15)" + "SyntaxError: Can not use keyword 'await' outside an async function (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 36280a36621b..9f69841ee631 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Can not use keyword 'await' outside an async function (1:9)", - "SyntaxError: Binding 'await' in strict mode (1:9)" + "SyntaxError: Can not use keyword 'await' outside an async function (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 84af037a102a..12f2a4f35608 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Can not use keyword 'await' outside an async function (1:6)", - "SyntaxError: Binding 'await' in strict mode (1:6)" + "SyntaxError: Can not use keyword 'await' outside an async function (1:6)" ], "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 d51874f8f22c..7f7235704637 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:0)", - "SyntaxError: Assigning to 'enum' in strict mode (1:0)" + "SyntaxError: Unexpected reserved word 'enum' (1:0)" ], "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 96cc1332f046..c6e70262550d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)", - "SyntaxError: Binding 'enum' in strict mode (1:6)" + "SyntaxError: Unexpected reserved word 'enum' (1:6)" ], "program": { "type": "Program", 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 3b9e20a45001..f906a9f99eba 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:8)", - "SyntaxError: Binding 'enum' in strict mode (1:8)" + "SyntaxError: Unexpected reserved word 'enum' (1:8)" ], "program": { "type": "Program", 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 c42ad32ffcb1..9ad60d6cf403 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:15)", - "SyntaxError: Binding 'enum' in strict mode (1:15)" + "SyntaxError: Unexpected reserved word 'enum' (1:15)" ], "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 5d669da1b826..7a06864215ea 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:9)", - "SyntaxError: Binding 'enum' in strict mode (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 e2deffa5b87d..04f287aef702 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)", - "SyntaxError: Binding 'enum' in strict mode (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 afe72915c3f3..0619ba17f596 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:6)", - "SyntaxError: Binding 'enum' in strict mode (1:6)" + "SyntaxError: Unexpected reserved word 'enum' (1:6)" ], "program": { "type": "Program", 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 eccf3f74e5a2..19d96b67a349 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (2:9)", - "SyntaxError: Binding 'yield' in strict mode (2:9)" + "SyntaxError: Unexpected reserved word 'yield' (2:9)" ], "program": { "type": "Program", 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 ce1937133385..ac0ac6a92f89 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (2:12)", - "SyntaxError: Binding 'yield' in strict mode (2:12)" + "SyntaxError: Unexpected reserved word 'yield' (2:12)" ], "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 884428945f9d..273c4fcdf066 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:25)", - "SyntaxError: Binding 'yield' in strict mode (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-strict-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-strict-function-expression/output.json index 2ff01fa39674..b1b8b4f0880d 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:46)", - "SyntaxError: Binding 'yield' in strict mode (1:46)" + "SyntaxError: Unexpected reserved word 'yield' (1:46)" ], "program": { "type": "Program", 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 ce4b71676c3a..40d206249a26 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:47)", - "SyntaxError: Binding 'yield' in strict mode (1:47)" + "SyntaxError: Unexpected reserved word 'yield' (1:47)" ], "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 22b8f61b28c5..4a0cd5664566 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:16)", - "SyntaxError: Assigning to 'yield' in strict mode (1:16)" + "SyntaxError: Unexpected reserved word 'yield' (1:16)" ], "program": { "type": "Program", 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 d646272c9402..06d787bb4992 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:23)", - "SyntaxError: Binding 'yield' in strict mode (1:23)" + "SyntaxError: Unexpected reserved word 'yield' (1:23)" ], "program": { "type": "Program", 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 ab8117bb07ce..2b7952b2afe7 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:28)", - "SyntaxError: Binding 'yield' in strict mode (1:28)" + "SyntaxError: Unexpected reserved word 'yield' (1:28)" ], "program": { "type": "Program", 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 b1af37211882..f936dc48abf9 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:25)", - "SyntaxError: Binding 'yield' in strict mode (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-strict-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-strict-lexical-declaration/output.json index 11e6c19eb5b9..71c86eec827d 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:18)", - "SyntaxError: Binding 'yield' in strict mode (1:18)" + "SyntaxError: Unexpected reserved word 'yield' (1:18)" ], "program": { "type": "Program", 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 ec7a987deed9..d246bfc86e6e 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:28)", - "SyntaxError: Binding 'yield' in strict mode (1:28)" + "SyntaxError: Unexpected reserved word 'yield' (1:28)" ], "program": { "type": "Program", 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 925a7247ad47..0561e522bd7b 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:18)", - "SyntaxError: Binding 'yield' in strict mode (1:18)" + "SyntaxError: Unexpected reserved word 'yield' (1:18)" ], "program": { "type": "Program", 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 0f64682a8eb0..2201ea3de8c6 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'implements' (1:37)", - "SyntaxError: Binding 'implements' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'implements' (1:37)" ], "program": { "type": "Program", 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 8222afc6a0e6..be76deabc7a1 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'interface' (1:37)", - "SyntaxError: Binding 'interface' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'interface' (1:37)" ], "program": { "type": "Program", 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 f977c4c528e0..414e229fac38 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'package' (1:37)", - "SyntaxError: Binding 'package' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'package' (1:37)" ], "program": { "type": "Program", 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 b1147bbff4e1..32efcd46a632 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'private' (1:37)", - "SyntaxError: Binding 'private' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'private' (1:37)" ], "program": { "type": "Program", 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 1b1c3bcecf8b..e3d3f255c253 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'protected' (1:37)", - "SyntaxError: Binding 'protected' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'protected' (1:37)" ], "program": { "type": "Program", 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 8c06677a9156..2e801038c78d 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'public' (1:37)", - "SyntaxError: Binding 'public' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'public' (1:37)" ], "program": { "type": "Program", 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 12f9d4d5420d..4ed420518d6d 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:37)", - "SyntaxError: Binding 'static' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'static' (1:37)" ], "program": { "type": "Program", 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 7681159b6cbd..55dc17f91beb 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:37)", - "SyntaxError: Binding 'yield' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'yield' (1:37)" ], "program": { "type": "Program", 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 bd47f7c95bef..3b946aeb3223 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'let' (1:37)", - "SyntaxError: Binding 'let' in strict mode (1:37)" + "SyntaxError: Unexpected reserved word 'let' (1:37)" ], "program": { "type": "Program", 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 55fdd400dee8..c249f39209bf 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'static' (1:23)", - "SyntaxError: Binding 'static' in strict mode (1:23)" + "SyntaxError: Unexpected reserved word 'static' (1:23)" ], "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 52f289f37f98..df10adea166e 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'enum' (1:11)", - "SyntaxError: Binding 'enum' in strict mode (1:11)" + "SyntaxError: Unexpected reserved word 'enum' (1:11)" ], "program": { "type": "Program", From 1ae5ada97688539e39463ab73295c01adfe2101d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 21:08:32 +0200 Subject: [PATCH 12/29] Remove duplicated error about yield/await inside params --- packages/babel-parser/src/parser/expression.js | 10 ++++------ .../output.json | 4 +--- .../parameter-default-inside-generator/output.json | 3 +-- .../output.json | 3 +-- .../await-inside-parameters/output.json | 3 +-- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index d724ce08262a..fbc40c422d0e 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -2226,9 +2226,6 @@ export default class ExpressionParser extends LValParser { // Parses await expression inside async function. parseAwait(): N.AwaitExpression { - if (this.state.awaitPos === -1) { - this.state.awaitPos = this.state.start; - } const node = this.startNode(); this.next(); @@ -2238,6 +2235,8 @@ export default class ExpressionParser extends LValParser { node.start, "await is not allowed in async function parameters", ); + } else if (this.state.awaitPos === -1) { + this.state.awaitPos = node.start; } if (this.eat(tt.star)) { this.raise( @@ -2279,13 +2278,12 @@ export default class ExpressionParser extends LValParser { // Parses yield expression inside generator. parseYield(noIn?: ?boolean): N.YieldExpression { - if (this.state.yieldPos === -1) { - this.state.yieldPos = this.state.start; - } const node = this.startNode(); if (this.state.inParameters) { this.raise(node.start, "yield is not allowed in generator parameters"); + } else if (this.state.yieldPos === -1) { + this.state.yieldPos = node.start; } this.next(); 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 4a1eedc0abfe..a2234a6938db 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 @@ -13,9 +13,7 @@ } }, "errors": [ - "SyntaxError: yield is not allowed in generator parameters (1:15)", - "SyntaxError: Yield cannot be used as name inside a generator function (1:15)", - "SyntaxError: Yield cannot be used as name inside a generator function (1:15)" + "SyntaxError: yield is not allowed in generator 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 e27657c1aa93..b21c88bc4f9f 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: yield is not allowed in generator parameters (1:17)", - "SyntaxError: Yield cannot be used as name inside a generator function (1:17)" + "SyntaxError: yield is not allowed in generator parameters (1:17)" ], "program": { "type": "Program", 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 f3dded193720..77a0a58b8e3b 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 @@ -14,8 +14,7 @@ }, "errors": [ "SyntaxError: yield is not allowed in generator parameters (1:17)", - "SyntaxError: yield is not allowed in generator parameters (1:24)", - "SyntaxError: Yield cannot be used as name inside a generator function (1:17)" + "SyntaxError: yield is not allowed in generator parameters (1:24)" ], "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 e566a0f08075..be635254c883 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: await is not allowed in async function parameters (1:22)", - "SyntaxError: Await cannot be used as name inside an async function (1:22)" + "SyntaxError: await is not allowed in async function parameters (1:22)" ], "program": { "type": "Program", From f9a869d1864aa0e8ff35071e706119a3cd762ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 21:27:05 +0200 Subject: [PATCH 13/29] Don't error twice for methods in object patterns --- packages/babel-parser/src/parser/lval.js | 5 ++++ .../es2015/uncategorised/223/output.json | 3 +- .../es2015/uncategorised/298/output.json | 3 +- .../output.json | 3 +- .../invalid-pattern-with-method/input.js | 2 +- .../invalid-pattern-with-method/output.json | 30 +++++++++---------- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index c8dc31b39eaf..6bfab47b5d03 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -411,6 +411,11 @@ export default class LValParser extends NodeUtils { case "ObjectPattern": for (let prop of expr.properties) { if (prop.type === "ObjectProperty") prop = prop.value; + // If we find here an ObjectMethod, it's because this was originally + // an ObjectExpression which has then been converted. + // toAssignable already reported this error with a nicer message. + else if (prop.type === "ObjectMethod") continue; + this.checkLVal( prop, bindingType, 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 5869dc9d8e95..426006b7cdfb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Object pattern can't contain getter or setter (1:8)", - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)" + "SyntaxError: Object pattern can't contain getter or setter (1:8)" ], "program": { "type": "Program", 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 5300255c00f5..fd0a014544e3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Object pattern can't contain getter or setter (1:7)", - "SyntaxError: Binding invalid left-hand side in object destructuring pattern (1:3)" + "SyntaxError: Object pattern can't contain getter or setter (1:7)" ], "program": { "type": "Program", 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 cfd6fd2fb6af..d391e09c2dfe 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Object pattern can't contain getter or setter (1:6)", - "SyntaxError: Binding invalid left-hand side in object destructuring pattern (1:2)" + "SyntaxError: Object pattern can't contain getter or setter (1:6)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/input.js b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/input.js index 1dcb7ce683e6..dd21753e3550 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/input.js +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/invalid-pattern-with-method/input.js @@ -1 +1 @@ -({a(){}})=0 +({a(){}}=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 5fca3277888c..4f63aa8f3c12 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 @@ -13,9 +13,7 @@ } }, "errors": [ - "SyntaxError: Object pattern can't contain methods (1:2)", - "SyntaxError: Invalid left-hand side in object destructuring pattern (1:2)", - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" + "SyntaxError: Object pattern can't contain methods (1:2)" ], "program": { "type": "Program", @@ -50,16 +48,16 @@ }, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 11, + "start": 1, + "end": 10, "loc": { "start": { "line": 1, - "column": 0 + "column": 1 }, "end": { "line": 1, - "column": 11 + "column": 10 } }, "operator": "=", @@ -134,24 +132,20 @@ "directives": [] } } - ], - "extra": { - "parenthesized": true, - "parenStart": 0 - } + ] }, "right": { "type": "NumericLiteral", - "start": 10, - "end": 11, + "start": 9, + "end": 10, "loc": { "start": { "line": 1, - "column": 10 + "column": 9 }, "end": { "line": 1, - "column": 11 + "column": 10 } }, "extra": { @@ -159,6 +153,10 @@ "raw": "0" }, "value": 0 + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } } } From 86b6275fa1cb1b03d00e42d7870249d105d8e48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 21:34:28 +0200 Subject: [PATCH 14/29] Don't report invalid super() twice --- packages/babel-parser/src/parser/expression.js | 15 ++++++++------- .../invalid_super_not_inside_function/output.json | 1 - 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index fbc40c422d0e..d49a195d99be 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -905,13 +905,6 @@ export default class ExpressionParser extends LValParser { switch (this.state.type) { case tt._super: - if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) { - this.raise( - this.state.start, - "super is only allowed in object methods and classes", - ); - } - node = this.startNode(); this.next(); if ( @@ -924,6 +917,14 @@ export default class ExpressionParser extends LValParser { "super() is only valid inside a class constructor of a subclass. " + "Maybe a typo in the method name ('constructor') or not extending another class?", ); + } else if ( + !this.scope.allowSuper && + !this.options.allowSuperOutsideMethod + ) { + this.raise( + node.start, + "super is only allowed in object methods and classes", + ); } if ( 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 88a5ff1cee1b..94b7917cd389 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 @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: super is only allowed in object methods and classes (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": { From 3b44131f93bfb69ff47b8b63fbdfadc7ac41aa70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 21:40:18 +0200 Subject: [PATCH 15/29] Remove dup error about reserved param for expr arrows --- packages/babel-parser/src/parser/expression.js | 2 +- .../invalid-yield-strict-arrow-parameter-name/output.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index d49a195d99be..dd691f6d98a3 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1937,7 +1937,7 @@ export default class ExpressionParser extends LValParser { if (isExpression) { node.body = this.parseMaybeAssign(); - this.checkParams(node, false, allowExpression); + this.checkParams(node, false, allowExpression, false); } else { const nonSimple = !this.isSimpleParamList(node.params); if (!oldStrict || nonSimple) { 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 d4b3ef0768e9..3c5b82bd6c7b 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Unexpected reserved word 'yield' (1:15)", - "SyntaxError: Binding 'yield' in strict mode (1:15)" + "SyntaxError: Unexpected reserved word 'yield' (1:15)" ], "program": { "type": "Program", From 3497179558494d68a563439fa6b87ccb24aa0e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 21:46:56 +0200 Subject: [PATCH 16/29] Remove double escapes in migrated tests --- .../invalid-syntax/migrated_0033/input.js | 2 +- .../invalid-syntax/migrated_0033/output.json | 23 +++++++------- .../invalid-syntax/migrated_0034/input.js | 2 +- .../invalid-syntax/migrated_0034/output.json | 23 +++++++------- .../invalid-syntax/migrated_0036/input.js | 2 +- .../invalid-syntax/migrated_0036/output.json | 25 ++++++++-------- .../invalid-syntax/migrated_0037/input.js | 2 +- .../invalid-syntax/migrated_0037/output.json | 25 ++++++++-------- .../invalid-syntax/migrated_0041/input.js | 2 +- .../invalid-syntax/migrated_0041/output.json | 27 ++++++++--------- .../invalid-syntax/migrated_0042/input.js | 2 +- .../invalid-syntax/migrated_0042/output.json | 27 ++++++++--------- .../invalid-syntax/migrated_0043/input.js | 2 +- .../invalid-syntax/migrated_0043/output.json | 28 ++++++++--------- .../invalid-syntax/migrated_0044/input.js | 2 +- .../invalid-syntax/migrated_0044/output.json | 30 +++++++++---------- .../invalid-syntax/migrated_0162/input.js | 2 +- .../invalid-syntax/migrated_0162/output.json | 23 +++++++------- .../invalid-syntax/migrated_0163/input.js | 2 +- .../invalid-syntax/migrated_0163/output.json | 23 +++++++------- .../invalid-syntax/migrated_0165/input.js | 2 +- .../invalid-syntax/migrated_0165/output.json | 23 +++++++------- .../invalid-syntax/migrated_0169/input.js | 2 +- 23 files changed, 144 insertions(+), 157 deletions(-) diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/input.js index fff580f2044f..0d9e932087f0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/input.js @@ -1 +1 @@ -x\\u005c +x\u005c 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 78c84a7def24..fae32b78cde4 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 8, + "end": 7, "loc": { "start": { "line": 1, @@ -9,17 +9,16 @@ }, "end": { "line": 1, - "column": 8 + "column": 7 } }, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)", - "SyntaxError: Invalid Unicode escape (1:2)" + "SyntaxError: Invalid Unicode escape (1:1)" ], "program": { "type": "Program", "start": 0, - "end": 8, + "end": 7, "loc": { "start": { "line": 1, @@ -27,7 +26,7 @@ }, "end": { "line": 1, - "column": 8 + "column": 7 } }, "sourceType": "script", @@ -36,7 +35,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 8, + "end": 7, "loc": { "start": { "line": 1, @@ -44,13 +43,13 @@ }, "end": { "line": 1, - "column": 8 + "column": 7 } }, "expression": { "type": "Identifier", "start": 0, - "end": 8, + "end": 7, "loc": { "start": { "line": 1, @@ -58,11 +57,11 @@ }, "end": { "line": 1, - "column": 8 + "column": 7 }, - "identifierName": "xx\\\\" + "identifierName": "x\\" }, - "name": "xx\\\\" + "name": "x\\" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/input.js index 17112246786b..2999f29197cd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/input.js @@ -1 +1 @@ -x\\u002a +x\u002a 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 9ad34de54933..37312f42ce97 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 8, + "end": 7, "loc": { "start": { "line": 1, @@ -9,17 +9,16 @@ }, "end": { "line": 1, - "column": 8 + "column": 7 } }, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)", - "SyntaxError: Invalid Unicode escape (1:2)" + "SyntaxError: Invalid Unicode escape (1:1)" ], "program": { "type": "Program", "start": 0, - "end": 8, + "end": 7, "loc": { "start": { "line": 1, @@ -27,7 +26,7 @@ }, "end": { "line": 1, - "column": 8 + "column": 7 } }, "sourceType": "script", @@ -36,7 +35,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 8, + "end": 7, "loc": { "start": { "line": 1, @@ -44,13 +43,13 @@ }, "end": { "line": 1, - "column": 8 + "column": 7 } }, "expression": { "type": "Identifier", "start": 0, - "end": 8, + "end": 7, "loc": { "start": { "line": 1, @@ -58,11 +57,11 @@ }, "end": { "line": 1, - "column": 8 + "column": 7 }, - "identifierName": "xx\\*" + "identifierName": "x*" }, - "name": "xx\\*" + "name": "x*" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/input.js index 3177052a225a..9cfc5e1cb357 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/input.js @@ -1 +1 @@ -a\\u +a\u 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 9eb536d497f9..51c4f09331bb 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 4, + "end": 3, "loc": { "start": { "line": 1, @@ -9,18 +9,17 @@ }, "end": { "line": 1, - "column": 4 + "column": 3 } }, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)", - "SyntaxError: Bad character escape sequence (1:4)", - "SyntaxError: Invalid Unicode escape (1:2)" + "SyntaxError: Bad character escape sequence (1:3)", + "SyntaxError: Invalid Unicode escape (1:1)" ], "program": { "type": "Program", "start": 0, - "end": 4, + "end": 3, "loc": { "start": { "line": 1, @@ -28,7 +27,7 @@ }, "end": { "line": 1, - "column": 4 + "column": 3 } }, "sourceType": "script", @@ -37,7 +36,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 4, + "end": 3, "loc": { "start": { "line": 1, @@ -45,13 +44,13 @@ }, "end": { "line": 1, - "column": 4 + "column": 3 } }, "expression": { "type": "Identifier", "start": 0, - "end": 4, + "end": 3, "loc": { "start": { "line": 1, @@ -59,11 +58,11 @@ }, "end": { "line": 1, - "column": 4 + "column": 3 }, - "identifierName": "aa\\\u0000" + "identifierName": "a\u0000" }, - "name": "aa\\\u0000" + "name": "a\u0000" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/input.js index d56d7c190d02..fa959cc0ecce 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/input.js @@ -1 +1 @@ -\\ua +\ua 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 850f07e0f4bc..db51cc83a543 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 4, + "end": 3, "loc": { "start": { "line": 1, @@ -9,18 +9,17 @@ }, "end": { "line": 1, - "column": 4 + "column": 3 } }, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)", - "SyntaxError: Bad character escape sequence (1:3)", - "SyntaxError: Invalid Unicode escape (1:1)" + "SyntaxError: Bad character escape sequence (1:2)", + "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", "start": 0, - "end": 4, + "end": 3, "loc": { "start": { "line": 1, @@ -28,7 +27,7 @@ }, "end": { "line": 1, - "column": 4 + "column": 3 } }, "sourceType": "script", @@ -37,7 +36,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 4, + "end": 3, "loc": { "start": { "line": 1, @@ -45,13 +44,13 @@ }, "end": { "line": 1, - "column": 4 + "column": 3 } }, "expression": { "type": "Identifier", "start": 0, - "end": 4, + "end": 3, "loc": { "start": { "line": 1, @@ -59,11 +58,11 @@ }, "end": { "line": 1, - "column": 4 + "column": 3 }, - "identifierName": "\\\u0000" + "identifierName": "\u0000" }, - "name": "\\\u0000" + "name": "\u0000" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/input.js index 9a2dc1767685..7f54fa707500 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/input.js @@ -1 +1 @@ -var x = /[a-z]/\\ux +var x = /[a-z]/\ux 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 76ef6d90fe84..68d637a98170 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 19, + "end": 18, "loc": { "start": { "line": 1, @@ -9,18 +9,17 @@ }, "end": { "line": 1, - "column": 19 + "column": 18 } }, "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:18)" ], "program": { "type": "Program", "start": 0, - "end": 19, + "end": 18, "loc": { "start": { "line": 1, @@ -28,7 +27,7 @@ }, "end": { "line": 1, - "column": 19 + "column": 18 } }, "sourceType": "script", @@ -37,7 +36,7 @@ { "type": "VariableDeclaration", "start": 0, - "end": 19, + "end": 18, "loc": { "start": { "line": 1, @@ -45,14 +44,14 @@ }, "end": { "line": 1, - "column": 19 + "column": 18 } }, "declarations": [ { "type": "VariableDeclarator", "start": 4, - "end": 19, + "end": 18, "loc": { "start": { "line": 1, @@ -60,7 +59,7 @@ }, "end": { "line": 1, - "column": 19 + "column": 18 } }, "id": { @@ -83,7 +82,7 @@ "init": { "type": "RegExpLiteral", "start": 8, - "end": 19, + "end": 18, "loc": { "start": { "line": 1, @@ -91,14 +90,14 @@ }, "end": { "line": 1, - "column": 19 + "column": 18 } }, "extra": { - "raw": "/[a-z]/\\\\ux" + "raw": "/[a-z]/\\ux" }, "pattern": "[a-z]", - "flags": "\\\\ux" + "flags": "\\ux" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/input.js index fdbf86f1d023..e8f66bb867d1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/input.js @@ -1 +1 @@ -var x = /[a-z\n]/\\ux +var x = /[a-z\n]/\ux 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 13b09289cf96..c4e889cefe20 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -9,18 +9,17 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, "errors": [ "SyntaxError: Invalid regular expression flag (1:18)", - "SyntaxError: Invalid regular expression flag (1:19)", - "SyntaxError: Invalid regular expression flag (1:21)" + "SyntaxError: Invalid regular expression flag (1:20)" ], "program": { "type": "Program", "start": 0, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -28,7 +27,7 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, "sourceType": "script", @@ -37,7 +36,7 @@ { "type": "VariableDeclaration", "start": 0, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -45,14 +44,14 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, "declarations": [ { "type": "VariableDeclarator", "start": 4, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -60,7 +59,7 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, "id": { @@ -83,7 +82,7 @@ "init": { "type": "RegExpLiteral", "start": 8, - "end": 21, + "end": 20, "loc": { "start": { "line": 1, @@ -91,14 +90,14 @@ }, "end": { "line": 1, - "column": 21 + "column": 20 } }, "extra": { - "raw": "/[a-z\\n]/\\\\ux" + "raw": "/[a-z\\n]/\\ux" }, "pattern": "[a-z\\n]", - "flags": "\\\\ux" + "flags": "\\ux" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/input.js index e2a2d371e229..9a2dc1767685 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/input.js @@ -1 +1 @@ -var x = /[a-z]/\\\\ux +var x = /[a-z]/\\ux 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 89e710445090..76ef6d90fe84 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 21, + "end": 19, "loc": { "start": { "line": 1, @@ -9,20 +9,18 @@ }, "end": { "line": 1, - "column": 21 + "column": 19 } }, "errors": [ "SyntaxError: Invalid regular expression flag (1:16)", "SyntaxError: Invalid regular expression flag (1:17)", - "SyntaxError: Invalid regular expression flag (1:18)", - "SyntaxError: Invalid regular expression flag (1:19)", - "SyntaxError: Invalid regular expression flag (1:21)" + "SyntaxError: Invalid regular expression flag (1:19)" ], "program": { "type": "Program", "start": 0, - "end": 21, + "end": 19, "loc": { "start": { "line": 1, @@ -30,7 +28,7 @@ }, "end": { "line": 1, - "column": 21 + "column": 19 } }, "sourceType": "script", @@ -39,7 +37,7 @@ { "type": "VariableDeclaration", "start": 0, - "end": 21, + "end": 19, "loc": { "start": { "line": 1, @@ -47,14 +45,14 @@ }, "end": { "line": 1, - "column": 21 + "column": 19 } }, "declarations": [ { "type": "VariableDeclarator", "start": 4, - "end": 21, + "end": 19, "loc": { "start": { "line": 1, @@ -62,7 +60,7 @@ }, "end": { "line": 1, - "column": 21 + "column": 19 } }, "id": { @@ -85,7 +83,7 @@ "init": { "type": "RegExpLiteral", "start": 8, - "end": 21, + "end": 19, "loc": { "start": { "line": 1, @@ -93,14 +91,14 @@ }, "end": { "line": 1, - "column": 21 + "column": 19 } }, "extra": { - "raw": "/[a-z]/\\\\\\\\ux" + "raw": "/[a-z]/\\\\ux" }, "pattern": "[a-z]", - "flags": "\\\\\\\\ux" + "flags": "\\\\ux" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/input.js index fc48dffd74dc..405b48568aa8 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/input.js @@ -1 +1 @@ -var x = /[P QR]/\\\\u0067 +var x = /[P QR]/\\u0067 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 968729f24cff..430d18e24eac 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 25, + "end": 23, "loc": { "start": { "line": 1, @@ -9,23 +9,21 @@ }, "end": { "line": 1, - "column": 25 + "column": 23 } }, "errors": [ "SyntaxError: Invalid regular expression flag (1:17)", "SyntaxError: Invalid regular expression flag (1:18)", - "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:23)", - "SyntaxError: Invalid regular expression flag (1:24)", - "SyntaxError: Invalid regular expression flag (1:25)" + "SyntaxError: Invalid regular expression flag (1:23)" ], "program": { "type": "Program", "start": 0, - "end": 25, + "end": 23, "loc": { "start": { "line": 1, @@ -33,7 +31,7 @@ }, "end": { "line": 1, - "column": 25 + "column": 23 } }, "sourceType": "script", @@ -42,7 +40,7 @@ { "type": "VariableDeclaration", "start": 0, - "end": 25, + "end": 23, "loc": { "start": { "line": 1, @@ -50,14 +48,14 @@ }, "end": { "line": 1, - "column": 25 + "column": 23 } }, "declarations": [ { "type": "VariableDeclarator", "start": 4, - "end": 25, + "end": 23, "loc": { "start": { "line": 1, @@ -65,7 +63,7 @@ }, "end": { "line": 1, - "column": 25 + "column": 23 } }, "id": { @@ -88,7 +86,7 @@ "init": { "type": "RegExpLiteral", "start": 8, - "end": 25, + "end": 23, "loc": { "start": { "line": 1, @@ -96,14 +94,14 @@ }, "end": { "line": 1, - "column": 25 + "column": 23 } }, "extra": { - "raw": "/[P QR]/\\\\\\\\u0067" + "raw": "/[P QR]/\\\\u0067" }, "pattern": "[P QR]", - "flags": "\\\\\\\\u0067" + "flags": "\\\\u0067" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/input.js index adcf3cef4357..57ddad2aec5d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/input.js @@ -1 +1 @@ -\\ +\ 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 1db488318bdf..8644ccf99c0e 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 2, + "end": 1, "loc": { "start": { "line": 1, @@ -9,17 +9,16 @@ }, "end": { "line": 1, - "column": 2 + "column": 1 } }, "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)" ], "program": { "type": "Program", "start": 0, - "end": 2, + "end": 1, "loc": { "start": { "line": 1, @@ -27,7 +26,7 @@ }, "end": { "line": 1, - "column": 2 + "column": 1 } }, "sourceType": "script", @@ -36,7 +35,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 2, + "end": 1, "loc": { "start": { "line": 1, @@ -44,13 +43,13 @@ }, "end": { "line": 1, - "column": 2 + "column": 1 } }, "expression": { "type": "Identifier", "start": 0, - "end": 2, + "end": 1, "loc": { "start": { "line": 1, @@ -58,11 +57,11 @@ }, "end": { "line": 1, - "column": 2 + "column": 1 }, - "identifierName": "\\\\\\" + "identifierName": "\\" }, - "name": "\\\\\\" + "name": "\\" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/input.js index b9e12b2eff54..65bd7cf67b3f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/input.js @@ -1 +1 @@ -\\u005c +\u005c 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 566db54902a1..d44909ca998a 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 7, + "end": 6, "loc": { "start": { "line": 1, @@ -9,17 +9,16 @@ }, "end": { "line": 1, - "column": 7 + "column": 6 } }, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)", - "SyntaxError: Invalid Unicode escape (1:1)" + "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", "start": 0, - "end": 7, + "end": 6, "loc": { "start": { "line": 1, @@ -27,7 +26,7 @@ }, "end": { "line": 1, - "column": 7 + "column": 6 } }, "sourceType": "script", @@ -36,7 +35,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 7, + "end": 6, "loc": { "start": { "line": 1, @@ -44,13 +43,13 @@ }, "end": { "line": 1, - "column": 7 + "column": 6 } }, "expression": { "type": "Identifier", "start": 0, - "end": 7, + "end": 6, "loc": { "start": { "line": 1, @@ -58,11 +57,11 @@ }, "end": { "line": 1, - "column": 7 + "column": 6 }, - "identifierName": "\\\\" + "identifierName": "\\" }, - "name": "\\\\" + "name": "\\" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/input.js index a6e819ccd18b..ecb0a859c956 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/input.js @@ -1 +1 @@ -\\u0000 +\u0000 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 b99a3f035e40..380e6ec698ef 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 @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 7, + "end": 6, "loc": { "start": { "line": 1, @@ -9,17 +9,16 @@ }, "end": { "line": 1, - "column": 7 + "column": 6 } }, "errors": [ - "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)", - "SyntaxError: Invalid Unicode escape (1:1)" + "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", "start": 0, - "end": 7, + "end": 6, "loc": { "start": { "line": 1, @@ -27,7 +26,7 @@ }, "end": { "line": 1, - "column": 7 + "column": 6 } }, "sourceType": "script", @@ -36,7 +35,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 7, + "end": 6, "loc": { "start": { "line": 1, @@ -44,13 +43,13 @@ }, "end": { "line": 1, - "column": 7 + "column": 6 } }, "expression": { "type": "Identifier", "start": 0, - "end": 7, + "end": 6, "loc": { "start": { "line": 1, @@ -58,11 +57,11 @@ }, "end": { "line": 1, - "column": 7 + "column": 6 }, - "identifierName": "\\\u0000" + "identifierName": "\u0000" }, - "name": "\\\u0000" + "name": "\u0000" } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/input.js b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/input.js index 2775e915bb92..1ef32f79a66e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/input.js +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0169/input.js @@ -1 +1 @@ -"\\u +"\u From cfc136322ee0db59df3fa607ed919ccc6b5ddec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 21:59:36 +0200 Subject: [PATCH 17/29] Dedupe errors about invalid escapes in identifiers --- packages/babel-parser/src/tokenizer/index.js | 13 +++++-------- .../invalid-syntax/migrated_0036/output.json | 7 +++---- .../invalid-syntax/migrated_0037/output.json | 7 +++---- .../invalid-syntax/migrated_0049/output.json | 7 +++---- .../invalid-syntax/migrated_0050/output.json | 7 +++---- .../invalid-syntax/migrated_0051/output.json | 7 +++---- 6 files changed, 20 insertions(+), 28 deletions(-) diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index a3cd44efe1ee..fb0b71dfcd36 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -1371,16 +1371,13 @@ export default class Tokenizer extends LocationParser { ++this.state.pos; const esc = this.readCodePoint(true); + if (esc !== null) { + if (!identifierCheck(esc)) { + this.raise(escStart, "Invalid Unicode escape"); + } - if ( - // $FlowFixMe (thinks esc may be null, but throwOnInvalid is true) - !identifierCheck(esc, true) - ) { - this.raise(escStart, "Invalid Unicode escape"); + word += String.fromCodePoint(esc); } - - // $FlowFixMe - word += String.fromCodePoint(esc); chunkStart = this.state.pos; } else { break; 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 51c4f09331bb..3fa5e0bfd57d 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)", - "SyntaxError: Invalid Unicode escape (1:1)" + "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", @@ -60,9 +59,9 @@ "line": 1, "column": 3 }, - "identifierName": "a\u0000" + "identifierName": "a" }, - "name": "a\u0000" + "name": "a" } } ], 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 db51cc83a543..be5c03381dd1 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Bad character escape sequence (1:2)", - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Bad character escape sequence (1:2)" ], "program": { "type": "Program", @@ -60,9 +59,9 @@ "line": 1, "column": 3 }, - "identifierName": "\u0000" + "identifierName": "" }, - "name": "\u0000" + "name": "" } } ], 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 6fe9c4b279b0..9d206b4f8475 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)", - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", @@ -60,9 +59,9 @@ "line": 1, "column": 4 }, - "identifierName": "\u0000" + "identifierName": "" }, - "name": "\u0000" + "name": "" } } ], 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 4a040c981dd0..252665de0e5e 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)", - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", @@ -60,9 +59,9 @@ "line": 1, "column": 7 }, - "identifierName": "\u0000FFF" + "identifierName": "FFF" }, - "name": "\u0000FFF" + "name": "FFF" } } ], 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 f9a3a9bde958..2c27554ffa56 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Bad character escape sequence (1:3)", - "SyntaxError: Invalid Unicode escape (1:0)" + "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", @@ -60,9 +59,9 @@ "line": 1, "column": 7 }, - "identifierName": "\u0000" + "identifierName": "" }, - "name": "\u0000" + "name": "" } } ], From 8316a6a01834f742bec98995aa680bd4be706046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 22:28:52 +0200 Subject: [PATCH 18/29] Remove duplicated error about decorated constructor --- packages/babel-parser/src/parser/statement.js | 7 ------- .../decorators-2/no-constructor-decorators/output.json | 1 - .../decorators/no-constructor-decorators/output.json | 1 - 3 files changed, 9 deletions(-) diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 6d1356c01186..827cedfbd7d9 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1361,13 +1361,6 @@ export default class StatementParser extends ExpressionParser { if (isConstructor) { publicMethod.kind = "constructor"; - if (publicMethod.decorators) { - this.raise( - publicMethod.start, - "You can't attach decorators to a class constructor", - ); - } - // TypeScript allows multiple overloaded constructor declarations. if (state.hadConstructor && !this.hasPlugin("typescript")) { this.raise(key.start, "Duplicate constructor in the same class"); diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json index c6d81bd74bd6..084e74570676 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: You can't attach decorators to a class constructor (2:2)", "SyntaxError: Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json index c6d81bd74bd6..084e74570676 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json @@ -13,7 +13,6 @@ } }, "errors": [ - "SyntaxError: You can't attach decorators to a class constructor (2:2)", "SyntaxError: Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)" ], "program": { From 1eabd2869a2476e21b769f8aea997c4cad93d397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 22:54:33 +0200 Subject: [PATCH 19/29] Remove duplicated error about spread in flow class --- packages/babel-parser/src/plugins/flow.js | 2 +- .../explicit_inexact_disallowed_in_non_objects1/output.json | 3 +-- .../explicit_inexact_disallowed_in_non_objects2/output.json | 3 +-- .../explicit_inexact_disallowed_in_non_objects5/output.json | 3 +-- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 569175ad217c..2a55904fde8b 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -1009,7 +1009,7 @@ export default (superClass: Class): Class => const isInexactToken = this.eat(tt.comma) || this.eat(tt.semi); if (this.match(tt.braceR)) { - if (!allowInexact) { + if (allowSpread && !allowInexact) { this.raise( this.state.start, "Explicit inexact syntax is only allowed inside inexact objects", 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 55a902eabcc2..ab3242a751f9 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Spread operator cannot appear in class or interface definitions (3:2)", - "SyntaxError: Explicit inexact syntax is only allowed inside inexact objects (4:0)" + "SyntaxError: Spread operator cannot appear in class or interface definitions (3:2)" ], "program": { "type": "Program", 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 606719c4d035..c07feee93628 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Spread operator cannot appear in class or interface definitions (4:2)", - "SyntaxError: Explicit inexact syntax is only allowed inside inexact objects (5:0)" + "SyntaxError: Spread operator cannot appear in class or interface definitions (4:2)" ], "program": { "type": "Program", 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 03bb789a85bb..52ab18c0ae4c 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 @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Spread operator cannot appear in class or interface definitions (4:2)", - "SyntaxError: Explicit inexact syntax is only allowed inside inexact objects (5:0)" + "SyntaxError: Spread operator cannot appear in class or interface definitions (4:2)" ], "program": { "type": "Program", From 050ceb46306c6b195e5f1c6ed51d92c413c01415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 23:32:58 +0200 Subject: [PATCH 20/29] Don't throw for invalid super usage --- .../babel-parser/src/parser/expression.js | 6 +- .../malformed-super-expression/options.json | 3 - .../malformed-super-expression/output.json | 211 ++++++++++++++++ .../es2015/uncategorised/344/options.json | 3 - .../es2015/uncategorised/344/output.json | 69 ++++++ .../options.json | 3 +- .../optional-super-property-class/output.json | 209 ++++++++++++++++ .../optional-super-property/options.json | 3 +- .../optional-super-property/output.json | 226 ++++++++++++++++++ 9 files changed, 722 insertions(+), 11 deletions(-) delete mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json delete mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index dd691f6d98a3..a795935daab4 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -932,7 +932,11 @@ export default class ExpressionParser extends LValParser { !this.match(tt.bracketL) && !this.match(tt.dot) ) { - this.unexpected(); + this.raise( + node.start, + "super can only be used with function calls (i.e. super()) or " + + "in property accesses (i.e. super.prop or super[prop])", + ); } return this.finishNode(node, "Super"); diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/options.json b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/options.json deleted file mode 100644 index dc41f0b14b5a..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (3:10)" -} 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 new file mode 100644 index 000000000000..6ecafb90e3ab --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json @@ -0,0 +1,211 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "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": 39, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 23, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 23, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "left": { + "type": "Super", + "start": 23, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + "operator": "-", + "right": { + "type": "NumericLiteral", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json deleted file mode 100644 index 0ab445fe47b8..000000000000 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Unexpected token (1:5)" -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json new file mode 100644 index 000000000000..ee3b4cb3552b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json @@ -0,0 +1,69 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "expression": { + "type": "Super", + "start": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json index 86849e8c464a..fd201c1bdb02 100644 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json @@ -1,4 +1,3 @@ { - "plugins": ["optionalChaining"], - "throws": "Unexpected token (3:20)" + "plugins": ["optionalChaining"] } diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json new file mode 100644 index 000000000000..1f9545412a7a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json @@ -0,0 +1,209 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "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": 7, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 13, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 26, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "argument": { + "type": "OptionalMemberExpression", + "start": 33, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "object": { + "type": "Super", + "start": 33, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 20 + } + } + }, + "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 + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json index 86849e8c464a..fd201c1bdb02 100644 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json @@ -1,4 +1,3 @@ { - "plugins": ["optionalChaining"], - "throws": "Unexpected token (3:20)" + "plugins": ["optionalChaining"] } diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json new file mode 100644 index 000000000000..548b5c32d5a7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json @@ -0,0 +1,226 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 10, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 16, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "method": true, + "key": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 29, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "argument": { + "type": "OptionalMemberExpression", + "start": 36, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 23 + } + }, + "object": { + "type": "Super", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 20 + } + } + }, + "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 + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "kind": "const" + } + ], + "directives": [] + } +} \ No newline at end of file From 78e49463218b97d73d12e7116b72722718229ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 24 Aug 2019 23:41:04 +0200 Subject: [PATCH 21/29] Don't fail for object decorators with stage 2 --- .../babel-parser/src/parser/expression.js | 12 +- .../no-object-methods/options.json | 3 +- .../no-object-methods/output.json | 195 ++++++++++++++++++ 3 files changed, 202 insertions(+), 8 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index a795935daab4..30a24e7f9cc4 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1561,12 +1561,12 @@ export default class ExpressionParser extends LValParser { this.state.start, "Stage 2 decorators disallow object literal property decorators", ); - } else { - // we needn't check if decorators (stage 0) plugin is enabled since it's checked by - // the call to this.parseDecorator - while (this.match(tt.at)) { - decorators.push(this.parseDecorator()); - } + } + + // we needn't check if decorators (stage 0) plugin is enabled since it's checked by + // the call to this.parseDecorator + while (this.match(tt.at)) { + decorators.push(this.parseDecorator()); } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json index 302bc76824f7..69639859c25e 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/options.json @@ -6,6 +6,5 @@ "decoratorsBeforeExport": false } ] - ], - "throws": "Unexpected token (2:2)" + ] } \ No newline at end of file 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 new file mode 100644 index 000000000000..e50713954be0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json @@ -0,0 +1,195 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Stage 2 decorators disallow object literal property decorators (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "o" + }, + "name": "o" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectMethod", + "start": 19, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 13, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "baz" + }, + "name": "baz" + } + } + ], + "method": true, + "key": { + "type": "Identifier", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file From d8c0436c8c79b5b5379202d917a6f239b05ac301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 25 Aug 2019 00:07:57 +0200 Subject: [PATCH 22/29] Fix flow inexact type errors --- packages/babel-parser/src/plugins/flow.js | 72 +++--- .../output.json | 2 +- .../output.json | 2 +- .../options.json | 3 +- .../output.json | 185 ++++++++++++++ .../options.json | 3 +- .../output.json | 238 ++++++++++++++++++ .../output.json | 2 +- .../options.json | 3 +- .../output.json | 185 ++++++++++++++ .../options.json | 3 +- .../output.json | 238 ++++++++++++++++++ .../options.json | 3 +- .../output.json | 182 ++++++++++++++ .../options.json | 3 +- .../output.json | 182 ++++++++++++++ .../options.json | 3 +- .../output.json | 235 +++++++++++++++++ .../options.json | 3 +- .../output.json | 182 ++++++++++++++ .../options.json | 3 +- .../output.json | 230 +++++++++++++++++ 22 files changed, 1913 insertions(+), 49 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 2a55904fde8b..98a5fc9324e4 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -880,6 +880,7 @@ export default (superClass: Class): Class => while (!this.match(endDelim)) { let isStatic = false; let protoStart: ?number = null; + let inexactStart: ?number = null; const node = this.startNode(); if (allowProto && this.isContextual("proto")) { @@ -952,17 +953,29 @@ export default (superClass: Class): Class => variance, kind, allowSpread, - allowInexact, + allowInexact == null ? !exact : allowInexact, ); if (propOrInexact === null) { inexact = true; + inexactStart = this.state.lastTokStart; } else { nodeStart.properties.push(propOrInexact); } } this.flowObjectTypeSemicolon(); + + if ( + inexactStart && + !this.match(tt.braceR) && + !this.match(tt.braceBarR) + ) { + this.raise( + inexactStart, + "Explicit inexact syntax must appear at the end of an inexact object", + ); + } } this.expect(endDelim); @@ -992,10 +1005,38 @@ export default (superClass: Class): Class => allowSpread: boolean, allowInexact: boolean, ): (N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty) | null { - if (this.match(tt.ellipsis)) { + if (this.eat(tt.ellipsis)) { + const isInexactToken = + this.match(tt.comma) || + this.match(tt.semi) || + this.match(tt.braceR) || + this.match(tt.braceBarR); + + if (isInexactToken) { + if (!allowSpread) { + this.raise( + this.state.lastTokStart, + "Explicit inexact syntax cannot appear in class or interface definitions", + ); + } else if (!allowInexact) { + this.raise( + this.state.lastTokStart, + "Explicit inexact syntax cannot appear inside an explicit exact object type", + ); + } + if (variance) { + this.raise( + variance.start, + "Explicit inexact syntax cannot have variance", + ); + } + + return null; + } + if (!allowSpread) { this.raise( - this.state.start, + this.state.lastTokStart, "Spread operator cannot appear in class or interface definitions", ); } @@ -1005,32 +1046,7 @@ export default (superClass: Class): Class => if (variance) { this.raise(variance.start, "Spread properties cannot have variance"); } - this.expect(tt.ellipsis); - const isInexactToken = this.eat(tt.comma) || this.eat(tt.semi); - - if (this.match(tt.braceR)) { - if (allowSpread && !allowInexact) { - this.raise( - this.state.start, - "Explicit inexact syntax is only allowed inside inexact objects", - ); - } - return null; - } - if (this.match(tt.braceBarR)) { - this.unexpected( - null, - "Explicit inexact syntax cannot appear inside an explicit exact object type", - ); - } - - if (isInexactToken) { - this.unexpected( - null, - "Explicit inexact syntax must appear at the end of an inexact object", - ); - } node.argument = this.flowParseType(); return this.finishNode(node, "ObjectTypeSpreadProperty"); } else { 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 ab3242a751f9..f896b9fffbcb 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Spread operator 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", 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 c07feee93628..6a0edc43c316 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Spread operator 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", diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json index b2a58e3017eb..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax must appear at the end of an inexact object (4:2)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..7fa5b4a0b07f --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/output.json @@ -0,0 +1,185 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareClass", + "start": 8, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "C" + }, + "name": "C" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 24, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 35, + "end": 46, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 40, + "end": 46, + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + "variance": null, + "optional": false + } + ], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json index efe48e962e0b..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax must appear at the end of an inexact object (5:2)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..224a0566437c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/output.json @@ -0,0 +1,238 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 64, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareClass", + "start": 8, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "D" + }, + "name": "D" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 24, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 28, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 33, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 13 + } + } + }, + "variance": null, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 50, + "end": 61, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 50, + "end": 53, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 55, + "end": 61, + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 13 + } + } + }, + "variance": null, + "optional": false + } + ], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file 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 52ab18c0ae4c..0f4fe47c8e64 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Spread operator 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", diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json index b2a58e3017eb..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax must appear at the end of an inexact object (4:2)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..685bd5b4d17e --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/output.json @@ -0,0 +1,185 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 8, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "G" + }, + "name": "G" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 20, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 31, + "end": 42, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 31, + "end": 34, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + "variance": null, + "optional": false + } + ], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json index efe48e962e0b..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax must appear at the end of an inexact object (5:2)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..37b85349439d --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/output.json @@ -0,0 +1,238 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 60, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 8, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "H" + }, + "name": "H" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 20, + "end": 60, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 24, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 24, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 13 + } + } + }, + "variance": null, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 46, + "end": 57, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 13 + } + }, + "key": { + "type": "Identifier", + "start": 46, + "end": 49, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 5 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 51, + "end": 57, + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 13 + } + } + }, + "variance": null, + "optional": false + } + ], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json index 49936ac94990..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax cannot appear inside an explicit exact object type (2:29)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..98ff5ceeead4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/output.json @@ -0,0 +1,182 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 8, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "T" + }, + "name": "T" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 17, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 20, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "key": { + "type": "Identifier", + "start": 20, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 23 + } + } + }, + "variance": null, + "optional": false + } + ], + "indexers": [], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json index ebb74417a527..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax must appear at the end of an inexact object (2:15)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..24b9575138dc --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/output.json @@ -0,0 +1,182 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 8, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "T" + }, + "name": "T" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 17, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 23, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "key": { + "type": "Identifier", + "start": 23, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 26 + } + } + }, + "variance": null, + "optional": false + } + ], + "indexers": [], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/options.json index 6d703769bf61..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..8efbd4b84fe9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid1/output.json @@ -0,0 +1,235 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 37 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 8, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "T" + }, + "name": "T" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 17, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "variance": null, + "optional": false + }, + { + "type": "ObjectTypeProperty", + "start": 34, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "key": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 27 + }, + "identifierName": "y" + }, + "name": "y" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 37, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 35 + } + } + }, + "variance": null, + "optional": false + } + ], + "indexers": [], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/options.json index 6d703769bf61..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..fe5b3ee400f9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid2/output.json @@ -0,0 +1,182 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 8, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "U" + }, + "name": "U" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 17, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "variance": null, + "optional": false + } + ], + "indexers": [], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/options.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/options.json index 6d703769bf61..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/options.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/options.json @@ -1,5 +1,4 @@ { "sourceType": "module", - "plugins": ["jsx", "flow"], - "throws": "Explicit inexact syntax must appear at the end of an inexact object (2:26)" + "plugins": ["jsx", "flow"] } 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 new file mode 100644 index 000000000000..0bedbf8f82e4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object_invalid3/output.json @@ -0,0 +1,230 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TypeAlias", + "start": 8, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "V" + }, + "name": "V" + }, + "typeParameters": null, + "right": { + "type": "ObjectTypeAnnotation", + "start": 17, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "callProperties": [], + "properties": [ + { + "type": "ObjectTypeProperty", + "start": 18, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "key": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + }, + "static": false, + "proto": false, + "kind": "init", + "method": false, + "value": { + "type": "NumberTypeAnnotation", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "variance": null, + "optional": false + }, + { + "type": "ObjectTypeSpreadProperty", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "argument": { + "type": "GenericTypeAnnotation", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 29 + }, + "end": { + "line": 2, + "column": 30 + }, + "identifierName": "X" + }, + "name": "X" + } + } + } + ], + "indexers": [], + "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": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": "@flow", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + } + } + ] +} \ No newline at end of file From a5c1c5ca271b0ca601b55dcb2adf6a6b518a78b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 13 Sep 2019 01:28:07 +0200 Subject: [PATCH 23/29] Fix flow --- packages/babel-parser/src/plugins/flow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 98a5fc9324e4..972ff37c4f9c 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -2029,7 +2029,7 @@ export default (superClass: Class): Class => } } - isAssignable(node: Node, isBinding?: boolean): boolean { + isAssignable(node: N.Node, isBinding?: boolean): boolean { switch (node.type) { case "Identifier": case "ObjectPattern": From d9a3f2b00ec4fbf7f62bcdf80728233a22f9785b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 22 Oct 2019 12:37:04 +0200 Subject: [PATCH 24/29] Fix errors about escapes in keywords (ref: #10455) --- .../babel-parser/src/parser/expression.js | 18 ++- packages/babel-parser/src/tokenizer/index.js | 16 +- .../invalid-escape-seq-const/input.js | 2 + .../invalid-escape-seq-const/output.json | 86 ++++++++++- .../invalid-escape-seq-export/input.js | 3 + .../invalid-escape-seq-export/options.json | 3 + .../invalid-escape-seq-export/output.json | 137 +++++++++++++++++- .../invalid-escape-seq-if/output.json | 2 +- .../invalid-escape-seq-import/input.js | 2 + .../invalid-escape-seq-import/options.json | 3 + .../invalid-escape-seq-import/output.json | 54 ++++++- .../invalid-escape-seq-null/output.json | 10 +- .../invalid-escape-seq-true/output.json | 9 +- .../output.json | 9 +- 14 files changed, 304 insertions(+), 50 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json create mode 100644 packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 30a24e7f9cc4..4755a678b8cd 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1394,7 +1394,10 @@ export default class ExpressionParser extends LValParser { parseNew(): N.NewExpression | N.MetaProperty { const node = this.startNode(); - const meta = this.parseIdentifier(true); + + let meta = this.startNode(); + this.next(); + meta = this.createIdentifier(meta, "new"); if (this.eat(tt.dot)) { const metaProp = this.parseMetaProperty(node, meta, "target"); @@ -2103,6 +2106,8 @@ export default class ExpressionParser extends LValParser { // Parse the next token as an identifier. If `liberal` is true (used // when parsing properties), it will also convert keywords into // identifiers. + // This shouldn't be used to parse the keywords of meta properties, since they + // are not identifiers and cannot contain escape sequences. parseIdentifier(liberal?: boolean): N.Identifier { const node = this.startNode(); @@ -2123,11 +2128,6 @@ export default class ExpressionParser extends LValParser { if (this.match(tt.name)) { name = this.state.value; - - // An escaped identifier whose value is the same as a keyword - if (!liberal && this.state.containsEsc && isKeyword(name)) { - this.raise(this.state.pos, `Escape sequence in keyword ${name}`); - } } else if (this.state.type.keyword) { name = this.state.type.keyword; @@ -2147,7 +2147,11 @@ export default class ExpressionParser extends LValParser { throw this.unexpected(); } - if (!liberal) { + if (liberal) { + // If the current token is not used as a keyword, set its type to "tt.name". + // This will prevent this.next() from throwing about unexpected escapes. + this.state.type = tt.name; + } else { this.checkReservedWord( name, this.state.start, diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index fb0b71dfcd36..32c8a03fc0b9 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -126,8 +126,11 @@ export default class Tokenizer extends LocationParser { // Move to the next token next(): void { - if (this.options.tokens && !this.isLookahead) { - this.state.tokens.push(new Token(this.state)); + if (!this.isLookahead) { + this.checkKeywordEscapes(); + if (this.options.tokens) { + this.state.tokens.push(new Token(this.state)); + } } this.state.lastTokEnd = this.state.end; @@ -1395,7 +1398,7 @@ export default class Tokenizer extends LocationParser { readWord(): void { const word = this.readWord1(); - const type = (!this.state.containsEsc && keywordTypes.get(word)) || tt.name; + const type = keywordTypes.get(word) || tt.name; // Allow @@iterator and @@asyncIterator as a identifier only inside type if ( @@ -1408,6 +1411,13 @@ export default class Tokenizer extends LocationParser { this.finishToken(type, word); } + checkKeywordEscapes(): void { + const kw = this.state.type.keyword; + if (kw && this.state.containsEsc) { + this.raise(this.state.start, `Escape sequence in keyword ${kw}`); + } + } + braceIsBlock(prevType: TokenType): boolean { const parent = this.curContext(); if (parent === ct.functionExpression || parent === ct.functionStatement) { diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/input.js b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/input.js index 7db67c0d2dc7..3ec83f02b2f4 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/input.js +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/input.js @@ -1 +1,3 @@ var co\u{6e}st = 123; + +co\u{6e}st x = 2; 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 9b7b38d58487..f5d632c23ace 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 @@ -1,32 +1,34 @@ { "type": "File", "start": 0, - "end": 21, + "end": 40, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 21 + "line": 3, + "column": 17 } }, "errors": [ - "SyntaxError: Escape sequence in keyword const (1:14)" + "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", "start": 0, - "end": 21, + "end": 40, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 21 + "line": 3, + "column": 17 } }, "sourceType": "script", @@ -101,6 +103,76 @@ } ], "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 23, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 34, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": { + "type": "NumericLiteral", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ], + "kind": "const" } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/input.js b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/input.js index 2c49151ea912..c9bc4e4c28d9 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/input.js +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/input.js @@ -1 +1,4 @@ var expor\u{74} = 123; + +var x; +expor\u{74} { x }; diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json new file mode 100644 index 000000000000..54925950e059 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} \ No newline at end of file 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 306595677000..236b7dc15afa 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 @@ -1,35 +1,37 @@ { "type": "File", "start": 0, - "end": 22, + "end": 49, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 22 + "line": 4, + "column": 18 } }, "errors": [ - "SyntaxError: Escape sequence in keyword export (1:15)" + "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", "start": 0, - "end": 22, + "end": 49, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 22 + "line": 4, + "column": 18 } }, - "sourceType": "script", + "sourceType": "module", "interpreter": null, "body": [ { @@ -101,6 +103,125 @@ } ], "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ExportNamedDeclaration", + "start": 31, + "end": 49, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 15 + } + }, + "local": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + }, + "exported": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 4, + "column": 14 + }, + "end": { + "line": 4, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ], + "source": null, + "declaration": null } ], "directives": [] 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 4da6a4e43640..d95df678e8c4 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Escape sequence in keyword if (1:12)" + "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/input.js b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/input.js index f23c79e20fb1..df174d0e56d1 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/input.js +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/input.js @@ -1 +1,3 @@ var \u{69}\u{6d}\u{70}\u{6f}\u{72}\u{74} = 123; + +\u{69}\u{6d}\u{70}\u{6f}\u{72}\u{74} "x"; diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json new file mode 100644 index 000000000000..54925950e059 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} \ No newline at end of file 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 fe3db26d020a..8842ac412ce6 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 @@ -1,35 +1,37 @@ { "type": "File", "start": 0, - "end": 47, + "end": 90, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 47 + "line": 3, + "column": 41 } }, "errors": [ - "SyntaxError: Escape sequence in keyword import (1:40)" + "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", "start": 0, - "end": 47, + "end": 90, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 1, - "column": 47 + "line": 3, + "column": 41 } }, - "sourceType": "script", + "sourceType": "module", "interpreter": null, "body": [ { @@ -101,6 +103,42 @@ } ], "kind": "var" + }, + { + "type": "ImportDeclaration", + "start": 49, + "end": 90, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 41 + } + }, + "specifiers": [], + "source": { + "type": "StringLiteral", + "start": 86, + "end": 89, + "loc": { + "start": { + "line": 3, + "column": 37 + }, + "end": { + "line": 3, + "column": 40 + } + }, + "extra": { + "rawValue": "x", + "raw": "\"x\"" + }, + "value": "x" + } } ], "directives": [] 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 912c74d9fcbd..17c1ae03468e 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Escape sequence in keyword null (1:9)" + "SyntaxError: Escape sequence in keyword null (1:0)" ], "program": { "type": "Program", @@ -47,7 +47,7 @@ } }, "expression": { - "type": "Identifier", + "type": "NullLiteral", "start": 0, "end": 9, "loc": { @@ -58,10 +58,8 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "null" - }, - "name": "null" + } + } } } ], 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 d216ce539ec6..609a782c235a 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Escape sequence in keyword true (1:9)" + "SyntaxError: Escape sequence in keyword true (1:0)" ], "program": { "type": "Program", @@ -47,7 +47,7 @@ } }, "expression": { - "type": "Identifier", + "type": "BooleanLiteral", "start": 0, "end": 9, "loc": { @@ -58,10 +58,9 @@ "end": { "line": 1, "column": 9 - }, - "identifierName": "true" + } }, - "name": "true" + "value": true } } ], 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 c500d9a7b8e4..1394b19bdb01 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Escape sequence in keyword new (1:23)" + "SyntaxError: Escape sequence in keyword new (1:15)" ], "program": { "type": "Program", @@ -96,7 +96,7 @@ } }, "expression": { - "type": "MemberExpression", + "type": "MetaProperty", "start": 15, "end": 30, "loc": { @@ -109,7 +109,7 @@ "column": 30 } }, - "object": { + "meta": { "type": "Identifier", "start": 15, "end": 23, @@ -142,8 +142,7 @@ "identifierName": "target" }, "name": "target" - }, - "computed": false + } } } ], From 9fd7069bab7ca87bba911987130198b4b1b8dd04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 01:19:49 +0100 Subject: [PATCH 25/29] Update after rebase --- packages/babel-parser/src/plugins/flow.js | 48 ++--- .../top-level-await/inside-arrow/options.json | 1 + .../inside-function/options.json | 1 + .../options.json | 3 +- .../output.json | 87 ++++++++ .../options.json | 3 +- .../output.json | 136 +++++++++++++ .../duplicate-member-name/options.json | 3 +- .../duplicate-member-name/output.json | 152 ++++++++++++++ .../flow/enum-declaration/export/options.json | 9 +- .../options.json | 3 +- .../output.json | 87 ++++++++ .../options.json | 3 +- .../output.json | 87 ++++++++ .../options.json | 6 +- .../output.json | 87 ++++++++ .../options.json | 3 +- .../output.json | 87 ++++++++ .../options.json | 3 +- .../output.json | 86 ++++++++ .../options.json | 3 +- .../output.json | 87 ++++++++ .../options.json | 3 +- .../output.json | 87 ++++++++ .../options.json | 2 +- .../options.json | 3 +- .../output.json | 87 ++++++++ .../options.json | 3 +- .../output.json | 87 ++++++++ .../invalid-member-name/options.json | 3 +- .../invalid-member-name/output.json | 153 ++++++++++++++ .../options.json | 3 +- .../output.json | 87 ++++++++ .../options.json | 3 +- .../output.json | 140 +++++++++++++ .../reserved-word-enum-name/options.json | 3 +- .../reserved-word-enum-name/output.json | 87 ++++++++ .../options.json | 3 +- .../output.json | 152 ++++++++++++++ .../options.json | 3 +- .../output.json | 192 ++++++++++++++++++ .../options.json | 3 - .../output.json | 139 +++++++++++++ .../options.json | 3 - .../output.json | 138 +++++++++++++ .../options.json | 3 - .../output.json | 138 +++++++++++++ .../options.json | 3 - .../output.json | 138 +++++++++++++ 49 files changed, 2569 insertions(+), 82 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json delete mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 972ff37c4f9c..ca489f576909 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -3009,7 +3009,7 @@ export default (superClass: Class): Class => enumName, suppliedType, }: { enumName: string, suppliedType: null | string }, - ): void { + ) { const suggestion = `Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in ` + `enum \`${enumName}\`.`; @@ -3017,13 +3017,13 @@ export default (superClass: Class): Class => suppliedType === null ? `Supplied enum type is not valid. ${suggestion}` : `Enum type \`${suppliedType}\` is not valid. ${suggestion}`; - this.raise(pos, message); + return this.raise(pos, message); } flowEnumErrorInvalidMemberInitializer( pos: number, { enumName, explicitType, memberName }: EnumContext, - ): void { + ) { let message = null; switch (explicitType) { case "boolean": @@ -3044,7 +3044,7 @@ export default (superClass: Class): Class => `The enum member initializer for \`${memberName}\` needs to be a literal (either ` + `a boolean, number, or string) in enum \`${enumName}\`.`; } - this.raise(pos, message); + return this.raise(pos, message); } flowEnumErrorNumberMemberNotInitialized( @@ -3197,8 +3197,7 @@ export default (superClass: Class): Class => break; } case "invalid": { - this.flowEnumErrorInvalidMemberInitializer(init.pos, context); - break; + throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context); } case "none": { switch (explicitType) { @@ -3262,28 +3261,29 @@ export default (superClass: Class): Class => enumName: string, }): EnumExplicitType { if (this.eatContextual("of")) { - if (this.match(tt.name)) { - switch (this.state.value) { - case "boolean": - case "number": - case "string": - case "symbol": { - const explicitType = this.state.value; - this.next(); - return explicitType; - } - default: - this.flowEnumErrorInvalidExplicitType(this.state.start, { - enumName, - suppliedType: this.state.value, - }); - } - } else { - this.flowEnumErrorInvalidExplicitType(this.state.start, { + if (!this.match(tt.name)) { + throw this.flowEnumErrorInvalidExplicitType(this.state.start, { enumName, suppliedType: null, }); } + + const { value } = this.state; + this.next(); + + if ( + value !== "boolean" && + value !== "number" && + value !== "string" && + value !== "symbol" + ) { + this.flowEnumErrorInvalidExplicitType(this.state.start, { + enumName, + suppliedType: value, + }); + } + + return value; } return null; } diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json index 95eb740f8dfb..64cfc06e5014 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-arrow/options.json @@ -1,5 +1,6 @@ { "plugins": ["topLevelAwait"], "sourceType": "module", + "errorRecovery": false, "throws": "Can not use keyword 'await' outside an async function (1:6)" } diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json index d09f3f654766..8eade50d15b5 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-function/options.json @@ -1,5 +1,6 @@ { "plugins": ["topLevelAwait"], "sourceType": "module", + "errorRecovery": false, "throws": "Can not use keyword 'await' outside an async function (2:2)" } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json index b3b5dfd8b08f..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json new file mode 100644 index 000000000000..8ca6221bd05f --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-explicit/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumBooleanBody", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "explicitType": true, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json index b3b5dfd8b08f..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json new file mode 100644 index 000000000000..de57afc78eea --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/boolean-member-not-initialized-implicit/output.json @@ -0,0 +1,136 @@ +{ + "type": "File", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumBooleanBody", + "start": 11, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "explicitType": false, + "members": [ + { + "type": "EnumBooleanMember", + "start": 16, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "B" + }, + "name": "B" + }, + "init": { + "type": "BooleanLiteral", + "start": 20, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 10 + } + }, + "value": true + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json index d769b33ba2c2..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum member names need to be unique, but the name `A` has already been used before in enum `E`. (3:2)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json new file mode 100644 index 000000000000..419248b77ef1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/duplicate-member-name/output.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum member names need to be unique, but the name `A` has already been used before in enum `E`. (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 11, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "explicitType": false, + "members": [ + { + "type": "EnumDefaultedMember", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "A" + }, + "name": "A" + } + }, + { + "type": "EnumDefaultedMember", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "A" + }, + "name": "A" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json index f17ece27cf57..9d3b4fdaaa37 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/options.json @@ -1,11 +1,4 @@ { - "plugins": [ - [ - "flow", - { - "enums": true - } - ] - ], + "plugins": [["flow", { "enums": true }]], "sourceType": "module" } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json index 3dbe8477d0ab..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json new file mode 100644 index 000000000000..b9a7090addd4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-majority-defaulted/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 11, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "explicitType": false, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json index 3dbe8477d0ab..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json new file mode 100644 index 000000000000..a6954ed31095 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/inconsistent-member-values-mixed-initializers/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 11, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "explicitType": false, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json index 7684531c52f1..30df8c2ef701 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/options.json @@ -1,4 +1,4 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum type `xxx` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `E`. (1:10)" -} + "plugins": [["flow", { "enums": true }]] + +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json new file mode 100644 index 000000000000..7b6a1da0ed1f --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-explicit-type-identifier/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum type `xxx` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `E`. (1:14)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 16, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "explicitType": false, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json index 1587909dd62e..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json new file mode 100644 index 000000000000..a8f898034c39 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-boolean-explicit-string/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "explicitType": true, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json index e9b2692f126a..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Symbol enum members cannot be initialized. Use `A,` in enum `E`. (2:6)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json new file mode 100644 index 000000000000..4cf1122979e8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-literal-explicit-symbol/output.json @@ -0,0 +1,86 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Symbol enum members cannot be initialized. Use `A,` in enum `E`. (2:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumSymbolBody", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json index 14ed173defa0..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json new file mode 100644 index 000000000000..c737d1129440 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-boolean/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumBooleanBody", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "explicitType": true, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json index 1587909dd62e..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json new file mode 100644 index 000000000000..653573513644 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-number-explicit-string/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 21, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "explicitType": true, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json index 282f44e03ab4..db9720997638 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-parenthesized/options.json @@ -1,4 +1,4 @@ { "plugins": [["flow", { "enums": true }]], "throws": "The enum member initializer for `A` needs to be a literal (either a boolean, number, or string) in enum `E`. (2:6)" -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json index 14ed173defa0..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json new file mode 100644 index 000000000000..2f1b07d00c15 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-boolean/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumBooleanBody", + "start": 22, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "explicitType": true, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json index 7a8a81f75442..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum `E` has type `number`, so the initializer of `A` needs to be a number literal. (2:6)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json new file mode 100644 index 000000000000..263ac8c203cb --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-initializer-string-explicit-number/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum `E` has type `number`, so the initializer of `A` needs to be a number literal. (2:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumNumberBody", + "start": 21, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "explicitType": true, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json index 3a3974fd4b9d..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `foo`, consider using `Foo`, in enum `E`. (2:2)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json new file mode 100644 index 000000000000..f4f24a70b045 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/invalid-member-name/output.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `foo`, consider using `Foo`, in enum `E`. (2:2)", + "SyntaxError: Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `bar`, consider using `Bar`, in enum `E`. (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "explicitType": false, + "members": [ + { + "type": "EnumDefaultedMember", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "foo" + }, + "name": "foo" + } + }, + { + "type": "EnumDefaultedMember", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "bar" + }, + "name": "bar" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json index b668cbc42536..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json new file mode 100644 index 000000000000..8408025e1256 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-explicit/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumNumberBody", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "explicitType": true, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json index b668cbc42536..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json new file mode 100644 index 000000000000..67dae3487d84 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/number-member-not-initialized-implicit/output.json @@ -0,0 +1,140 @@ +{ + "type": "File", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumNumberBody", + "start": 11, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "explicitType": false, + "members": [ + { + "type": "EnumNumberMember", + "start": 16, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "B" + }, + "name": "B" + }, + "init": { + "type": "NumericLiteral", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json index 50d57cc99e4d..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "Unexpected keyword 'class' (1:5)" + "plugins": [["flow", { "enums": true }]] } 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 new file mode 100644 index 000000000000..f80ecb8f4d3d --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json @@ -0,0 +1,87 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Unexpected keyword 'class' (1:5)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "class" + }, + "name": "class" + }, + "body": { + "type": "EnumStringBody", + "start": 13, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "explicitType": false, + "members": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json index 71e396752a2e..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json new file mode 100644 index 000000000000..f3a0304fb310 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-defaulted/output.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 21, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 4 + } + }, + "explicitType": true, + "members": [ + { + "type": "EnumDefaultedMember", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "B" + }, + "name": "B" + } + }, + { + "type": "EnumDefaultedMember", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "C" + }, + "name": "C" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json index 71e396752a2e..53fd48c051cb 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/options.json @@ -1,4 +1,3 @@ { - "plugins": [["flow", { "enums": true }]], - "throws": "String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)" + "plugins": [["flow", { "enums": true }]] } diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json new file mode 100644 index 000000000000..9a637136e9c2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/string-member-inconsistently-initialized-majority-initialized/output.json @@ -0,0 +1,192 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "EnumDeclaration", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "E" + }, + "name": "E" + }, + "body": { + "type": "EnumStringBody", + "start": 21, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "explicitType": true, + "members": [ + { + "type": "EnumStringMember", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "B" + }, + "name": "B" + }, + "init": { + "type": "StringLiteral", + "start": 30, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "extra": { + "rawValue": "b", + "raw": "\"b\"" + }, + "value": "b" + } + }, + { + "type": "EnumStringMember", + "start": 37, + "end": 44, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 3 + }, + "identifierName": "C" + }, + "name": "C" + }, + "init": { + "type": "StringLiteral", + "start": 41, + "end": 44, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 9 + } + }, + "extra": { + "rawValue": "c", + "raw": "\"c\"" + }, + "value": "c" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json deleted file mode 100644 index 7c4adceba22a..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Private elements cannot have the 'abstract' modifier. (2:2)" -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json new file mode 100644 index 000000000000..9107b0794815 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json @@ -0,0 +1,139 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Private elements cannot have the 'abstract' modifier. (2:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "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": null, + "body": { + "type": "ClassBody", + "start": 17, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 21, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "abstract": true, + "static": false, + "key": { + "type": "PrivateName", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json deleted file mode 100644 index a183ce2e7550..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Private elements cannot have an accessibility modifier ('private') (2:2)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..360a75b9f7a1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json @@ -0,0 +1,138 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 25, + "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": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "accessibility": "private", + "static": false, + "key": { + "type": "PrivateName", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json deleted file mode 100644 index e6c1bebe1ab9..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Private elements cannot have an accessibility modifier ('protected') (2:2)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..60afa0c3bc76 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json @@ -0,0 +1,138 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 27, + "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": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "accessibility": "protected", + "static": false, + "key": { + "type": "PrivateName", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json deleted file mode 100644 index 7fb90279eae1..000000000000 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Private elements cannot have an accessibility modifier ('public') (2:2)" -} \ No newline at end of file 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 new file mode 100644 index 000000000000..3f526e42418c --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json @@ -0,0 +1,138 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 24, + "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": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 22, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "accessibility": "public", + "static": false, + "key": { + "type": "PrivateName", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file From 04e64e60943620d7e67d9bef5157001853c6a533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 01:26:04 +0100 Subject: [PATCH 26/29] Fix todo --- packages/babel-parser/src/parser/expression.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 4755a678b8cd..291351594925 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -784,15 +784,14 @@ export default class ExpressionParser extends LValParser { node: T, optional: boolean, ): T { - validate: if (node.callee.type === "Import") { + if (node.callee.type === "Import") { if (node.arguments.length !== 1) { this.raise(node.start, "import() requires exactly one argument"); - break validate; - } - - const importArg = node.arguments[0]; - if (importArg && importArg.type === "SpreadElement") { - this.raise(importArg.start, "... is not allowed in import()"); + } else { + const importArg = node.arguments[0]; + if (importArg && importArg.type === "SpreadElement") { + this.raise(importArg.start, "... is not allowed in import()"); + } } } return this.finishNode( From c3f64a7294a2365f9dc97d8d15809a06d99d400e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 01:28:59 +0100 Subject: [PATCH 27/29] Remove duplicated error when using += for defaults --- packages/babel-parser/src/parser/lval.js | 10 +++++----- .../error-operator-for-default/output.json | 6 ++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index 6bfab47b5d03..547441b0ce41 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -101,16 +101,16 @@ export default class LValParser extends NodeUtils { break; case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern"; - delete node.operator; - this.toAssignable(node.left, isBinding, contextDescription); - } else { + if (node.operator !== "=") { this.raise( node.left.end, "Only '=' operator can be used for specifying default value.", ); } + + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding, contextDescription); break; case "ParenthesizedExpression": diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json index a26de7c1fac3..5a29fd6b5f7b 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json @@ -13,8 +13,7 @@ } }, "errors": [ - "SyntaxError: Only '=' operator can be used for specifying default value. (1:3)", - "SyntaxError: Invalid left-hand side in array destructuring pattern (1:2)" + "SyntaxError: Only '=' operator can be used for specifying default value. (1:3)" ], "program": { "type": "Program", @@ -78,7 +77,7 @@ }, "elements": [ { - "type": "AssignmentExpression", + "type": "AssignmentPattern", "start": 2, "end": 8, "loc": { @@ -91,7 +90,6 @@ "column": 8 } }, - "operator": "+=", "left": { "type": "Identifier", "start": 2, From 7740a4548217c2ecd80988a5472782ab39ca67fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 01:33:31 +0100 Subject: [PATCH 28/29] Remove unnecessary throw --- packages/babel-parser/src/plugins/estree.js | 16 +- .../invalid-syntax/migrated_0075/options.json | 1 - .../invalid-syntax/migrated_0075/output.json | 145 ++++++++++++++++++ 3 files changed, 152 insertions(+), 10 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js index b89e29ee92c9..60bc1effffa7 100644 --- a/packages/babel-parser/src/plugins/estree.js +++ b/packages/babel-parser/src/plugins/estree.js @@ -89,17 +89,15 @@ export default (superClass: Class): Class => const start = prop.start; if (prop.value.params.length !== paramCount) { if (prop.kind === "get") { - throw this.raise(start, "getter must not have any formal parameters"); + this.raise(start, "getter must not have any formal parameters"); } else { - throw this.raise( - start, - "setter must have exactly one formal parameter", - ); + this.raise(start, "setter must have exactly one formal parameter"); } - } - - if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { - throw this.raise( + } else if ( + prop.kind === "set" && + prop.value.params[0].type === "RestElement" + ) { + this.raise( start, "setter function argument must not be a rest parameter", ); diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json index 23e3c71b38f5..5a02a61446d2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/options.json @@ -1,5 +1,4 @@ { - "throws": "setter must have exactly one formal parameter (1:3)", "plugins": [ "estree" ] 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 new file mode 100644 index 000000000000..b0ad15758245 --- /dev/null +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json @@ -0,0 +1,145 @@ +{ + "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)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "properties": [ + { + "type": "Property", + "start": 3, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "s" + }, + "name": "s" + }, + "computed": false, + "kind": "set", + "value": { + "type": "FunctionExpression", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "id": null, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "body": [] + } + }, + "shorthand": false + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ] + } +} \ No newline at end of file From ebc2ce0619306127df80c6d04c697535c48045f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 01:38:28 +0100 Subject: [PATCH 29/29] Nit: use ?? --- packages/babel-parser/src/plugins/flow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index ca489f576909..5e7187455da2 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -953,7 +953,7 @@ export default (superClass: Class): Class => variance, kind, allowSpread, - allowInexact == null ? !exact : allowInexact, + allowInexact ?? !exact, ); if (propOrInexact === null) {