diff --git a/packages/babel-generator/src/generators/types.ts b/packages/babel-generator/src/generators/types.ts index 45b38179b5c5..0be7d04e5f7c 100644 --- a/packages/babel-generator/src/generators/types.ts +++ b/packages/babel-generator/src/generators/types.ts @@ -236,20 +236,6 @@ export function DecimalLiteral(this: Printer, node: t.DecimalLiteral) { this.word(node.value + "m"); } -export function PipelineTopicExpression( - this: Printer, - node: t.PipelineTopicExpression, -) { - this.print(node.expression, node); -} - -export function PipelineBareFunction( - this: Printer, - node: t.PipelineBareFunction, -) { - this.print(node.callee, node); -} - -export function PipelinePrimaryTopicReference(this: Printer) { +export function TopicReference(this: Printer) { this.token("#"); } diff --git a/packages/babel-generator/test/fixtures/types/PipelineBareFunction/input.js b/packages/babel-generator/test/fixtures/types/PipelineBareFunction/input.js deleted file mode 100644 index e5b2807245d0..000000000000 --- a/packages/babel-generator/test/fixtures/types/PipelineBareFunction/input.js +++ /dev/null @@ -1 +0,0 @@ -let result = "hello" |> doubleSay |> text.capitalize |> a.b.exclaim; diff --git a/packages/babel-generator/test/fixtures/types/PipelineBareFunction/options.json b/packages/babel-generator/test/fixtures/types/PipelineBareFunction/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-generator/test/fixtures/types/PipelineBareFunction/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-generator/test/fixtures/types/PipelineBareFunction/output.js b/packages/babel-generator/test/fixtures/types/PipelineBareFunction/output.js deleted file mode 100644 index e5b2807245d0..000000000000 --- a/packages/babel-generator/test/fixtures/types/PipelineBareFunction/output.js +++ /dev/null @@ -1 +0,0 @@ -let result = "hello" |> doubleSay |> text.capitalize |> a.b.exclaim; diff --git a/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/input.js b/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/input.js deleted file mode 100644 index 4c8ffd3bf244..000000000000 --- a/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/input.js +++ /dev/null @@ -1,8 +0,0 @@ -value |> # + 1; -value |> 1 + #; -value |> do { - #; -}; -value |> do { - if (yes) #; -}; diff --git a/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/options.json b/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/output.js b/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/output.js deleted file mode 100644 index 4c8ffd3bf244..000000000000 --- a/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/output.js +++ /dev/null @@ -1,8 +0,0 @@ -value |> # + 1; -value |> 1 + #; -value |> do { - #; -}; -value |> do { - if (yes) #; -}; diff --git a/packages/babel-generator/test/fixtures/types/TopicReference/input.js b/packages/babel-generator/test/fixtures/types/TopicReference/input.js new file mode 100644 index 000000000000..fe4d81876f44 --- /dev/null +++ b/packages/babel-generator/test/fixtures/types/TopicReference/input.js @@ -0,0 +1 @@ +2 + 3 |> #.toString(16); diff --git a/packages/babel-generator/test/fixtures/types/TopicReference/options.json b/packages/babel-generator/test/fixtures/types/TopicReference/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-generator/test/fixtures/types/TopicReference/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-generator/test/fixtures/types/TopicReference/output.js b/packages/babel-generator/test/fixtures/types/TopicReference/output.js new file mode 100644 index 000000000000..8c25c56853ef --- /dev/null +++ b/packages/babel-generator/test/fixtures/types/TopicReference/output.js @@ -0,0 +1 @@ +2 + 3 |> #.toString(16); \ No newline at end of file diff --git a/packages/babel-parser/ast/spec.md b/packages/babel-parser/ast/spec.md index 48d37a300eb8..0642441f64a5 100644 --- a/packages/babel-parser/ast/spec.md +++ b/packages/babel-parser/ast/spec.md @@ -962,48 +962,13 @@ If `object` is `null`, then `callee` should be a `MemberExpression`. ### Pipeline -These nodes are used by the Smart Pipeline to determine the type of the expression in a Pipeline Operator Expression. The F# Pipeline uses simple `BinaryExpression`s. +These nodes are used by the Hack-style pipe operator. (The F# Pipeline uses simple `BinaryExpression`s and `AwaitExpression`s.) -#### PipelineBody +#### PipeBody ```js -interface PipelineBody <: NodeBase { - type: "PipelineBody"; -} -``` - -#### PipelineBareFunctionBody - -```js -interface PipelineBody <: NodeBase { - type: "PipelineBareFunctionBody"; - callee: Expression; -} -``` - -#### PipelineBareConstructorBody - -```js -interface PipelineBareConstructorBody <: NodeBase { - type: "PipelineBareConstructorBody"; - callee: Expression; -} -``` - -#### PipelineBareAwaitedFunctionBody - -```js -interface PipelineBareConstructorBody <: NodeBase { - type: "PipelineTopicBody"; - expression: Expression; -} -``` - -#### PipelineTopicBody - -```js -interface PipelineBareConstructorBody <: NodeBase { - type: "PipelineBareAwaitedFunctionBody"; +interface PipeBody <: NodeBase { + type: "PipeBody"; callee: Expression; } ``` diff --git a/packages/babel-parser/src/parser/error-message.js b/packages/babel-parser/src/parser/error-message.js index 2a46b8b7be00..134de1c73675 100644 --- a/packages/babel-parser/src/parser/error-message.js +++ b/packages/babel-parser/src/parser/error-message.js @@ -129,18 +129,14 @@ export const ErrorMessages = Object.freeze({ ParamDupe: "Argument name clash", PatternHasAccessor: "Object pattern can't contain getter or setter", PatternHasMethod: "Object pattern can't contain methods", - PipelineBodyNoArrow: - 'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized', - PipelineBodySequenceExpression: - "Pipeline body may not be a comma-separated sequence expression", - PipelineHeadSequenceExpression: - "Pipeline head should not be a comma-separated sequence expression", - PipelineTopicUnused: - "Pipeline is in topic style but does not use topic reference", - PrimaryTopicNotAllowed: - "Topic reference was used in a lexical context without topic binding", - PrimaryTopicRequiresSmartPipeline: - "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.", + PipeBodyCannotBeArrow: + 'Unexpected arrow "=>" after pipeline body; arrow function acting as pipe body must be parenthesized due to operator precedence', + PipeTopicRequiresHackPipes: + "Topic reference is used, but the pipelineOperator plugin was not passed a 'proposal': 'hack' option.", + PipeTopicUnbound: + "Topic reference is unbound; it must be inside a Hack-style pipe body", + PipeTopicUnused: + "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once", PrivateInExpectedIn: "Private names are only allowed in property accesses (`obj.#%0`) or in `in` expressions (`#%0 in obj`)", PrivateNameRedeclaration: "Duplicate private name #%0", diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 9a3271a8262b..fec3c8e34800 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -394,7 +394,6 @@ export default class ExpressionParser extends LValParser { return left; } this.state.inPipeline = true; - this.checkPipelineAtInfixOperator(left, leftStartPos); } const node = this.startNodeAt(leftStartPos, leftStartLoc); node.left = left; @@ -456,24 +455,21 @@ export default class ExpressionParser extends LValParser { parseExprOpRightExpr(op: TokenType, prec: number): N.Expression { const startPos = this.state.start; - const startLoc = this.state.startLoc; switch (op) { case tt.pipeline: switch (this.getPluginOption("pipelineOperator", "proposal")) { - case "smart": - return this.withTopicPermittingContext(() => { - return this.parseSmartPipelineBody( - this.parseExprOpBaseRightExpr(op, prec), - startPos, - startLoc, - ); + case "hack": + return this.withTopicBindingContext(() => { + const bodyExpr = this.parseExprOpBaseRightExpr(op, prec); + this.checkHackPipeBodyEarlyErrors(startPos); + return bodyExpr; }); case "fsharp": return this.withSoloAwaitPermittingContext(() => { return this.parseFSharpPipelineBody(prec); }); } - // falls through + // Falls through. default: return this.parseExprOpBaseRightExpr(op, prec); @@ -1153,20 +1149,18 @@ export default class ExpressionParser extends LValParser { if (this.state.inPipeline) { node = this.startNode(); - if ( - this.getPluginOption("pipelineOperator", "proposal") !== "smart" - ) { - this.raise(node.start, Errors.PrimaryTopicRequiresSmartPipeline); + if (this.getPluginOption("pipelineOperator", "proposal") !== "hack") { + this.raise(node.start, Errors.PipeTopicRequiresHackPipes); } this.next(); - if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) { - this.raise(node.start, Errors.PrimaryTopicNotAllowed); + if (!this.topicReferenceIsAllowedInCurrentContext()) { + this.raise(node.start, Errors.PipeTopicUnbound); } this.registerTopicReference(); - return this.finishNode(node, "PipelinePrimaryTopicReference"); + return this.finishNode(node, "TopicReference"); } // https://tc39.es/proposal-private-fields-in-in @@ -2466,87 +2460,33 @@ export default class ExpressionParser extends LValParser { return this.finishNode(node, "YieldExpression"); } - // Validates a pipeline (for any of the pipeline Babylon plugins) at the point - // of the infix operator `|>`. - - checkPipelineAtInfixOperator(left: N.Expression, leftStartPos: number) { - if (this.getPluginOption("pipelineOperator", "proposal") === "smart") { - if (left.type === "SequenceExpression") { - // Ensure that the pipeline head is not a comma-delimited - // sequence expression. - this.raise(leftStartPos, Errors.PipelineHeadSequenceExpression); - } - } - } - - parseSmartPipelineBody( - childExpression: N.Expression, - startPos: number, - startLoc: Position, - ): N.PipelineBody { - this.checkSmartPipelineBodyEarlyErrors(childExpression, startPos); + // This helper method is to be called immediately + // after a Hack-style pipe body is parsed. + // The `startPos` is the starting position of the pipe body. - return this.parseSmartPipelineBodyInStyle( - childExpression, - startPos, - startLoc, - ); - } - - checkSmartPipelineBodyEarlyErrors( - childExpression: N.Expression, - startPos: number, - ): void { + checkHackPipeBodyEarlyErrors(startPos: number): void { + // If the following token is invalidly `=>`, then throw a human-friendly error + // instead of something like 'Unexpected token, expected ";"'. + // For example, `x => x |> y => #` (assuming `#` is the topic reference) + // groups into `x => (x |> y) => #`, + // and `(x |> y) => #` is an invalid arrow function. + // This is because Hack-style `|>` has tighter precedence than `=>`. if (this.match(tt.arrow)) { - // If the following token is invalidly `=>`, then throw a human-friendly error - // instead of something like 'Unexpected token, expected ";"'. - throw this.raise(this.state.start, Errors.PipelineBodyNoArrow); - } else if (childExpression.type === "SequenceExpression") { - this.raise(startPos, Errors.PipelineBodySequenceExpression); + throw this.raise(this.state.start, Errors.PipeBodyCannotBeArrow); } - } - - parseSmartPipelineBodyInStyle( - childExpression: N.Expression, - startPos: number, - startLoc: Position, - ): N.PipelineBody { - const bodyNode = this.startNodeAt(startPos, startLoc); - const isSimpleReference = this.isSimpleReference(childExpression); - if (isSimpleReference) { - bodyNode.callee = childExpression; - } else { - if (!this.topicReferenceWasUsedInCurrentTopicContext()) { - this.raise(startPos, Errors.PipelineTopicUnused); - } - bodyNode.expression = childExpression; + // A Hack pipe body must use the topic reference at least once. + else if (!this.topicReferenceWasUsedInCurrentContext()) { + this.raise(startPos, Errors.PipeTopicUnused); } - return this.finishNode( - bodyNode, - isSimpleReference ? "PipelineBareFunction" : "PipelineTopicExpression", - ); } - isSimpleReference(expression: N.Expression): boolean { - switch (expression.type) { - case "MemberExpression": - return ( - !expression.computed && this.isSimpleReference(expression.object) - ); - case "Identifier": - return true; - default: - return false; - } - } - - // Enable topic references from outer contexts within smart pipeline bodies. + // Enable topic references from outer contexts within Hack-style pipe bodies. // The function modifies the parser's topic-context state to enable or disable - // the use of topic references with the smartPipelines plugin. They then run a - // callback, then they reset the parser to the old topic-context state that it - // had before the function was called. + // the use of topic references. + // The function then calls a callback, then resets the parser + // to the old topic-context state that it had before the function was called. - withTopicPermittingContext(callback: () => T): T { + withTopicBindingContext(callback: () => T): T { const outerContextTopicState = this.state.topicContext; this.state.topicContext = { // Enable the use of the primary topic reference. @@ -2562,29 +2502,6 @@ export default class ExpressionParser extends LValParser { } } - // Disable topic references from outer contexts within syntax constructs - // such as the bodies of iteration statements. - // The function modifies the parser's topic-context state to enable or disable - // the use of topic references with the smartPipelines plugin. They then run a - // callback, then they reset the parser to the old topic-context state that it - // had before the function was called. - - withTopicForbiddingContext(callback: () => T): T { - const outerContextTopicState = this.state.topicContext; - this.state.topicContext = { - // Disable the use of the primary topic reference. - maxNumOfResolvableTopics: 0, - // Hide the use of any topic references from outer contexts. - maxTopicIndex: null, - }; - - try { - return callback(); - } finally { - this.state.topicContext = outerContextTopicState; - } - } - withSoloAwaitPermittingContext(callback: () => T): T { const outerContextSoloAwaitState = this.state.soloAwait; this.state.soloAwait = true; @@ -2630,11 +2547,11 @@ export default class ExpressionParser extends LValParser { this.state.topicContext.maxTopicIndex = 0; } - primaryTopicReferenceIsAllowedInCurrentTopicContext(): boolean { + topicReferenceIsAllowedInCurrentContext(): boolean { return this.state.topicContext.maxNumOfResolvableTopics >= 1; } - topicReferenceWasUsedInCurrentTopicContext(): boolean { + topicReferenceWasUsedInCurrentContext(): boolean { return ( this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0 diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 28813bb6de8b..f6feeb35554b 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -481,14 +481,8 @@ export default class StatementParser extends ExpressionParser { this.next(); this.state.labels.push(loopLabel); - node.body = - // For the smartPipelines plugin: Disable topic references from outer - // contexts within the loop body. They are permitted in test expressions, - // outside of the loop body. - this.withTopicForbiddingContext(() => - // Parse the loop body's body. - this.parseStatement("do"), - ); + // Parse the loop body's body. + node.body = this.parseStatement("do"); this.state.labels.pop(); @@ -693,15 +687,10 @@ export default class StatementParser extends ExpressionParser { this.scope.enter(SCOPE_OTHER); } - clause.body = - // For the smartPipelines plugin: Disable topic references from outer - // contexts within the catch clause's body. - this.withTopicForbiddingContext(() => - // Parse the catch clause's body. - this.parseBlock(false, false), - ); - this.scope.exit(); + // Parse the catch clause's body. + clause.body = this.parseBlock(false, false); + this.scope.exit(); node.handler = this.finishNode(clause, "CatchClause"); } @@ -729,14 +718,8 @@ export default class StatementParser extends ExpressionParser { node.test = this.parseHeaderExpression(); this.state.labels.push(loopLabel); - node.body = - // For the smartPipelines plugin: - // Disable topic references from outer contexts within the loop body. - // They are permitted in test expressions, outside of the loop body. - this.withTopicForbiddingContext(() => - // Parse loop body. - this.parseStatement("while"), - ); + // Parse the loop body. + node.body = this.parseStatement("while"); this.state.labels.pop(); @@ -750,15 +733,8 @@ export default class StatementParser extends ExpressionParser { this.next(); node.object = this.parseHeaderExpression(); - node.body = - // For the smartPipelines plugin: - // Disable topic references from outer contexts within the with statement's body. - // They are permitted in function default-parameter expressions, which are - // part of the outer context, outside of the with statement's body. - this.withTopicForbiddingContext(() => - // Parse the statement body. - this.parseStatement("with"), - ); + // Parse the statement body. + node.body = this.parseStatement("with"); return this.finishNode(node, "WithStatement"); } @@ -943,14 +919,8 @@ export default class StatementParser extends ExpressionParser { node.update = this.match(tt.parenR) ? null : this.parseExpression(); this.expect(tt.parenR); - node.body = - // For the smartPipelines plugin: Disable topic references from outer - // contexts within the loop body. They are permitted in test expressions, - // outside of the loop body. - this.withTopicForbiddingContext(() => - // Parse the loop body. - this.parseStatement("for"), - ); + // Parse the loop body. + node.body = this.parseStatement("for"); this.scope.exit(); this.state.labels.pop(); @@ -998,14 +968,8 @@ export default class StatementParser extends ExpressionParser { : this.parseMaybeAssignAllowIn(); this.expect(tt.parenR); - node.body = - // For the smartPipelines plugin: - // Disable topic references from outer contexts within the loop body. - // They are permitted in test expressions, outside of the loop body. - this.withTopicForbiddingContext(() => - // Parse loop body. - this.parseStatement("for"), - ); + // Parse the loop body. + node.body = this.parseStatement("for"); this.scope.exit(); this.state.labels.pop(); @@ -1107,16 +1071,11 @@ export default class StatementParser extends ExpressionParser { this.parseFunctionParams(node, /* allowModifiers */ false); - // For the smartPipelines plugin: Disable topic references from outer - // contexts within the function body. They are permitted in function - // default-parameter expressions, outside of the function body. - this.withTopicForbiddingContext(() => { - // Parse the function body. - this.parseFunctionBodyAndFinish( - node, - isStatement ? "FunctionDeclaration" : "FunctionExpression", - ); - }); + // Parse the function body. + this.parseFunctionBodyAndFinish( + node, + isStatement ? "FunctionDeclaration" : "FunctionExpression", + ); this.prodParam.exit(); this.scope.exit(); @@ -1227,42 +1186,38 @@ export default class StatementParser extends ExpressionParser { this.expect(tt.braceL); - // For the smartPipelines plugin: Disable topic references from outer - // contexts within the class body. - this.withTopicForbiddingContext(() => { - while (!this.match(tt.braceR)) { - if (this.eat(tt.semi)) { - if (decorators.length > 0) { - throw this.raise(this.state.lastTokEnd, Errors.DecoratorSemicolon); - } - continue; + while (!this.match(tt.braceR)) { + if (this.eat(tt.semi)) { + if (decorators.length > 0) { + throw this.raise(this.state.lastTokEnd, Errors.DecoratorSemicolon); } + continue; + } - if (this.match(tt.at)) { - decorators.push(this.parseDecorator()); - continue; - } + if (this.match(tt.at)) { + decorators.push(this.parseDecorator()); + continue; + } - const member = this.startNode(); + const member = this.startNode(); - // steal the decorators if there are any - if (decorators.length) { - member.decorators = decorators; - this.resetStartLocationFromNode(member, decorators[0]); - decorators = []; - } + // steal the decorators if there are any + if (decorators.length) { + member.decorators = decorators; + this.resetStartLocationFromNode(member, decorators[0]); + decorators = []; + } - this.parseClassMember(classBody, member, state); + this.parseClassMember(classBody, member, state); - if ( - member.kind === "constructor" && - member.decorators && - member.decorators.length > 0 - ) { - this.raise(member.start, Errors.DecoratorConstructor); - } + if ( + member.kind === "constructor" && + member.decorators && + member.decorators.length > 0 + ) { + this.raise(member.start, Errors.DecoratorConstructor); } - }); + } this.state.strict = oldStrict; diff --git a/packages/babel-parser/src/plugin-utils.js b/packages/babel-parser/src/plugin-utils.js index 777ee42b20bf..312c0b214ce3 100644 --- a/packages/babel-parser/src/plugin-utils.js +++ b/packages/babel-parser/src/plugin-utils.js @@ -38,7 +38,7 @@ export function getPluginOption( return null; } -const PIPELINE_PROPOSALS = ["minimal", "smart", "fsharp"]; +const PIPELINE_PROPOSALS = ["minimal", "fsharp", "hack"]; const RECORD_AND_TUPLE_SYNTAX_TYPES = ["hash", "bar"]; export function validatePlugins(plugins: PluginList) { diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index b3a45637bbe9..1eefc1e43ce0 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -68,13 +68,13 @@ export default class State { isDeclareContext: boolean = false; inAbstractClass: boolean = false; - // For the smartPipelines plugin: + // For the Hack-style pipelines plugin topicContext: TopicContextState = { maxNumOfResolvableTopics: 0, maxTopicIndex: null, }; - // For the F# plugin + // For the F#-style pipelines plugin soloAwait: boolean = false; inFSharpPipelineDirectBody: boolean = false; diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index 92f1c678a0af..794a0949ce02 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -603,38 +603,6 @@ export type ParenthesizedExpression = NodeBase & { expression: Expression, }; -// Pipelines - -export type PipelineBody = NodeBase & { - type: "PipelineBody", -}; - -export type PipelineBareFunctionBody = NodeBase & { - type: "PipelineBareFunctionBody", - callee: Expression, -}; - -export type PipelineBareConstructorBody = NodeBase & { - type: "PipelineBareConstructorBody", - callee: Expression, -}; - -export type PipelineBareAwaitedFunctionBody = NodeBase & { - type: "PipelineBareAwaitedFunctionBody", - callee: Expression, -}; - -export type PipelineTopicBody = NodeBase & { - type: "PipelineTopicBody", - expression: Expression, -}; - -export type PipelineStyle = - | "PipelineBareFunction" - | "PipelineBareConstructor" - | "PipelineBareAwaitedFunction" - | "PipelineTopicExpression"; - // Template Literals export type TemplateLiteral = NodeBase & { diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body-with-operator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body-with-operator/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body-with-operator/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body-with-operator/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body-with-operator/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body-with-operator/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-array-in-body/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-assignment-in-body/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-assignment-in-body/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-assignment-in-body/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-assignment-in-body/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-assignment-in-body/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-assignment-in-body/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body-with-operator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body-with-operator/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body-with-operator/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body-with-operator/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body-with-operator/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body-with-operator/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-and-object-in-body/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head-indented/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head-indented/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head-indented/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head-indented/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head-indented/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head-indented/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-at-head/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-alt-parens/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-alt-parens/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-alt-parens/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-alt-parens/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-alt-parens/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-alt-parens/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented-with-arg-parens/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented-with-arg-parens/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented-with-arg-parens/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented-with-arg-parens/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented-with-arg-parens/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented-with-arg-parens/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-indented/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-with-arg-parens/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-with-arg-parens/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-with-arg-parens/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-with-arg-parens/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-with-arg-parens/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens-with-arg-parens/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-arrow-in-body-no-parens/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await-end/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await-end/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await-end/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await-end/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await-end/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await-end/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-await/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-ban-await-f/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-ban-await-f/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-ban-await-f/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-ban-await-f/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-ban-await-f/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-ban-await-f/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-ban-await-f/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-base/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-base/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-base/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-base/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-base/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-base/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-chain/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-chain/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-chain/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-chain/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-chain/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-chain/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-topic/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-topic/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-topic/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-topic/output.json similarity index 85% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-topic/output.json index 6c724302e0b3..776a3fdb32a2 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-invalid-primary-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-topic/output.json @@ -2,8 +2,8 @@ "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "errors": [ - "SyntaxError: Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option. (1:5)", - "SyntaxError: Topic reference was used in a lexical context without topic binding (1:5)" + "SyntaxError: Topic reference is used, but the pipelineOperator plugin was not passed a 'proposal': 'hack' option. (1:5)", + "SyntaxError: Topic reference is unbound; it must be inside a Hack-style pipe body (1:5)" ], "program": { "type": "Program", @@ -27,7 +27,7 @@ "type": "BinaryExpression", "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10}}, "left": { - "type": "PipelinePrimaryTopicReference", + "type": "TopicReference", "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6}} }, "operator": "+", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/output.json similarity index 58% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/output.json index 06531b72d5ae..4af6702b93c0 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/output.json @@ -20,25 +20,21 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "BinaryExpression", "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": "PipelinePrimaryTopicReference", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}} + "left": { + "type": "TopicReference", + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}} + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14}}, + "extra": { + "rawValue": 1, + "raw": "1" }, - "operator": "+", - "right": { - "type": "NumericLiteral", - "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14}}, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - } + "value": 1 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/output.json similarity index 58% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/output.json index 524d6e4d87ee..09d48e0129f5 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/output.json @@ -20,25 +20,21 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "BinaryExpression", "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": "NumericLiteral", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 + "left": { + "type": "NumericLiteral", + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, + "extra": { + "rawValue": 1, + "raw": "1" }, - "operator": "+", - "right": { - "type": "PipelinePrimaryTopicReference", - "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14}} - } + "value": 1 + }, + "operator": "+", + "right": { + "type": "TopicReference", + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} 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/hack-proposal-addition-without-topic/output.json similarity index 57% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/output.json index 6e09acd357ab..6c1bce1a04e8 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":14}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:9)" ], "program": { "type": "Program", @@ -23,22 +23,18 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "BinaryExpression", "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" - } + "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" } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/output.json new file mode 100644 index 000000000000..3bb77cf7bf46 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/output.json @@ -0,0 +1,57 @@ +{ + "type": "File", + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":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": "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":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "ArrowFunctionExpression", + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, + "extra": { + "parenthesized": true, + "parenStart": 9 + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BinaryExpression", + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, + "left": { + "type": "TopicReference", + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} + }, + "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 + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-unparenthesized/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-unparenthesized/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-unparenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-unparenthesized/options.json new file mode 100644 index 000000000000..aa71d07c8dce --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-unparenthesized/options.json @@ -0,0 +1,11 @@ +{ + "plugins": [ + [ + "pipelineOperator", + { + "proposal": "hack" + } + ] + ], + "throws": "Unexpected arrow \"=>\" after pipeline body; arrow function acting as pipe body must be parenthesized due to operator precedence (1:8)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/output.json similarity index 79% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/output.json index 248522740c6f..ce3d60256e05 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/output.json @@ -35,15 +35,11 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "AwaitExpression", "start":36,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":21}}, - "expression": { - "type": "AwaitExpression", - "start":36,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":21}}, - "argument": { - "type": "PipelinePrimaryTopicReference", - "start":42,"end":43,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21}} - } + "argument": { + "type": "TopicReference", + "start":42,"end":43,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/output.json similarity index 60% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/output.json index db2ecd011344..87d18ff30182 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/output.json @@ -1,6 +1,9 @@ { "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, + "errors": [ + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:9)" + ], "program": { "type": "Program", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, @@ -20,22 +23,18 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "MemberExpression", "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, - "expression": { - "type": "CallExpression", - "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, - "callee": { - "type": "Identifier", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, - "name": "f" - }, - "arguments": [ - { - "type": "PipelinePrimaryTopicReference", - "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} - } - ] + "object": { + "type": "Identifier", + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, + "name": "a" + }, + "computed": true, + "property": { + "type": "Identifier", + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, + "name": "b" } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/output.json new file mode 100644 index 000000000000..345171660358 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/output.json @@ -0,0 +1,79 @@ +{ + "type": "File", + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, + "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": "BinaryExpression", + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, + "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": "DoExpression", + "start":9,"end":41,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":41}}, + "body": { + "type": "BlockStatement", + "start":12,"end":41,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":41}}, + "body": [ + { + "type": "DoWhileStatement", + "start":14,"end":39,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":39}}, + "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": "NumericLiteral", + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + }, + "test": { + "type": "BinaryExpression", + "start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37}}, + "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": "TopicReference", + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37}} + } + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/options.json similarity index 56% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/options.json index 680f780892b7..a06133695fbe 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/options.json @@ -1,6 +1,6 @@ { "plugins": [ - ["pipelineOperator", { "proposal": "smart" }], + ["pipelineOperator", { "proposal": "hack" }], "doExpressions", "asyncGenerators" ] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/output.json new file mode 100644 index 000000000000..f8348a6ed901 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/output.json @@ -0,0 +1,92 @@ +{ + "type": "File", + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start":0,"end":70,"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":70,"loc":{"start":{"line":1,"column":21},"end":{"line":3,"column":1}}, + "body": [ + { + "type": "ExpressionStatement", + "start":25,"end":68,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":45}}, + "expression": { + "type": "BinaryExpression", + "start":25,"end":68,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":45}}, + "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": "DoExpression", + "start":34,"end":68,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":45}}, + "body": { + "type": "BlockStatement", + "start":37,"end":68,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":45}}, + "body": [ + { + "type": "ForOfStatement", + "start":39,"end":66,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":43}}, + "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": "TopicReference", + "start":61,"end":62,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":39}} + }, + "body": { + "type": "ExpressionStatement", + "start":64,"end":66,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":43}}, + "expression": { + "type": "Identifier", + "start":64,"end":65,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":42},"identifierName":"e"}, + "name": "e" + } + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/output.json new file mode 100644 index 000000000000..497d44a0b858 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/output.json @@ -0,0 +1,105 @@ +{ + "type": "File", + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, + "program": { + "type": "Program", + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, + "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": "DoExpression", + "start":9,"end":59,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":59}}, + "body": { + "type": "BlockStatement", + "start":12,"end":59,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":59}}, + "body": [ + { + "type": "ForStatement", + "start":14,"end":57,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":57}}, + "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": "TopicReference", + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}} + } + } + ], + "kind": "let" + }, + "test": { + "type": "CallExpression", + "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}}, + "callee": { + "type": "Identifier", + "start":30,"end":39,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":39},"identifierName":"predicate"}, + "name": "predicate" + }, + "arguments": [ + { + "type": "Identifier", + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"i"}, + "name": "i" + }, + { + "type": "TopicReference", + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44}} + } + ] + }, + "update": { + "type": "AssignmentExpression", + "start":47,"end":53,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":53}}, + "operator": "+=", + "left": { + "type": "Identifier", + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"i"}, + "name": "i" + }, + "right": { + "type": "TopicReference", + "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53}} + } + }, + "body": { + "type": "ExpressionStatement", + "start":55,"end":57,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":57}}, + "expression": { + "type": "Identifier", + "start":55,"end":56,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":56},"identifierName":"i"}, + "name": "i" + } + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/output.json new file mode 100644 index 000000000000..60dc22702d08 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/output.json @@ -0,0 +1,60 @@ +{ + "type": "File", + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, + "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":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, + "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": "DoExpression", + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, + "body": { + "type": "BlockStatement", + "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, + "body": [ + { + "type": "ForInStatement", + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, + "left": { + "type": "Identifier", + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"e"}, + "name": "e" + }, + "right": { + "type": "TopicReference", + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} + }, + "body": { + "type": "ExpressionStatement", + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, + "expression": { + "type": "Identifier", + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"e"}, + "name": "e" + } + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/output.json new file mode 100644 index 000000000000..93bcff9965b4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/output.json @@ -0,0 +1,61 @@ +{ + "type": "File", + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, + "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":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, + "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": "DoExpression", + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, + "body": { + "type": "BlockStatement", + "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, + "body": [ + { + "type": "ForOfStatement", + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, + "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": "TopicReference", + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} + }, + "body": { + "type": "ExpressionStatement", + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, + "expression": { + "type": "Identifier", + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"e"}, + "name": "e" + } + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/output.json new file mode 100644 index 000000000000..2641d98286c6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/output.json @@ -0,0 +1,73 @@ +{ + "type": "File", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, + "program": { + "type": "Program", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, + "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": "DoExpression", + "start":9,"end":46,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":46}}, + "body": { + "type": "BlockStatement", + "start":12,"end":46,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":46}}, + "body": [ + { + "type": "IfStatement", + "start":14,"end":44,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":44}}, + "test": { + "type": "Identifier", + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, + "name": "yes" + }, + "consequent": { + "type": "ExpressionStatement", + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, + "expression": { + "type": "NullLiteral", + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}} + } + }, + "alternate": { + "type": "IfStatement", + "start":34,"end":44,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":44}}, + "test": { + "type": "Identifier", + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40},"identifierName":"no"}, + "name": "no" + }, + "consequent": { + "type": "ExpressionStatement", + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, + "expression": { + "type": "TopicReference", + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}} + } + }, + "alternate": null + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/output.json new file mode 100644 index 000000000000..4307debf4417 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/output.json @@ -0,0 +1,63 @@ +{ + "type": "File", + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, + "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": "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": "IfStatement", + "start":14,"end":36,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":36}}, + "test": { + "type": "Identifier", + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, + "name": "yes" + }, + "consequent": { + "type": "ExpressionStatement", + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, + "expression": { + "type": "NullLiteral", + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}} + } + }, + "alternate": { + "type": "ExpressionStatement", + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, + "expression": { + "type": "TopicReference", + "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-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/output.json new file mode 100644 index 000000000000..a7bc612c49ac --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/output.json @@ -0,0 +1,56 @@ +{ + "type": "File", + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, + "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":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, + "name": "value" + }, + "operator": "|>", + "right": { + "type": "DoExpression", + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, + "body": { + "type": "BlockStatement", + "start":12,"end":27,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":27}}, + "body": [ + { + "type": "IfStatement", + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25}}, + "test": { + "type": "Identifier", + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, + "name": "yes" + }, + "consequent": { + "type": "ExpressionStatement", + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, + "expression": { + "type": "TopicReference", + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} + } + }, + "alternate": null + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/output.json new file mode 100644 index 000000000000..ed2fdf79db16 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/output.json @@ -0,0 +1,72 @@ +{ + "type": "File", + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, + "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": "DoExpression", + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, + "body": { + "type": "BlockStatement", + "start":12,"end":33,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":33}}, + "body": [ + { + "type": "IfStatement", + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, + "test": { + "type": "TopicReference", + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} + }, + "consequent": { + "type": "ExpressionStatement", + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, + "expression": { + "type": "NumericLiteral", + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + "alternate": { + "type": "ExpressionStatement", + "start":29,"end":31,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":31}}, + "expression": { + "type": "NumericLiteral", + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/output.json new file mode 100644 index 000000000000..a8c482a15629 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/output.json @@ -0,0 +1,138 @@ +{ + "type": "File", + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"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": "DoExpression", + "start":9,"end":94,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, + "body": { + "type": "BlockStatement", + "start":12,"end":94,"loc":{"start":{"line":1,"column":12},"end":{"line":7,"column":1}}, + "body": [ + { + "type": "SwitchStatement", + "start":16,"end":92,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, + "discriminant": { + "type": "Identifier", + "start":24,"end":30,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16},"identifierName":"number"}, + "name": "number" + }, + "cases": [ + { + "type": "SwitchCase", + "start":38,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, + "consequent": [ + { + "type": "ExpressionStatement", + "start":46,"end":48,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, + "expression": { + "type": "TopicReference", + "start":46,"end":47,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}} + } + } + ], + "test": { + "type": "NumericLiteral", + "start":43,"end":44,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "SwitchCase", + "start":53,"end":67,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":18}}, + "consequent": [ + { + "type": "ExpressionStatement", + "start":61,"end":67,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":18}}, + "expression": { + "type": "BinaryExpression", + "start":61,"end":66,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":17}}, + "left": { + "type": "TopicReference", + "start":61,"end":62,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13}} + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start":65,"end":66,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":17}}, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ], + "test": { + "type": "NumericLiteral", + "start":58,"end":59,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}}, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "SwitchCase", + "start":72,"end":88,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":20}}, + "consequent": [ + { + "type": "ExpressionStatement", + "start":81,"end":88,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":20}}, + "expression": { + "type": "BinaryExpression", + "start":81,"end":87,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":19}}, + "left": { + "type": "TopicReference", + "start":81,"end":82,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":14}} + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start":85,"end":87,"loc":{"start":{"line":5,"column":17},"end":{"line":5,"column":19}}, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + } + } + ], + "test": null + } + ] + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/output.json new file mode 100644 index 000000000000..2ed10d94e2f5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/output.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"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": "DoExpression", + "start":9,"end":83,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, + "body": { + "type": "BlockStatement", + "start":12,"end":83,"loc":{"start":{"line":1,"column":12},"end":{"line":7,"column":1}}, + "body": [ + { + "type": "SwitchStatement", + "start":16,"end":81,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, + "discriminant": { + "type": "TopicReference", + "start":24,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}} + }, + "cases": [ + { + "type": "SwitchCase", + "start":33,"end":44,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":15}}, + "consequent": [ + { + "type": "ExpressionStatement", + "start":41,"end":44,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":15}}, + "expression": { + "type": "NumericLiteral", + "start":41,"end":43,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, + "extra": { + "rawValue": 50, + "raw": "50" + }, + "value": 50 + } + } + ], + "test": { + "type": "NumericLiteral", + "start":38,"end":39,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "SwitchCase", + "start":49,"end":60,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}}, + "consequent": [ + { + "type": "ExpressionStatement", + "start":57,"end":60,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":15}}, + "expression": { + "type": "NumericLiteral", + "start":57,"end":59,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":14}}, + "extra": { + "rawValue": 60, + "raw": "60" + }, + "value": 60 + } + } + ], + "test": { + "type": "NumericLiteral", + "start":54,"end":55,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}}, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "SwitchCase", + "start":65,"end":77,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":16}}, + "consequent": [ + { + "type": "ExpressionStatement", + "start":74,"end":77,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":16}}, + "expression": { + "type": "NumericLiteral", + "start":74,"end":76,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":15}}, + "extra": { + "rawValue": 70, + "raw": "70" + }, + "value": 70 + } + } + ], + "test": null + } + ] + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/output.json similarity index 54% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/output.json index d90e701dc4dd..bd562e658bc0 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/output.json @@ -20,26 +20,22 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "DoExpression", "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, - "expression": { - "type": "DoExpression", - "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, - "body": { - "type": "BlockStatement", - "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, - "body": [ - { - "type": "ExpressionStatement", - "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, - "expression": { - "type": "PipelinePrimaryTopicReference", - "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15}} - } + "body": { + "type": "BlockStatement", + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, + "body": [ + { + "type": "ExpressionStatement", + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, + "expression": { + "type": "TopicReference", + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15}} } - ], - "directives": [] - } + } + ], + "directives": [] } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/output.json new file mode 100644 index 000000000000..49b9784a5a2f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/output.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"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": "DoExpression", + "start":9,"end":117,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, + "body": { + "type": "BlockStatement", + "start":12,"end":117,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, + "body": [ + { + "type": "TryStatement", + "start":16,"end":115,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":27}}, + "block": { + "type": "BlockStatement", + "start":20,"end":45,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":31}}, + "body": [ + { + "type": "ExpressionStatement", + "start":22,"end":43,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":29}}, + "expression": { + "type": "CallExpression", + "start":22,"end":42,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":28}}, + "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" + }, + "computed": false, + "property": { + "type": "Identifier", + "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, + "name": "parse" + } + }, + "arguments": [ + { + "type": "Identifier", + "start":33,"end":41,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27},"identifierName":"whatever"}, + "name": "whatever" + } + ] + } + } + ], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start":48,"end":87,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, + "param": { + "type": "Identifier", + "start":55,"end":60,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":14},"identifierName":"error"}, + "name": "error" + }, + "body": { + "type": "BlockStatement", + "start":62,"end":87,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, + "body": [ + { + "type": "ExpressionStatement", + "start":64,"end":85,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, + "expression": { + "type": "CallExpression", + "start":64,"end":84,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, + "callee": { + "type": "MemberExpression", + "start":64,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":31}}, + "object": { + "type": "Identifier", + "start":64,"end":71,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"console"}, + "name": "console" + }, + "computed": false, + "property": { + "type": "Identifier", + "start":72,"end":77,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, + "name": "error" + } + }, + "arguments": [ + { + "type": "Identifier", + "start":78,"end":83,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, + "name": "error" + } + ] + } + } + ], + "directives": [] + } + }, + "finalizer": { + "type": "BlockStatement", + "start":98,"end":115,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":27}}, + "body": [ + { + "type": "ExpressionStatement", + "start":100,"end":113,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":25}}, + "expression": { + "type": "CallExpression", + "start":100,"end":112,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":24}}, + "callee": { + "type": "Identifier", + "start":100,"end":109,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":21},"identifierName":"something"}, + "name": "something" + }, + "arguments": [ + { + "type": "TopicReference", + "start":110,"end":111,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":23}} + } + ] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/output.json new file mode 100644 index 000000000000..bd46d7bd4df1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/output.json @@ -0,0 +1,145 @@ +{ + "type": "File", + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"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": "DoExpression", + "start":9,"end":109,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, + "body": { + "type": "BlockStatement", + "start":12,"end":109,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, + "body": [ + { + "type": "TryStatement", + "start":16,"end":107,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":26}}, + "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" + }, + "computed": false, + "property": { + "type": "Identifier", + "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, + "name": "parse" + } + }, + "arguments": [ + { + "type": "TopicReference", + "start":33,"end":34,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}} + } + ] + } + } + ], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start":41,"end":80,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, + "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":80,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, + "body": [ + { + "type": "ExpressionStatement", + "start":57,"end":78,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, + "expression": { + "type": "CallExpression", + "start":57,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, + "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" + }, + "computed": false, + "property": { + "type": "Identifier", + "start":65,"end":70,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, + "name": "error" + } + }, + "arguments": [ + { + "type": "Identifier", + "start":71,"end":76,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, + "name": "error" + } + ] + } + } + ], + "directives": [] + } + }, + "finalizer": { + "type": "BlockStatement", + "start":91,"end":107,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":26}}, + "body": [ + { + "type": "ExpressionStatement", + "start":93,"end":105,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":24}}, + "expression": { + "type": "CallExpression", + "start":93,"end":104,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":23}}, + "callee": { + "type": "Identifier", + "start":93,"end":102,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":21},"identifierName":"something"}, + "name": "something" + }, + "arguments": [] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/output.json new file mode 100644 index 000000000000..f3a4ae5554aa --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/output.json @@ -0,0 +1,125 @@ +{ + "type": "File", + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "program": { + "type": "Program", + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":82,"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": "DoExpression", + "start":9,"end":82,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, + "body": { + "type": "BlockStatement", + "start":12,"end":82,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, + "body": [ + { + "type": "TryStatement", + "start":16,"end":80,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":41}}, + "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" + }, + "computed": false, + "property": { + "type": "Identifier", + "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, + "name": "parse" + } + }, + "arguments": [ + { + "type": "TopicReference", + "start":33,"end":34,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}} + } + ] + } + } + ], + "directives": [] + }, + "handler": { + "type": "CatchClause", + "start":41,"end":80,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, + "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":80,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, + "body": [ + { + "type": "ExpressionStatement", + "start":57,"end":78,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, + "expression": { + "type": "CallExpression", + "start":57,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, + "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" + }, + "computed": false, + "property": { + "type": "Identifier", + "start":65,"end":70,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, + "name": "error" + } + }, + "arguments": [ + { + "type": "Identifier", + "start":71,"end":76,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, + "name": "error" + } + ] + } + } + ], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/output.json new file mode 100644 index 000000000000..b8da20531f7b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/output.json @@ -0,0 +1,79 @@ +{ + "type": "File", + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, + "program": { + "type": "Program", + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, + "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": "DoExpression", + "start":9,"end":37,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":37}}, + "body": { + "type": "BlockStatement", + "start":12,"end":37,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":37}}, + "body": [ + { + "type": "WhileStatement", + "start":14,"end":35,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":35}}, + "test": { + "type": "BinaryExpression", + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, + "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": "TopicReference", + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}} + } + }, + "body": { + "type": "ExpressionStatement", + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, + "expression": { + "type": "AssignmentExpression", + "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}}, + "operator": "+=", + "left": { + "type": "Identifier", + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, + "name": "x" + }, + "right": { + "type": "NumericLiteral", + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34}}, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} 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/hack-proposal-function-call-with-topic-in-argument/output.json similarity index 58% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/output.json index 556699d07afc..81ae12185c6c 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/output.json @@ -1,9 +1,6 @@ { "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}}, @@ -23,23 +20,19 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "CallExpression", "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 - } + "callee": { + "type": "Identifier", + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, + "name": "f" + }, + "arguments": [ + { + "type": "TopicReference", + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} + } + ] } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-without-topic/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-without-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-without-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-without-topic/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-without-topic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-without-topic/output.json similarity index 78% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-without-topic/output.json index cb533784bce8..c24eaf24c986 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-without-topic/output.json @@ -1,6 +1,9 @@ { "type": "File", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, + "errors": [ + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:9)" + ], "program": { "type": "Program", "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, @@ -20,12 +23,9 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, - "expression": { - "type": "PipelinePrimaryTopicReference", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}} - } + "type": "Identifier", + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, + "name": "f" } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/output.json new file mode 100644 index 000000000000..3895abf6bf98 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/output.json @@ -0,0 +1,65 @@ +{ + "type": "File", + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, + "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": "BinaryExpression", + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, + "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": "FunctionExpression", + "start":9,"end":39,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":39}}, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, + "left": { + "type": "Identifier", + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, + "name": "x" + }, + "right": { + "type": "TopicReference", + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} + } + } + ], + "body": { + "type": "BlockStatement", + "start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}}, + "body": [ + { + "type": "ReturnStatement", + "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37}}, + "argument": { + "type": "Identifier", + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"x"}, + "name": "x" + } + } + ], + "directives": [] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/output.json similarity index 68% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/output.json index 3df77e4676db..3ba1c1563043 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/output.json @@ -35,20 +35,16 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", - "start":32,"end":41,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":23}}, - "expression": { - "type": "YieldExpression", - "start":33,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, - "delegate": false, - "argument": { - "type": "PipelinePrimaryTopicReference", - "start":39,"end":40,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}} - }, - "extra": { - "parenthesized": true, - "parenStart": 32 - } + "type": "YieldExpression", + "start":33,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, + "extra": { + "parenthesized": true, + "parenStart": 32 + }, + "delegate": false, + "argument": { + "type": "TopicReference", + "start":39,"end":40,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-invalid-hash-token,-followed-by-digit/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-followed-by-digit/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-invalid-hash-token,-followed-by-digit/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-followed-by-digit/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-followed-by-digit/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-followed-by-digit/options.json new file mode 100644 index 000000000000..2d4df410c590 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-followed-by-digit/options.json @@ -0,0 +1,4 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]], + "throws": "Unexpected digit after hash token (1:5)" +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/options.json new file mode 100644 index 000000000000..5776615207b9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "pipelineOperator"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/output.json similarity index 78% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/output.json index cb533784bce8..26d454dbfd87 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/output.json @@ -20,12 +20,8 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, - "expression": { - "type": "PipelinePrimaryTopicReference", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}} - } + "type": "TopicReference", + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}} } } } 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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/input.js similarity index 100% rename from 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/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json similarity index 50% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json index c6606b33e146..df693ae84d99 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json @@ -1,6 +1,9 @@ { "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, + "errors": [ + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:16)" + ], "program": { "type": "Program", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, @@ -15,26 +18,42 @@ "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "left": { "type": "Identifier", - "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, - "name": "value" + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, + "name": "x" }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", - "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, - "expression": { - "type": "ArrowFunctionExpression", - "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, - "id": null, - "generator": false, - "async": false, - "params": [], - "body": { + "type": "ArrowFunctionExpression", + "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, + "id": null, + "generator": false, + "async": false, + "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": "TopicReference", + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} + }, + "operator": "|>", + "right": { "type": "BinaryExpression", "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "left": { - "type": "PipelinePrimaryTopicReference", - "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} + "type": "Identifier", + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"$"}, + "name": "$" }, "operator": "+", "right": { @@ -46,10 +65,6 @@ }, "value": 1 } - }, - "extra": { - "parenthesized": true, - "parenStart": 9 } } } 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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/input.js similarity index 100% rename from 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/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json new file mode 100644 index 000000000000..9606ec01089c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json @@ -0,0 +1,62 @@ +{ + "type": "File", + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, + "errors": [ + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (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": "ArrowFunctionExpression", + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, + "id": null, + "generator": false, + "async": false, + "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": "TopicReference", + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/input.js new file mode 100644 index 000000000000..a3cfa26e12d6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/input.js @@ -0,0 +1 @@ +x |> ($ => # |> f(#, $) |> # > 1) diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/output.json new file mode 100644 index 000000000000..4fcf20826e22 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function/output.json @@ -0,0 +1,97 @@ +{ + "type": "File", + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, + "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":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "ArrowFunctionExpression", + "start":6,"end":32,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":32}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, + "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":32,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":32}}, + "left": { + "type": "BinaryExpression", + "start":11,"end":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, + "left": { + "type": "TopicReference", + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} + }, + "operator": "|>", + "right": { + "type": "CallExpression", + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, + "callee": { + "type": "Identifier", + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"f"}, + "name": "f" + }, + "arguments": [ + { + "type": "TopicReference", + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} + }, + { + "type": "Identifier", + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"$"}, + "name": "$" + } + ] + } + }, + "operator": "|>", + "right": { + "type": "BinaryExpression", + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, + "left": { + "type": "TopicReference", + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}} + }, + "operator": ">", + "right": { + "type": "NumericLiteral", + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32}}, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + } + } + } + ], + "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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/output.json new file mode 100644 index 000000000000..bc249061cafc --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/output.json @@ -0,0 +1,53 @@ +{ + "type": "File", + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, + "errors": [ + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (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": "BinaryExpression", + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, + "left": { + "type": "TopicReference", + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} + }, + "operator": "|>", + "right": { + "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": [] + } + } + } + } + ], + "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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/output.json new file mode 100644 index 000000000000..0ecf3c56f107 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/output.json @@ -0,0 +1,50 @@ +{ + "type": "File", + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, + "errors": [ + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:11)", + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (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": "BinaryExpression", + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, + "left": { + "type": "Identifier", + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, + "name": "$" + }, + "operator": "|>", + "right": { + "type": "Identifier", + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, + "name": "f" + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines/output.json new file mode 100644 index 000000000000..12c2619c004c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines/output.json @@ -0,0 +1,60 @@ +{ + "type": "File", + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":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": "ExpressionStatement", + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, + "expression": { + "type": "BinaryExpression", + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, + "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": "BinaryExpression", + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, + "extra": { + "parenthesized": true, + "parenStart": 5 + }, + "left": { + "type": "TopicReference", + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} + }, + "operator": "|>", + "right": { + "type": "CallExpression", + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, + "callee": { + "type": "Identifier", + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, + "name": "f" + }, + "arguments": [ + { + "type": "TopicReference", + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14}} + }, + { + "type": "Identifier", + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"x"}, + "name": "x" + } + ] + } + } + } + } + ], + "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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} 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/hack-proposal-no-topic-class-expression/output.json similarity index 65% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/output.json index 4c0d88c5a719..ab56f8ff6bfe 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:9)" ], "program": { "type": "Program", @@ -23,18 +23,14 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "ClassExpression", "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": [] - } + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, + "body": [] } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} 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/hack-proposal-no-topic-function-expression/output.json similarity index 50% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/output.json index 18fa5a9166ad..05db60755e26 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:9)" ], "program": { "type": "Program", @@ -23,33 +23,29 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", + "type": "FunctionExpression", "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": [ + "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": "Identifier", - "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, - "name": "x" + "type": "ReturnStatement", + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, + "argument": null } ], - "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": [] } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-simple/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-simple-unbound-topic/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-simple/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-simple-unbound-topic/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-simple/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-simple-unbound-topic/options.json similarity index 79% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-simple/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-simple-unbound-topic/options.json index 602ec88c9337..1051e014e79f 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-simple/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-simple-unbound-topic/options.json @@ -3,9 +3,9 @@ [ "pipelineOperator", { - "proposal": "smart" + "proposal": "hack" } ] ], "throws": "Unexpected token (1:4)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/output.json similarity index 68% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/output.json index 81102e182a6e..90324568fe54 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/output.json @@ -20,15 +20,11 @@ }, "operator": "|>", "right": { - "type": "PipelineTopicExpression", - "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, - "expression": { - "type": "PipelinePrimaryTopicReference", - "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, - "extra": { - "parenthesized": true, - "parenStart": 9 - } + "type": "TopicReference", + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, + "extra": { + "parenthesized": true, + "parenStart": 9 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/options.json new file mode 100644 index 000000000000..bbfdd3ecc63c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/output.json similarity index 76% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/output.json index 2468104c6898..26d454dbfd87 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/output.json @@ -20,13 +20,8 @@ }, "operator": "|>", "right": { - "type": "PipelineBareFunction", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}}, - "callee": { - "type": "Identifier", - "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, - "name": "f" - } + "type": "TopicReference", + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/invalid-proposal/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/invalid-proposal/options.json index d8fca74323cf..3bda6a4723fc 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/invalid-proposal/options.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/invalid-proposal/options.json @@ -1,4 +1,4 @@ { "plugins": [["pipelineOperator", { "proposal": "invalid" }]], - "throws": "'pipelineOperator' requires 'proposal' option whose value should be one of: 'minimal', 'smart', 'fsharp'" + "throws": "'pipelineOperator' requires 'proposal' option whose value should be one of: 'minimal', 'fsharp', 'hack'" } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-arrow-requires-parens-with-parend-args/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-arrow-requires-parens-with-parend-args/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-arrow-requires-parens-with-parend-args/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-arrow-requires-parens-with-parend-args/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-arrow-requires-parens-with-parend-args/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-arrow-requires-parens-with-parend-args/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-arrow-requires-parens-with-parend-args/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-arrow-requires-parens-with-parend-args/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-arrow-requires-parens/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-arrow-requires-parens/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-arrow-requires-parens/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-arrow-requires-parens/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-arrow-requires-parens/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-arrow-requires-parens/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-arrow-requires-parens/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-arrow-requires-parens/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-await-requires-parens/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-await-requires-parens/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-await-requires-parens/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-await-requires-parens/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-await-requires-parens/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-await-requires-parens/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await-f/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-ban-await-f/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await-f/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-ban-await-f/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await-f/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-ban-await-f/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await-f/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-ban-await-f/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-ban-await/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-ban-await/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-ban-await/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-ban-await/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-ban-await/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-base/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-base/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-base/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-base/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-base/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-base/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-chain/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-chain/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-chain/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-chain/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-chain/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-chain/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-multiline/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-multiline/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-multiline/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-multiline/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-multiline/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-multiline/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-precedence/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-precedence/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-precedence/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-precedence/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-precedence/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-precedence/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow-parend-params/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow-parend-params/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow-parend-params/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow-parend-params/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow-parend-params/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow-parend-params/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/options.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/minimal-proposal-with-arrow/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/input.js deleted file mode 100644 index 49a8129b058f..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/input.js +++ /dev/null @@ -1,4 +0,0 @@ -let result = "hello" -|> doubleSay -|> text.capitalize -|> a.b.exclaim; diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/output.json deleted file mode 100644 index a5c71deacef5..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/output.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "type": "File", - "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":15}}, - "program": { - "type": "Program", - "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":15}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "VariableDeclaration", - "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":15}}, - "declarations": [ - { - "type": "VariableDeclarator", - "start":4,"end":67,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":14}}, - "id": { - "type": "Identifier", - "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"result"}, - "name": "result" - }, - "init": { - "type": "BinaryExpression", - "start":13,"end":67,"loc":{"start":{"line":1,"column":13},"end":{"line":4,"column":14}}, - "left": { - "type": "BinaryExpression", - "start":13,"end":52,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":18}}, - "left": { - "type": "BinaryExpression", - "start":13,"end":33,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":12}}, - "left": { - "type": "StringLiteral", - "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, - "extra": { - "rawValue": "hello", - "raw": "\"hello\"" - }, - "value": "hello" - }, - "operator": "|>", - "right": { - "type": "PipelineBareFunction", - "start":24,"end":33,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":12}}, - "callee": { - "type": "Identifier", - "start":24,"end":33,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":12},"identifierName":"doubleSay"}, - "name": "doubleSay" - } - } - }, - "operator": "|>", - "right": { - "type": "PipelineBareFunction", - "start":37,"end":52,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":18}}, - "callee": { - "type": "MemberExpression", - "start":37,"end":52,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":18}}, - "object": { - "type": "Identifier", - "start":37,"end":41,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":7},"identifierName":"text"}, - "name": "text" - }, - "property": { - "type": "Identifier", - "start":42,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":18},"identifierName":"capitalize"}, - "name": "capitalize" - }, - "computed": false - } - } - }, - "operator": "|>", - "right": { - "type": "PipelineBareFunction", - "start":56,"end":67,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":14}}, - "callee": { - "type": "MemberExpression", - "start":56,"end":67,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":14}}, - "object": { - "type": "MemberExpression", - "start":56,"end":59,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":6}}, - "object": { - "type": "Identifier", - "start":56,"end":57,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":4},"identifierName":"a"}, - "name": "a" - }, - "property": { - "type": "Identifier", - "start":58,"end":59,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":6},"identifierName":"b"}, - "name": "b" - }, - "computed": false - }, - "property": { - "type": "Identifier", - "start":60,"end":67,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":14},"identifierName":"exclaim"}, - "name": "exclaim" - }, - "computed": false - } - } - } - } - ], - "kind": "let" - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/input.js deleted file mode 100644 index 253a8fdfddf9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/input.js +++ /dev/null @@ -1 +0,0 @@ -x => x |> number.inc |> double diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/output.json deleted file mode 100644 index 0827c20fe911..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/output.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "type": "File", - "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, - "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":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"x"}, - "name": "x" - } - ], - "body": { - "type": "BinaryExpression", - "start":5,"end":30,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":30}}, - "left": { - "type": "BinaryExpression", - "start":5,"end":20,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":20}}, - "left": { - "type": "Identifier", - "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"x"}, - "name": "x" - }, - "operator": "|>", - "right": { - "type": "PipelineBareFunction", - "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, - "callee": { - "type": "MemberExpression", - "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, - "object": { - "type": "Identifier", - "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16},"identifierName":"number"}, - "name": "number" - }, - "property": { - "type": "Identifier", - "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"inc"}, - "name": "inc" - }, - "computed": false - } - } - }, - "operator": "|>", - "right": { - "type": "PipelineBareFunction", - "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, - "callee": { - "type": "Identifier", - "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"double"}, - "name": "double" - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/input.js deleted file mode 100644 index 9f9ac30d8f48..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/input.js +++ /dev/null @@ -1 +0,0 @@ -value |> a.b.c.f diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/output.json deleted file mode 100644 index 8ae28448c08d..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/output.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "type": "File", - "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "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": "BinaryExpression", - "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":16}}, - "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": "PipelineBareFunction", - "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, - "callee": { - "type": "MemberExpression", - "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, - "object": { - "type": "MemberExpression", - "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, - "object": { - "type": "MemberExpression", - "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, - "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": false - }, - "property": { - "type": "Identifier", - "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"c"}, - "name": "c" - }, - "computed": false - }, - "property": { - "type": "Identifier", - "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"f"}, - "name": "f" - }, - "computed": false - } - } - } - } - ], - "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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/input.js deleted file mode 100644 index a93aa77bbd74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/input.js +++ /dev/null @@ -1 +0,0 @@ -(1, 2) |> f; 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 deleted file mode 100644 index 279df0af85ba..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/options.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugins": [ - [ - "pipelineOperator", - { - "proposal": "smart" - } - ] - ] -} 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 deleted file mode 100644 index 21cf0ef9779b..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "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,-invalid-hash-token,-followed-by-digit/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-invalid-hash-token,-followed-by-digit/options.json deleted file mode 100644 index a2f6f625f90c..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-invalid-hash-token,-followed-by-digit/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Unexpected digit after hash token (1:5)" -} 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/input.js 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/input.js deleted file mode 100644 index 194b4e64ed1f..000000000000 --- 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/input.js +++ /dev/null @@ -1 +0,0 @@ -x |> ($ => $ |> f) 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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index d7262f7ab729..000000000000 --- 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 +++ /dev/null @@ -1,71 +0,0 @@ -{ - "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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index e8ce055d0d81..000000000000 --- 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 +++ /dev/null @@ -1,84 +0,0 @@ -{ - "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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 1c55597d1ea8..000000000000 --- 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 +++ /dev/null @@ -1,70 +0,0 @@ -{ - "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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 4e08420cc88a..000000000000 --- 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 +++ /dev/null @@ -1,61 +0,0 @@ -{ - "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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 9c89df8ebff9..000000000000 --- 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 +++ /dev/null @@ -1,57 +0,0 @@ -{ - "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/input.js 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/input.js deleted file mode 100644 index a6146afadab6..000000000000 --- 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/input.js +++ /dev/null @@ -1 +0,0 @@ -10 |> (#, #) |> h; 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 deleted file mode 100644 index 279df0af85ba..000000000000 --- 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 +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugins": [ - [ - "pipelineOperator", - { - "proposal": "smart" - } - ] - ] -} 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 deleted file mode 100644 index f4a75092e3cf..000000000000 --- 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 +++ /dev/null @@ -1,70 +0,0 @@ -{ - "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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/input.js deleted file mode 100644 index 7da42e013c11..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/input.js +++ /dev/null @@ -1 +0,0 @@ -10 |> (#, #); 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 deleted file mode 100644 index 279df0af85ba..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/options.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "plugins": [ - [ - "pipelineOperator", - { - "proposal": "smart" - } - ] - ] -} 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 deleted file mode 100644 index c774d9cb44f7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} 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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} 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 deleted file mode 100644 index 8b34c84f521f..000000000000 --- 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 +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index edb7679c6a74..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 06a45df42fac..000000000000 --- 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 +++ /dev/null @@ -1,87 +0,0 @@ -{ - "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/input.js 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/input.js deleted file mode 100644 index 261f95e4c7d2..000000000000 --- 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/input.js +++ /dev/null @@ -1,3 +0,0 @@ -async function af () { - value |> do { for await (const e of sequence) #; } -} 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 deleted file mode 100644 index 680f780892b7..000000000000 --- 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 +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugins": [ - ["pipelineOperator", { "proposal": "smart" }], - "doExpressions", - "asyncGenerators" - ] -} 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 deleted file mode 100644 index e673a7df67c9..000000000000 --- 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 +++ /dev/null @@ -1,100 +0,0 @@ -{ - "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/input.js 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/input.js deleted file mode 100644 index e0eb815c73fb..000000000000 --- 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/input.js +++ /dev/null @@ -1 +0,0 @@ -value |> do { for (let i = 0; i < n; i += 1) #; } 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 deleted file mode 100644 index edb7679c6a74..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index b413aeb837f3..000000000000 --- 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 +++ /dev/null @@ -1,117 +0,0 @@ -{ - "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/input.js 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/input.js deleted file mode 100644 index f6ebfaf94818..000000000000 --- 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/input.js +++ /dev/null @@ -1 +0,0 @@ -value |> do { for (e in object) #; } 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 deleted file mode 100644 index edb7679c6a74..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index f907f6c39b60..000000000000 --- 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 +++ /dev/null @@ -1,68 +0,0 @@ -{ - "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/input.js 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/input.js deleted file mode 100644 index b3350a5ad5e0..000000000000 --- 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/input.js +++ /dev/null @@ -1 +0,0 @@ -value |> do { for (e of sequence) #; } 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 deleted file mode 100644 index edb7679c6a74..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index b5610cbd5590..000000000000 --- 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 +++ /dev/null @@ -1,69 +0,0 @@ -{ - "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/input.js 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/input.js deleted file mode 100644 index bd64c4dd8768..000000000000 --- 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/input.js +++ /dev/null @@ -1,4 +0,0 @@ -value |> do { - try { JSON.parse(#); } - catch (error) { console.error(#); } -} 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 deleted file mode 100644 index edb7679c6a74..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index cd596f541bf2..000000000000 --- 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 +++ /dev/null @@ -1,131 +0,0 @@ -{ - "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/input.js 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/input.js deleted file mode 100644 index 06cfc1f2bed0..000000000000 --- 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/input.js +++ /dev/null @@ -1 +0,0 @@ -value |> do { while (x < 50) x += #; } 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 deleted file mode 100644 index edb7679c6a74..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index cde715cc8a70..000000000000 --- 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 +++ /dev/null @@ -1,87 +0,0 @@ -{ - "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/input.js 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/input.js deleted file mode 100644 index 4872290c9926..000000000000 --- 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/input.js +++ /dev/null @@ -1 +0,0 @@ -value |> do { with ({}) #; } 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 deleted file mode 100644 index edb7679c6a74..000000000000 --- 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 +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 10719f0083a3..000000000000 --- 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 +++ /dev/null @@ -1,63 +0,0 @@ -{ - "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,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/options.json deleted file mode 100644 index a684795fbfb9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unparenthesized-arrow-function-with-bare-parameter-and-bare-body/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]], - "throws": "Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized (1:8)" -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/input.js deleted file mode 100644 index a905d1b71159..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/input.js +++ /dev/null @@ -1 +0,0 @@ -x |> class { constructor () { this.x = #; } } 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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 499705448de1..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/input.js deleted file mode 100644 index 8af92dbefe4a..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/input.js +++ /dev/null @@ -1 +0,0 @@ -x |> function () { # } 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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 1aa91e74b179..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "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/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/input.js deleted file mode 100644 index 818748040ed7..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/input.js +++ /dev/null @@ -1 +0,0 @@ -x |> function () { # |> # } 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 deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "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 deleted file mode 100644 index 6c2b7a1acf34..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "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/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/input.js deleted file mode 100644 index a5a21763a8eb..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/input.js +++ /dev/null @@ -1 +0,0 @@ -x |> (() => # |> f) diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/output.json deleted file mode 100644 index 2aeb5206b521..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/output.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "type": "File", - "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":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": "ExpressionStatement", - "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, - "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":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, - "expression": { - "type": "ArrowFunctionExpression", - "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, - "id": null, - "generator": false, - "async": false, - "params": [], - "body": { - "type": "BinaryExpression", - "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, - "left": { - "type": "PipelinePrimaryTopicReference", - "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} - }, - "operator": "|>", - "right": { - "type": "PipelineBareFunction", - "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, - "callee": { - "type": "Identifier", - "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"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-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/input.js deleted file mode 100644 index e8fc8e430b8e..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/input.js +++ /dev/null @@ -1 +0,0 @@ -x |> ($ => # |> f(#, $)) diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/output.json deleted file mode 100644 index c110c8d1783f..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/output.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "type": "File", - "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, - "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": "BinaryExpression", - "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, - "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":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, - "expression": { - "type": "ArrowFunctionExpression", - "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, - "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":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, - "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":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, - "expression": { - "type": "CallExpression", - "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, - "callee": { - "type": "Identifier", - "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"f"}, - "name": "f" - }, - "arguments": [ - { - "type": "PipelinePrimaryTopicReference", - "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} - }, - { - "type": "Identifier", - "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"$"}, - "name": "$" - } - ] - } - } - }, - "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-nested-pipelines,-topic-style-with-inner-bare-style/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/input.js deleted file mode 100644 index a462b80cbbd8..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/input.js +++ /dev/null @@ -1 +0,0 @@ -x |> (# |> f) diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/output.json deleted file mode 100644 index 4259a597ed79..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/output.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "type": "File", - "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, - "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": "PipelinePrimaryTopicReference", - "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} - }, - "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-nested-pipelines,-topic-style-with-inner-topic-style/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/output.json deleted file mode 100644 index a2fd989f47a3..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/output.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "type": "File", - "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":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": "ExpressionStatement", - "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, - "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":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, - "expression": { - "type": "BinaryExpression", - "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, - "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":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, - "expression": { - "type": "CallExpression", - "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, - "callee": { - "type": "Identifier", - "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, - "name": "f" - }, - "arguments": [ - { - "type": "PipelinePrimaryTopicReference", - "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14}} - }, - { - "type": "Identifier", - "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"x"}, - "name": "x" - } - ] - } - }, - "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-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/output.json deleted file mode 100644 index 0321177a1072..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/output.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type": "File", - "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, - "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": "BinaryExpression", - "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":41}}, - "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":41,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":41}}, - "expression": { - "type": "DoExpression", - "start":9,"end":41,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":41}}, - "body": { - "type": "BlockStatement", - "start":12,"end":41,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":41}}, - "body": [ - { - "type": "DoWhileStatement", - "start":14,"end":39,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":39}}, - "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": "NumericLiteral", - "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - } - } - }, - "test": { - "type": "BinaryExpression", - "start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37}}, - "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": "PipelinePrimaryTopicReference", - "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37}} - } - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/output.json deleted file mode 100644 index aebaee1b7d4e..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/output.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "type": "File", - "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, - "program": { - "type": "Program", - "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "FunctionDeclaration", - "start":0,"end":70,"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":70,"loc":{"start":{"line":1,"column":21},"end":{"line":3,"column":1}}, - "body": [ - { - "type": "ExpressionStatement", - "start":25,"end":68,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":45}}, - "expression": { - "type": "BinaryExpression", - "start":25,"end":68,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":45}}, - "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":68,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":45}}, - "expression": { - "type": "DoExpression", - "start":34,"end":68,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":45}}, - "body": { - "type": "BlockStatement", - "start":37,"end":68,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":45}}, - "body": [ - { - "type": "ForOfStatement", - "start":39,"end":66,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":43}}, - "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": "PipelinePrimaryTopicReference", - "start":61,"end":62,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":39}} - }, - "body": { - "type": "ExpressionStatement", - "start":64,"end":66,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":43}}, - "expression": { - "type": "Identifier", - "start":64,"end":65,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":42},"identifierName":"e"}, - "name": "e" - } - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/output.json deleted file mode 100644 index a6331818eb10..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/output.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "type": "File", - "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, - "program": { - "type": "Program", - "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "ExpressionStatement", - "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, - "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":59,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":59}}, - "expression": { - "type": "DoExpression", - "start":9,"end":59,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":59}}, - "body": { - "type": "BlockStatement", - "start":12,"end":59,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":59}}, - "body": [ - { - "type": "ForStatement", - "start":14,"end":57,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":57}}, - "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": "PipelinePrimaryTopicReference", - "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}} - } - } - ], - "kind": "let" - }, - "test": { - "type": "CallExpression", - "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}}, - "callee": { - "type": "Identifier", - "start":30,"end":39,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":39},"identifierName":"predicate"}, - "name": "predicate" - }, - "arguments": [ - { - "type": "Identifier", - "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"i"}, - "name": "i" - }, - { - "type": "PipelinePrimaryTopicReference", - "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44}} - } - ] - }, - "update": { - "type": "AssignmentExpression", - "start":47,"end":53,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":53}}, - "operator": "+=", - "left": { - "type": "Identifier", - "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"i"}, - "name": "i" - }, - "right": { - "type": "PipelinePrimaryTopicReference", - "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53}} - } - }, - "body": { - "type": "ExpressionStatement", - "start":55,"end":57,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":57}}, - "expression": { - "type": "Identifier", - "start":55,"end":56,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":56},"identifierName":"i"}, - "name": "i" - } - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/output.json deleted file mode 100644 index e3b406e4daa4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/output.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "type": "File", - "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, - "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":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, - "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":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, - "expression": { - "type": "DoExpression", - "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, - "body": { - "type": "BlockStatement", - "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, - "body": [ - { - "type": "ForInStatement", - "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, - "left": { - "type": "Identifier", - "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"e"}, - "name": "e" - }, - "right": { - "type": "PipelinePrimaryTopicReference", - "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} - }, - "body": { - "type": "ExpressionStatement", - "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, - "expression": { - "type": "Identifier", - "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"e"}, - "name": "e" - } - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/output.json deleted file mode 100644 index 297a910a329c..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/output.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "type": "File", - "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, - "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":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, - "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":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, - "expression": { - "type": "DoExpression", - "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, - "body": { - "type": "BlockStatement", - "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, - "body": [ - { - "type": "ForOfStatement", - "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, - "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": "PipelinePrimaryTopicReference", - "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} - }, - "body": { - "type": "ExpressionStatement", - "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, - "expression": { - "type": "Identifier", - "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"e"}, - "name": "e" - } - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/output.json deleted file mode 100644 index 57f62fe4a6b1..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/output.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "type": "File", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, - "program": { - "type": "Program", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "ExpressionStatement", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":46}}, - "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":46,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":46}}, - "expression": { - "type": "DoExpression", - "start":9,"end":46,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":46}}, - "body": { - "type": "BlockStatement", - "start":12,"end":46,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":46}}, - "body": [ - { - "type": "IfStatement", - "start":14,"end":44,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":44}}, - "test": { - "type": "Identifier", - "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, - "name": "yes" - }, - "consequent": { - "type": "ExpressionStatement", - "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, - "expression": { - "type": "NullLiteral", - "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}} - } - }, - "alternate": { - "type": "IfStatement", - "start":34,"end":44,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":44}}, - "test": { - "type": "Identifier", - "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40},"identifierName":"no"}, - "name": "no" - }, - "consequent": { - "type": "ExpressionStatement", - "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, - "expression": { - "type": "PipelinePrimaryTopicReference", - "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}} - } - }, - "alternate": null - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/output.json deleted file mode 100644 index 2c33b45a64be..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/output.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "type": "File", - "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":38}}, - "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": "IfStatement", - "start":14,"end":36,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":36}}, - "test": { - "type": "Identifier", - "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, - "name": "yes" - }, - "consequent": { - "type": "ExpressionStatement", - "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, - "expression": { - "type": "NullLiteral", - "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}} - } - }, - "alternate": { - "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-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/output.json deleted file mode 100644 index a2a0ef2bc6b6..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/output.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "type": "File", - "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, - "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":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, - "name": "value" - }, - "operator": "|>", - "right": { - "type": "PipelineTopicExpression", - "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, - "expression": { - "type": "DoExpression", - "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, - "body": { - "type": "BlockStatement", - "start":12,"end":27,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":27}}, - "body": [ - { - "type": "IfStatement", - "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25}}, - "test": { - "type": "Identifier", - "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, - "name": "yes" - }, - "consequent": { - "type": "ExpressionStatement", - "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, - "expression": { - "type": "PipelinePrimaryTopicReference", - "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} - } - }, - "alternate": null - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/output.json deleted file mode 100644 index e966a43e47ea..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/output.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "type": "File", - "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, - "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": "DoExpression", - "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, - "body": { - "type": "BlockStatement", - "start":12,"end":33,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":33}}, - "body": [ - { - "type": "IfStatement", - "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, - "test": { - "type": "PipelinePrimaryTopicReference", - "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} - }, - "consequent": { - "type": "ExpressionStatement", - "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, - "expression": { - "type": "NumericLiteral", - "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - } - }, - "alternate": { - "type": "ExpressionStatement", - "start":29,"end":31,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":31}}, - "expression": { - "type": "NumericLiteral", - "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, - "extra": { - "rawValue": 0, - "raw": "0" - }, - "value": 0 - } - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/output.json deleted file mode 100644 index 6ea4db4a6f24..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/output.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "type": "File", - "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, - "program": { - "type": "Program", - "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "ExpressionStatement", - "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"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":94,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, - "expression": { - "type": "DoExpression", - "start":9,"end":94,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, - "body": { - "type": "BlockStatement", - "start":12,"end":94,"loc":{"start":{"line":1,"column":12},"end":{"line":7,"column":1}}, - "body": [ - { - "type": "SwitchStatement", - "start":16,"end":92,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, - "discriminant": { - "type": "Identifier", - "start":24,"end":30,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16},"identifierName":"number"}, - "name": "number" - }, - "cases": [ - { - "type": "SwitchCase", - "start":38,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, - "consequent": [ - { - "type": "ExpressionStatement", - "start":46,"end":48,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, - "expression": { - "type": "PipelinePrimaryTopicReference", - "start":46,"end":47,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}} - } - } - ], - "test": { - "type": "NumericLiteral", - "start":43,"end":44,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, - "extra": { - "rawValue": 0, - "raw": "0" - }, - "value": 0 - } - }, - { - "type": "SwitchCase", - "start":53,"end":67,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":18}}, - "consequent": [ - { - "type": "ExpressionStatement", - "start":61,"end":67,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":18}}, - "expression": { - "type": "BinaryExpression", - "start":61,"end":66,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":17}}, - "left": { - "type": "PipelinePrimaryTopicReference", - "start":61,"end":62,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13}} - }, - "operator": "+", - "right": { - "type": "NumericLiteral", - "start":65,"end":66,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":17}}, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - } - } - } - ], - "test": { - "type": "NumericLiteral", - "start":58,"end":59,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}}, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - } - }, - { - "type": "SwitchCase", - "start":72,"end":88,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":20}}, - "consequent": [ - { - "type": "ExpressionStatement", - "start":81,"end":88,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":20}}, - "expression": { - "type": "BinaryExpression", - "start":81,"end":87,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":19}}, - "left": { - "type": "PipelinePrimaryTopicReference", - "start":81,"end":82,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":14}} - }, - "operator": "+", - "right": { - "type": "NumericLiteral", - "start":85,"end":87,"loc":{"start":{"line":5,"column":17},"end":{"line":5,"column":19}}, - "extra": { - "rawValue": 10, - "raw": "10" - }, - "value": 10 - } - } - } - ], - "test": null - } - ] - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/output.json deleted file mode 100644 index 215e0119e445..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/output.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "type": "File", - "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, - "program": { - "type": "Program", - "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "ExpressionStatement", - "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"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":83,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, - "expression": { - "type": "DoExpression", - "start":9,"end":83,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, - "body": { - "type": "BlockStatement", - "start":12,"end":83,"loc":{"start":{"line":1,"column":12},"end":{"line":7,"column":1}}, - "body": [ - { - "type": "SwitchStatement", - "start":16,"end":81,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, - "discriminant": { - "type": "PipelinePrimaryTopicReference", - "start":24,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}} - }, - "cases": [ - { - "type": "SwitchCase", - "start":33,"end":44,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":15}}, - "consequent": [ - { - "type": "ExpressionStatement", - "start":41,"end":44,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":15}}, - "expression": { - "type": "NumericLiteral", - "start":41,"end":43,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, - "extra": { - "rawValue": 50, - "raw": "50" - }, - "value": 50 - } - } - ], - "test": { - "type": "NumericLiteral", - "start":38,"end":39,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, - "extra": { - "rawValue": 0, - "raw": "0" - }, - "value": 0 - } - }, - { - "type": "SwitchCase", - "start":49,"end":60,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}}, - "consequent": [ - { - "type": "ExpressionStatement", - "start":57,"end":60,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":15}}, - "expression": { - "type": "NumericLiteral", - "start":57,"end":59,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":14}}, - "extra": { - "rawValue": 60, - "raw": "60" - }, - "value": 60 - } - } - ], - "test": { - "type": "NumericLiteral", - "start":54,"end":55,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}}, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - } - }, - { - "type": "SwitchCase", - "start":65,"end":77,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":16}}, - "consequent": [ - { - "type": "ExpressionStatement", - "start":74,"end":77,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":16}}, - "expression": { - "type": "NumericLiteral", - "start":74,"end":76,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":15}}, - "extra": { - "rawValue": 70, - "raw": "70" - }, - "value": 70 - } - } - ], - "test": null - } - ] - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/output.json deleted file mode 100644 index 8493ab87355f..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/output.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "type": "File", - "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, - "program": { - "type": "Program", - "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "ExpressionStatement", - "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"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":117,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, - "expression": { - "type": "DoExpression", - "start":9,"end":117,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, - "body": { - "type": "BlockStatement", - "start":12,"end":117,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, - "body": [ - { - "type": "TryStatement", - "start":16,"end":115,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":27}}, - "block": { - "type": "BlockStatement", - "start":20,"end":45,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":31}}, - "body": [ - { - "type": "ExpressionStatement", - "start":22,"end":43,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":29}}, - "expression": { - "type": "CallExpression", - "start":22,"end":42,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":28}}, - "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": "Identifier", - "start":33,"end":41,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27},"identifierName":"whatever"}, - "name": "whatever" - } - ] - } - } - ], - "directives": [] - }, - "handler": { - "type": "CatchClause", - "start":48,"end":87,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, - "param": { - "type": "Identifier", - "start":55,"end":60,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":14},"identifierName":"error"}, - "name": "error" - }, - "body": { - "type": "BlockStatement", - "start":62,"end":87,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, - "body": [ - { - "type": "ExpressionStatement", - "start":64,"end":85,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, - "expression": { - "type": "CallExpression", - "start":64,"end":84,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, - "callee": { - "type": "MemberExpression", - "start":64,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":31}}, - "object": { - "type": "Identifier", - "start":64,"end":71,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"console"}, - "name": "console" - }, - "property": { - "type": "Identifier", - "start":72,"end":77,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, - "name": "error" - }, - "computed": false - }, - "arguments": [ - { - "type": "Identifier", - "start":78,"end":83,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, - "name": "error" - } - ] - } - } - ], - "directives": [] - } - }, - "finalizer": { - "type": "BlockStatement", - "start":98,"end":115,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":27}}, - "body": [ - { - "type": "ExpressionStatement", - "start":100,"end":113,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":25}}, - "expression": { - "type": "CallExpression", - "start":100,"end":112,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":24}}, - "callee": { - "type": "Identifier", - "start":100,"end":109,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":21},"identifierName":"something"}, - "name": "something" - }, - "arguments": [ - { - "type": "PipelinePrimaryTopicReference", - "start":110,"end":111,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":23}} - } - ] - } - } - ], - "directives": [] - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/output.json deleted file mode 100644 index 117b71e8c537..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/output.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "type": "File", - "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, - "program": { - "type": "Program", - "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "ExpressionStatement", - "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"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":109,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, - "expression": { - "type": "DoExpression", - "start":9,"end":109,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, - "body": { - "type": "BlockStatement", - "start":12,"end":109,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, - "body": [ - { - "type": "TryStatement", - "start":16,"end":107,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":26}}, - "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":80,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, - "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":80,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, - "body": [ - { - "type": "ExpressionStatement", - "start":57,"end":78,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, - "expression": { - "type": "CallExpression", - "start":57,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, - "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": "Identifier", - "start":71,"end":76,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, - "name": "error" - } - ] - } - } - ], - "directives": [] - } - }, - "finalizer": { - "type": "BlockStatement", - "start":91,"end":107,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":26}}, - "body": [ - { - "type": "ExpressionStatement", - "start":93,"end":105,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":24}}, - "expression": { - "type": "CallExpression", - "start":93,"end":104,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":23}}, - "callee": { - "type": "Identifier", - "start":93,"end":102,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":21},"identifierName":"something"}, - "name": "something" - }, - "arguments": [] - } - } - ], - "directives": [] - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/output.json deleted file mode 100644 index 74e0c37287ce..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/output.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "type": "File", - "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, - "program": { - "type": "Program", - "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "ExpressionStatement", - "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":82,"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":82,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, - "expression": { - "type": "DoExpression", - "start":9,"end":82,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, - "body": { - "type": "BlockStatement", - "start":12,"end":82,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, - "body": [ - { - "type": "TryStatement", - "start":16,"end":80,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":41}}, - "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":80,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, - "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":80,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, - "body": [ - { - "type": "ExpressionStatement", - "start":57,"end":78,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, - "expression": { - "type": "CallExpression", - "start":57,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, - "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": "Identifier", - "start":71,"end":76,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, - "name": "error" - } - ] - } - } - ], - "directives": [] - } - }, - "finalizer": null - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "doExpressions"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/output.json deleted file mode 100644 index 0e266f4100f6..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/output.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "type": "File", - "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, - "program": { - "type": "Program", - "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, - "sourceType": "script", - "interpreter": null, - "body": [ - { - "type": "ExpressionStatement", - "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, - "expression": { - "type": "BinaryExpression", - "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, - "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":37,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":37}}, - "expression": { - "type": "DoExpression", - "start":9,"end":37,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":37}}, - "body": { - "type": "BlockStatement", - "start":12,"end":37,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":37}}, - "body": [ - { - "type": "WhileStatement", - "start":14,"end":35,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":35}}, - "test": { - "type": "BinaryExpression", - "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, - "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": "PipelinePrimaryTopicReference", - "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}} - } - }, - "body": { - "type": "ExpressionStatement", - "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, - "expression": { - "type": "AssignmentExpression", - "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}}, - "operator": "+=", - "left": { - "type": "Identifier", - "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, - "name": "x" - }, - "right": { - "type": "NumericLiteral", - "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34}}, - "extra": { - "rawValue": 1, - "raw": "1" - }, - "value": 1 - } - } - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/output.json deleted file mode 100644 index 872350783544..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/output.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "type": "File", - "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, - "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": "BinaryExpression", - "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}}, - "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":39,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":39}}, - "expression": { - "type": "FunctionExpression", - "start":9,"end":39,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":39}}, - "id": null, - "generator": false, - "async": false, - "params": [ - { - "type": "AssignmentPattern", - "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, - "left": { - "type": "Identifier", - "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, - "name": "x" - }, - "right": { - "type": "PipelinePrimaryTopicReference", - "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} - } - } - ], - "body": { - "type": "BlockStatement", - "start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}}, - "body": [ - { - "type": "ReturnStatement", - "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37}}, - "argument": { - "type": "Identifier", - "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"x"}, - "name": "x" - } - } - ], - "directives": [] - } - } - } - } - } - ], - "directives": [] - } -} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/options.json deleted file mode 100644 index 887155e27e68..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }], "pipelineOperator"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index 4f22e6656d2b..8212b71436ba 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -157,7 +157,7 @@ export interface DecoratorsPluginOptions { } export interface PipelineOperatorPluginOptions { - proposal: "fsharp" | "minimal" | "smart"; + proposal: "minimal" | "fsharp" | "hack"; } export interface RecordAndTuplePluginOptions { diff --git a/packages/babel-plugin-proposal-pipeline-operator/src/hackVisitor.js b/packages/babel-plugin-proposal-pipeline-operator/src/hackVisitor.js new file mode 100644 index 000000000000..56a69e9ab131 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/src/hackVisitor.js @@ -0,0 +1,50 @@ +import { types as t } from "@babel/core"; + +function pathNodeIsPipeExpression(path) { + return path.node.operator === "|>"; +} + +const topicReferenceReplacementVisitor = { + TopicReference(path) { + path.replaceWith(t.cloneNode(this.topicVariable)); + }, +}; + +function replaceTopicReferencesWithVariables(path, topicVariable) { + return path.traverse(topicReferenceReplacementVisitor, { topicVariable }); +} + +function replacePipeExpressionWithAssignment(path, topicVariable) { + const { left, right } = path.node; + + return path.replaceWith( + t.sequenceExpression([ + t.assignmentExpression("=", t.cloneNode(topicVariable), left), + right, + ]), + ); +} + +// This visitor traverses `BinaryExpression` +// and replaces any that use `|>` +// with sequence expressions containing assignment expressions +// with automatically generated variables, +// from inside to outside, from left to right. +export default { + BinaryExpression: { + exit(path) { + const { scope, node } = path; + + if (!pathNodeIsPipeExpression(path)) { + return; + } + + const topicVariable = scope.generateUidIdentifierBasedOnNode(node); + const pipeBodyPath = path.get("right"); + + scope.push({ id: topicVariable }); + replaceTopicReferencesWithVariables(pipeBodyPath, topicVariable); + replacePipeExpressionWithAssignment(path, topicVariable); + }, + }, +}; diff --git a/packages/babel-plugin-proposal-pipeline-operator/src/index.js b/packages/babel-plugin-proposal-pipeline-operator/src/index.js index 241a99b87828..542b67a46888 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/src/index.js +++ b/packages/babel-plugin-proposal-pipeline-operator/src/index.js @@ -1,12 +1,12 @@ import { declare } from "@babel/helper-plugin-utils"; import syntaxPipelineOperator from "@babel/plugin-syntax-pipeline-operator"; import minimalVisitor from "./minimalVisitor"; -import smartVisitor from "./smartVisitor"; +import hackVisitor from "./hackVisitor"; import fsharpVisitor from "./fsharpVisitor"; const visitorsPerProposal = { minimal: minimalVisitor, - smart: smartVisitor, + hack: hackVisitor, fsharp: fsharpVisitor, }; diff --git a/packages/babel-plugin-proposal-pipeline-operator/src/smartVisitor.js b/packages/babel-plugin-proposal-pipeline-operator/src/smartVisitor.js deleted file mode 100644 index 4b41ffabba31..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/src/smartVisitor.js +++ /dev/null @@ -1,48 +0,0 @@ -import { types as t } from "@babel/core"; - -const updateTopicReferenceVisitor = { - PipelinePrimaryTopicReference(path) { - path.replaceWith(t.cloneNode(this.topicId)); - }, - PipelineTopicExpression(path) { - path.skip(); - }, -}; - -const smartVisitor = { - BinaryExpression(path) { - const { scope } = path; - const { node } = path; - const { operator, left, right } = node; - if (operator !== "|>") return; - - const placeholder = scope.generateUidIdentifierBasedOnNode(left); - scope.push({ id: placeholder }); - - let call; - if (t.isPipelineTopicExpression(right)) { - path - .get("right") - .traverse(updateTopicReferenceVisitor, { topicId: placeholder }); - - call = right.expression; - } else { - // PipelineBareFunction - let callee = right.callee; - if (t.isIdentifier(callee, { name: "eval" })) { - callee = t.sequenceExpression([t.numericLiteral(0), callee]); - } - - call = t.callExpression(callee, [t.cloneNode(placeholder)]); - } - - path.replaceWith( - t.sequenceExpression([ - t.assignmentExpression("=", t.cloneNode(placeholder), left), - call, - ]), - ); - }, -}; - -export default smartVisitor; diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/basic/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/basic/exec.js new file mode 100644 index 000000000000..8794728949df --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/basic/exec.js @@ -0,0 +1,3 @@ +const result = 5 |> # + 1 |> # + #; + +expect(result).toBe(12); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/options.json new file mode 100644 index 000000000000..70795b3a7835 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [["proposal-pipeline-operator", { "proposal": "hack" }]], + "parserOpts": { + "allowReturnOutsideFunction": true + } +} diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-arrow-function-and-nested-pipe/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-arrow-function-and-nested-pipe/exec.js new file mode 100644 index 000000000000..2ac670cee184 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-arrow-function-and-nested-pipe/exec.js @@ -0,0 +1,9 @@ +const result = 5 + |> Math.pow(#, 2) + |> [1, 2, 3].map(n => n + # + |> # * 2 + |> `${#} apples` + |> #.toUpperCase()) + |> #.join(); + +expect(result).toEqual('52 APPLES,54 APPLES,56 APPLES'); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-arrow-function/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-arrow-function/exec.js new file mode 100644 index 000000000000..b9326ab31730 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-arrow-function/exec.js @@ -0,0 +1,6 @@ +const result = -2.2 // -2.2 + |> Math.floor(#) // -3 + |> (() => Math.pow(#, 5)) // () => -243 + |> #(); // -243 + +expect(result).toBe(-243); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-await/exec.js similarity index 51% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/exec.js rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-await/exec.js index 7e7ea94bd4cb..22f7d8529839 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/exec.js +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-await/exec.js @@ -1,11 +1,12 @@ -const triple = (x) => x * 3; +function triple (x) { + return x * 3 +} async function myFunction(n) { return n - |> Math.abs - |> Promise.resolve(#) - |> await # - |> triple; + |> Math.abs(#) + |> await Promise.resolve(#) + |> triple(#); } return myFunction(-7).then(result => { diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/await/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-await/options.json similarity index 56% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/await/options.json rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-await/options.json index f19c36b8eef1..a7c9bd393cd4 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/await/options.json +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-await/options.json @@ -1,4 +1,5 @@ { + "plugins": [["proposal-pipeline-operator", { "proposal": "hack" }]], "parserOpts": { "allowReturnOutsideFunction": true }, diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-eval/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-eval/exec.js new file mode 100644 index 000000000000..0a1c0ce7409d --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-eval/exec.js @@ -0,0 +1,4 @@ +const program = '(function() { return this; })()'; +const result = program |> eval(#); + +expect(result).not.toBeUndefined(); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-nested-pipe/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-nested-pipe/exec.js new file mode 100644 index 000000000000..8b7dd421d10c --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-nested-pipe/exec.js @@ -0,0 +1,7 @@ +const result = 5 + |> Math.pow(#, 2) + |> (# + 1 + |> `${#} apples` + |> #.toUpperCase()); + +expect(result).toEqual('26 APPLES'); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-object-literal/exec.js similarity index 81% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/exec.js rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-object-literal/exec.js index 830e80efc6f9..79eba6354f81 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/exec.js +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-object-literal/exec.js @@ -3,8 +3,8 @@ function area(rect) { } const result = -5 - |> Math.abs + |> Math.abs(#) |> ({ width: #, height: # + 3 }) - |> area; + |> area(#); expect(result).toBe(40); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-topic-method-call/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-topic-method-call/exec.js new file mode 100644 index 000000000000..6d467f5e4669 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-topic-method-call/exec.js @@ -0,0 +1,3 @@ +const result = 'Hello' |> #.toUpperCase(); + +expect(result).toBe('HELLO'); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-yield/exec.js similarity index 93% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/exec.js rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-yield/exec.js index f998a1157ed0..f8abf7114ad6 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/exec.js +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-body-with-yield/exec.js @@ -1,7 +1,7 @@ function *myGenerator(n) { return n |> (yield #) - |> Math.abs; + |> Math.abs(#); } const myIterator = myGenerator(15); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-head-with-nested-pipe/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-head-with-nested-pipe/exec.js new file mode 100644 index 000000000000..b3283d8f1ca9 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-head-with-nested-pipe/exec.js @@ -0,0 +1,3 @@ +const result = (5 |> Math.pow(#, 2)) |> # + 1; + +expect(result).toEqual(26); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-in-arrow-function/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-in-arrow-function/exec.js new file mode 100644 index 000000000000..51ccf9e82c90 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/pipe-in-arrow-function/exec.js @@ -0,0 +1,6 @@ +const result = () => -2.2 // -2.2 + |> Math.floor(#) // -3 + |> (() => Math.pow(#, 5)) // () => -243 + |> #(); // -243 + +expect(result()).toBe(-243); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/await/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/transform-arrow-functions/exec.js similarity index 66% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/await/exec.js rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/transform-arrow-functions/exec.js index 7e7ea94bd4cb..12bb1514eff7 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/await/exec.js +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/transform-arrow-functions/exec.js @@ -2,10 +2,9 @@ const triple = (x) => x * 3; async function myFunction(n) { return n - |> Math.abs - |> Promise.resolve(#) - |> await # - |> triple; + |> Math.abs(#) + |> await Promise.resolve(#) + |> triple(#); } return myFunction(-7).then(result => { diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/transform-arrow-functions/options.json similarity index 65% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/options.json rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/transform-arrow-functions/options.json index 2453ef11a549..44ee26913935 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart+arrow/options.json +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/transform-arrow-functions/options.json @@ -1,6 +1,6 @@ { "plugins": [ - ["proposal-pipeline-operator", { "proposal": "smart" }], + ["proposal-pipeline-operator", { "proposal": "hack" }], "transform-arrow-functions" ], "parserOpts": { diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/while-statement-with-pipe-in-condition/exec.js similarity index 51% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/output.js rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/while-statement-with-pipe-in-condition/exec.js index 23b1465b27a5..b07c908a8958 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/output.js +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/while-statement-with-pipe-in-condition/exec.js @@ -1,9 +1,7 @@ +let i = 0; let sum = 0; -for (var i = (_ = 0, _); i <= 10; i++) { - var _; - - sum = sum + i; -} +while (i |> (i = # + 1) |> # <= 10) + sum += i; expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/input.js deleted file mode 100644 index 09ec8493000b..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/input.js +++ /dev/null @@ -1,6 +0,0 @@ -async function myFunction(n) { - return n - |> Math.abs - |> Promise.resolve(#) - |> await #; -} diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/options.json deleted file mode 100644 index df1848815387..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/options.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugins": [["proposal-pipeline-operator", { "proposal": "smart" }]], - "parserOpts": { - "allowReturnOutsideFunction": true - }, - "minNodeVersion": "8.0.0" -} diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/output.js deleted file mode 100644 index bf7848696774..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/output.js +++ /dev/null @@ -1,5 +0,0 @@ -async function myFunction(n) { - var _ref, _ref2, _n; - - return _ref = (_ref2 = (_n = n, Math.abs(_n)), Promise.resolve(_ref2)), await _ref; -} diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/exec.js deleted file mode 100644 index 93371d387af7..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/exec.js +++ /dev/null @@ -1,7 +0,0 @@ -const abs = Math.abs; - -const value = -5.9 -|> abs -|> Math.floor; - -expect(value).toBe(5); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/input.js deleted file mode 100644 index be7fbdbd4cf5..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/input.js +++ /dev/null @@ -1,5 +0,0 @@ -const abs = Math.abs; - -const value = -5.9 -|> abs -|> Math.floor; diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/output.js deleted file mode 100644 index d89c931323d0..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/output.js +++ /dev/null @@ -1,4 +0,0 @@ -var _ref, _; - -const abs = Math.abs; -const value = (_ref = (_ = -5.9, abs(_)), Math.floor(_ref)); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/exec.js deleted file mode 100644 index 1a4868deae2a..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/exec.js +++ /dev/null @@ -1,6 +0,0 @@ -var result = 5 - |> # + 1 - |> # + # - |> Math.pow(((x) => (x * 7))(#), 2) - -expect(result).toBe(7056); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/input.js deleted file mode 100644 index 839ae46a7434..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/input.js +++ /dev/null @@ -1,4 +0,0 @@ -var result = 5 - |> # + 1 - |> # + # - |> Math.pow(((x) => (x * 7))(#), 2) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/output.js deleted file mode 100644 index 0f5af7ba9589..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/output.js +++ /dev/null @@ -1,3 +0,0 @@ -var _ref, _ref2, _; - -var result = (_ref = (_ref2 = (_ = 5, _ + 1), _ref2 + _ref2), Math.pow((x => x * 7)(_ref), 2)); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/exec.js deleted file mode 100644 index 857fc6ce5b67..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/exec.js +++ /dev/null @@ -1,5 +0,0 @@ -let sum = 0; -for (var i = 0 |> #; i <= 10; i++) - sum = sum + i; - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/input.js deleted file mode 100644 index 857fc6ce5b67..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/input.js +++ /dev/null @@ -1,5 +0,0 @@ -let sum = 0; -for (var i = 0 |> #; i <= 10; i++) - sum = sum + i; - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/exec.js deleted file mode 100644 index 41d1e0584ab9..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/exec.js +++ /dev/null @@ -1,6 +0,0 @@ -let sum = 0; -for (var i = 0; i <= 10; i = i |> # + 1) { - sum = sum + i; -} - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/input.js deleted file mode 100644 index 41d1e0584ab9..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/input.js +++ /dev/null @@ -1,6 +0,0 @@ -let sum = 0; -for (var i = 0; i <= 10; i = i |> # + 1) { - sum = sum + i; -} - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/output.js deleted file mode 100644 index 0ca0f35ad87b..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/output.js +++ /dev/null @@ -1,9 +0,0 @@ -let sum = 0; - -for (var i = 0; i <= 10; i = (_i = i, _i + 1)) { - var _i; - - sum = sum + i; -} - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/exec.js deleted file mode 100644 index e1278cd25d46..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/exec.js +++ /dev/null @@ -1,5 +0,0 @@ -let sum = 0; -for (var i = 0; i |> # <= 10; i++) - sum = sum + i; - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/input.js deleted file mode 100644 index 279b128e2da9..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/input.js +++ /dev/null @@ -1,5 +0,0 @@ -let sum = 0; -for (var i = 0; (i |> # <= 10); ++i) - sum = sum + i; - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/output.js deleted file mode 100644 index 09d8bc056290..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/output.js +++ /dev/null @@ -1,9 +0,0 @@ -let sum = 0; - -for (var i = 0; _i = i, _i <= 10; ++i) { - var _i; - - sum = sum + i; -} - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/if/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/if/input.js deleted file mode 100644 index 7b3de3747bbf..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/if/input.js +++ /dev/null @@ -1,4 +0,0 @@ -if (v |> e |> f) - g() |> h(#, #+1) |> i; -else - j(); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/if/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/if/output.js deleted file mode 100644 index 3b71d143ae79..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/if/output.js +++ /dev/null @@ -1,3 +0,0 @@ -var _ref, _v, _ref2, _g; - -if (_ref = (_v = v, e(_v)), f(_ref)) _ref2 = (_g = g(), h(_g, _g + 1)), i(_ref2);else j(); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/exec.js deleted file mode 100644 index 30efd15ea92a..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/exec.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() { - 'use strict'; - var result = '(function() { return this; })()' - |> eval; - - expect(result).not.toBeUndefined(); -})(); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/input.js deleted file mode 100644 index 30efd15ea92a..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/input.js +++ /dev/null @@ -1,7 +0,0 @@ -(function() { - 'use strict'; - var result = '(function() { return this; })()' - |> eval; - - expect(result).not.toBeUndefined(); -})(); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/output.js deleted file mode 100644 index 3c53e6d4f3bf..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/output.js +++ /dev/null @@ -1,8 +0,0 @@ -(function () { - 'use strict'; - - var _functionReturn; - - var result = (_functionReturn = '(function() { return this; })()', (0, eval)(_functionReturn)); - expect(result).not.toBeUndefined(); -})(); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/exec.js deleted file mode 100644 index 20c1c83d22b5..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/exec.js +++ /dev/null @@ -1,7 +0,0 @@ -var result = 5 - |> Math.pow(#, 2) - |> [ 10, 20, 30, 40, 50 ].filter(n => # - |> n > # - |> !#); - -expect(result).toEqual([10, 20]); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/input.js deleted file mode 100644 index 1903dbd95b72..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/input.js +++ /dev/null @@ -1,5 +0,0 @@ -var result = 5 - |> Math.pow(#, 2) - |> [ 10, 20, 30, 40, 50 ].filter(n => # - |> n > # - |> !#); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/output.js deleted file mode 100644 index d5266c661786..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/output.js +++ /dev/null @@ -1,7 +0,0 @@ -var _ref, _; - -var result = (_ref = (_ = 5, Math.pow(_, 2)), [10, 20, 30, 40, 50].filter(n => { - var _ref2, _ref3; - - return _ref2 = (_ref3 = _ref, n > _ref3), !_ref2; -})); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/input.js deleted file mode 100644 index 1cc7970ff08c..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/input.js +++ /dev/null @@ -1,8 +0,0 @@ -function area(rect) { - return rect.width * rect.height; -} - -const result = -5 - |> Math.abs - |> ({ width: #, height: # + 3 }) - |> area; diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/output.js deleted file mode 100644 index f558d2a62a01..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/output.js +++ /dev/null @@ -1,10 +0,0 @@ -var _ref, _ref2, _; - -function area(rect) { - return rect.width * rect.height; -} - -const result = (_ref = (_ref2 = (_ = -5, Math.abs(_)), { - width: _ref2, - height: _ref2 + 3 -}), area(_ref)); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/options.json deleted file mode 100644 index d8c03ffdf701..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/options.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "plugins": [["proposal-pipeline-operator", { "proposal": "smart" }]], - "parserOpts": { - "allowReturnOutsideFunction": true - } -} diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-as-callee/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-as-callee/input.js deleted file mode 100644 index 5935729f4958..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-as-callee/input.js +++ /dev/null @@ -1 +0,0 @@ -v |> #.method() |> f; diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-as-callee/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-as-callee/output.js deleted file mode 100644 index 95023f52e862..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-as-callee/output.js +++ /dev/null @@ -1,3 +0,0 @@ -var _ref, _v; - -_ref = (_v = v, _v.method()), f(_ref); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/exec.js deleted file mode 100644 index c5837e4a0b58..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/exec.js +++ /dev/null @@ -1,7 +0,0 @@ -const result = -2.2 // -2.2 - |> Math.floor // -3 - |> (() => Math.pow(#, 5)) // () => -243 - |> #() // -243 - |> Math.sign; // -1 - -expect(result).toBe(-1); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/input.js deleted file mode 100644 index 14a6f5b6c1d9..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/input.js +++ /dev/null @@ -1,5 +0,0 @@ -const result = -2.2 // -2.2 - |> Math.floor // -3 - |> (() => Math.pow(#, 5)) // () => -243 - |> #() // -243 - |> Math.sign; // -1 diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/output.js deleted file mode 100644 index 35aee7ed2a42..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/output.js +++ /dev/null @@ -1,7 +0,0 @@ -var _ref, _ref2, _ref3, _; - -const result = (_ref = (_ref2 = (_ref3 = (_ = -2.2 // -2.2 -, Math.floor(_) // -3 -), () => Math.pow(_ref3, 5) // () => -243 -), _ref2() // -243 -), Math.sign(_ref)); // -1 diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/exec.js deleted file mode 100644 index 4a86c3eab4f4..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/exec.js +++ /dev/null @@ -1,7 +0,0 @@ -let i = 0 -let sum = 0 - -while (i |> (i = # + 1) |> # <= 10) - sum = sum + i; - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/input.js deleted file mode 100644 index 4a86c3eab4f4..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/input.js +++ /dev/null @@ -1,7 +0,0 @@ -let i = 0 -let sum = 0 - -while (i |> (i = # + 1) |> # <= 10) - sum = sum + i; - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1) diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/output.js deleted file mode 100644 index 975844fd1286..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/output.js +++ /dev/null @@ -1,10 +0,0 @@ -let i = 0; -let sum = 0; - -while (_ref = (_i = i, i = _i + 1), _ref <= 10) { - var _ref, _i; - - sum = sum + i; -} - -expect(sum).toBe(10 + 9 + 8 + 7 + 6 + 5 + 4 + 3 + 2 + 1); diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/input.js deleted file mode 100644 index 602d85a0e1fe..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/input.js +++ /dev/null @@ -1,5 +0,0 @@ -function *myGenerator(n) { - return n - |> (yield #) - |> Math.abs; -} diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/output.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/output.js deleted file mode 100644 index 3ca1e506b2cf..000000000000 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/output.js +++ /dev/null @@ -1,5 +0,0 @@ -function* myGenerator(n) { - var _ref, _n; - - return _ref = (_n = n, yield _n), Math.abs(_ref); -} diff --git a/packages/babel-plugin-syntax-pipeline-operator/src/index.js b/packages/babel-plugin-syntax-pipeline-operator/src/index.js index df904e77644c..0606896baa09 100644 --- a/packages/babel-plugin-syntax-pipeline-operator/src/index.js +++ b/packages/babel-plugin-syntax-pipeline-operator/src/index.js @@ -1,6 +1,6 @@ import { declare } from "@babel/helper-plugin-utils"; -export const proposals = ["minimal", "smart", "fsharp"]; +export const proposals = ["minimal", "fsharp", "hack"]; export default declare((api, { proposal }) => { api.assertVersion(7); diff --git a/packages/babel-traverse/src/path/generated/asserts.ts b/packages/babel-traverse/src/path/generated/asserts.ts index b0e6e22ccf05..72c5f8a99b93 100755 --- a/packages/babel-traverse/src/path/generated/asserts.ts +++ b/packages/babel-traverse/src/path/generated/asserts.ts @@ -395,15 +395,6 @@ export interface NodePathAssetions { ): asserts this is NodePath; assertPattern(opts?: object): asserts this is NodePath; assertPatternLike(opts?: object): asserts this is NodePath; - assertPipelineBareFunction( - opts?: object, - ): asserts this is NodePath; - assertPipelinePrimaryTopicReference( - opts?: object, - ): asserts this is NodePath; - assertPipelineTopicExpression( - opts?: object, - ): asserts this is NodePath; assertPlaceholder(opts?: object): asserts this is NodePath; assertPrivate(opts?: object): asserts this is NodePath; assertPrivateName(opts?: object): asserts this is NodePath; @@ -630,6 +621,9 @@ export interface NodePathAssetions { assertThrowStatement( opts?: object, ): asserts this is NodePath; + assertTopicReference( + opts?: object, + ): asserts this is NodePath; assertTryStatement(opts?: object): asserts this is NodePath; assertTupleExpression( opts?: object, diff --git a/packages/babel-traverse/src/path/generated/validators.ts b/packages/babel-traverse/src/path/generated/validators.ts index ced5e539075a..cb0ecd9a30b6 100755 --- a/packages/babel-traverse/src/path/generated/validators.ts +++ b/packages/babel-traverse/src/path/generated/validators.ts @@ -241,15 +241,6 @@ export interface NodePathValidators { ): this is NodePath; isPattern(opts?: object): this is NodePath; isPatternLike(opts?: object): this is NodePath; - isPipelineBareFunction( - opts?: object, - ): this is NodePath; - isPipelinePrimaryTopicReference( - opts?: object, - ): this is NodePath; - isPipelineTopicExpression( - opts?: object, - ): this is NodePath; isPlaceholder(opts?: object): this is NodePath; isPrivate(opts?: object): this is NodePath; isPrivateName(opts?: object): this is NodePath; @@ -380,6 +371,7 @@ export interface NodePathValidators { isThisExpression(opts?: object): this is NodePath; isThisTypeAnnotation(opts?: object): this is NodePath; isThrowStatement(opts?: object): this is NodePath; + isTopicReference(opts?: object): this is NodePath; isTryStatement(opts?: object): this is NodePath; isTupleExpression(opts?: object): this is NodePath; isTupleTypeAnnotation(opts?: object): this is NodePath; diff --git a/packages/babel-types/src/asserts/generated/index.ts b/packages/babel-types/src/asserts/generated/index.ts index 04cf3195f184..808fa9db7948 100755 --- a/packages/babel-types/src/asserts/generated/index.ts +++ b/packages/babel-types/src/asserts/generated/index.ts @@ -1004,24 +1004,6 @@ export function assertClassProperty( ): asserts node is t.ClassProperty { assert("ClassProperty", node, opts); } -export function assertPipelineTopicExpression( - node: object | null | undefined, - opts?: object | null, -): asserts node is t.PipelineTopicExpression { - assert("PipelineTopicExpression", node, opts); -} -export function assertPipelineBareFunction( - node: object | null | undefined, - opts?: object | null, -): asserts node is t.PipelineBareFunction { - assert("PipelineBareFunction", node, opts); -} -export function assertPipelinePrimaryTopicReference( - node: object | null | undefined, - opts?: object | null, -): asserts node is t.PipelinePrimaryTopicReference { - assert("PipelinePrimaryTopicReference", node, opts); -} export function assertClassPrivateProperty( node: object | null | undefined, opts?: object | null, @@ -1094,6 +1076,12 @@ export function assertModuleExpression( ): asserts node is t.ModuleExpression { assert("ModuleExpression", node, opts); } +export function assertTopicReference( + node: object | null | undefined, + opts?: object | null, +): asserts node is t.TopicReference { + assert("TopicReference", node, opts); +} export function assertTSParameterProperty( node: object | null | undefined, opts?: object | null, diff --git a/packages/babel-types/src/ast-types/generated/index.ts b/packages/babel-types/src/ast-types/generated/index.ts index df363a9e857d..cd42fe88acd6 100755 --- a/packages/babel-types/src/ast-types/generated/index.ts +++ b/packages/babel-types/src/ast-types/generated/index.ts @@ -211,9 +211,6 @@ export type Node = | ParenthesizedExpression | Pattern | PatternLike - | PipelineBareFunction - | PipelinePrimaryTopicReference - | PipelineTopicExpression | Placeholder | Private | PrivateName @@ -314,6 +311,7 @@ export type Node = | ThisExpression | ThisTypeAnnotation | ThrowStatement + | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation @@ -1531,20 +1529,6 @@ export interface ClassProperty extends BaseNode { readonly?: boolean | null; } -export interface PipelineTopicExpression extends BaseNode { - type: "PipelineTopicExpression"; - expression: Expression; -} - -export interface PipelineBareFunction extends BaseNode { - type: "PipelineBareFunction"; - callee: Expression; -} - -export interface PipelinePrimaryTopicReference extends BaseNode { - type: "PipelinePrimaryTopicReference"; -} - export interface ClassPrivateProperty extends BaseNode { type: "ClassPrivateProperty"; key: PrivateName; @@ -1628,6 +1612,10 @@ export interface ModuleExpression extends BaseNode { body: Program; } +export interface TopicReference extends BaseNode { + type: "TopicReference"; +} + export interface TSParameterProperty extends BaseNode { type: "TSParameterProperty"; parameter: Identifier | AssignmentPattern; @@ -2048,7 +2036,6 @@ export type Expression = | JSXElement | JSXFragment | BindExpression - | PipelinePrimaryTopicReference | DoExpression | RecordExpression | TupleExpression diff --git a/packages/babel-types/src/builders/generated/index.ts b/packages/babel-types/src/builders/generated/index.ts index 2ade18539370..eb2292bb01f7 100755 --- a/packages/babel-types/src/builders/generated/index.ts +++ b/packages/babel-types/src/builders/generated/index.ts @@ -998,19 +998,6 @@ export function classProperty( ): t.ClassProperty { return builder("ClassProperty", ...arguments); } -export function pipelineTopicExpression( - expression: t.Expression, -): t.PipelineTopicExpression { - return builder("PipelineTopicExpression", ...arguments); -} -export function pipelineBareFunction( - callee: t.Expression, -): t.PipelineBareFunction { - return builder("PipelineBareFunction", ...arguments); -} -export function pipelinePrimaryTopicReference(): t.PipelinePrimaryTopicReference { - return builder("PipelinePrimaryTopicReference", ...arguments); -} export function classPrivateProperty( key: t.PrivateName, value: t.Expression | null | undefined, @@ -1069,6 +1056,9 @@ export function staticBlock(body: Array): t.StaticBlock { export function moduleExpression(body: t.Program): t.ModuleExpression { return builder("ModuleExpression", ...arguments); } +export function topicReference(): t.TopicReference { + return builder("TopicReference", ...arguments); +} export function tsParameterProperty( parameter: t.Identifier | t.AssignmentPattern, ): t.TSParameterProperty { diff --git a/packages/babel-types/src/builders/generated/uppercase.js b/packages/babel-types/src/builders/generated/uppercase.js index 3e25736a38d1..0c1297b0f31c 100755 --- a/packages/babel-types/src/builders/generated/uppercase.js +++ b/packages/babel-types/src/builders/generated/uppercase.js @@ -174,9 +174,6 @@ export { argumentPlaceholder as ArgumentPlaceholder, bindExpression as BindExpression, classProperty as ClassProperty, - pipelineTopicExpression as PipelineTopicExpression, - pipelineBareFunction as PipelineBareFunction, - pipelinePrimaryTopicReference as PipelinePrimaryTopicReference, classPrivateProperty as ClassPrivateProperty, classPrivateMethod as ClassPrivateMethod, importAttribute as ImportAttribute, @@ -189,6 +186,7 @@ export { decimalLiteral as DecimalLiteral, staticBlock as StaticBlock, moduleExpression as ModuleExpression, + topicReference as TopicReference, tsParameterProperty as TSParameterProperty, tsDeclareFunction as TSDeclareFunction, tsDeclareMethod as TSDeclareMethod, diff --git a/packages/babel-types/src/definitions/experimental.ts b/packages/babel-types/src/definitions/experimental.ts index d463bef6c03a..f605aad139f5 100644 --- a/packages/babel-types/src/definitions/experimental.ts +++ b/packages/babel-types/src/definitions/experimental.ts @@ -83,30 +83,6 @@ defineType("ClassProperty", { }, }); -defineType("PipelineTopicExpression", { - builder: ["expression"], - visitor: ["expression"], - fields: { - expression: { - validate: assertNodeType("Expression"), - }, - }, -}); - -defineType("PipelineBareFunction", { - builder: ["callee"], - visitor: ["callee"], - fields: { - callee: { - validate: assertNodeType("Expression"), - }, - }, -}); - -defineType("PipelinePrimaryTopicReference", { - aliases: ["Expression"], -}); - defineType("ClassPrivateProperty", { visitor: ["key", "value", "decorators"], builder: ["key", "value", "decorators", "static"], @@ -277,3 +253,7 @@ defineType("ModuleExpression", { }, aliases: ["Expression"], }); + +// https://github.com/tc39/proposal-pipeline-operator +// https://github.com/js-choi/proposal-hack-pipes +defineType("TopicReference", {}); diff --git a/packages/babel-types/src/validators/generated/index.ts b/packages/babel-types/src/validators/generated/index.ts index d24f3f81bfbf..8179a94f1704 100755 --- a/packages/babel-types/src/validators/generated/index.ts +++ b/packages/babel-types/src/validators/generated/index.ts @@ -2810,57 +2810,6 @@ export function isClassProperty( return false; } -export function isPipelineTopicExpression( - node: object | null | undefined, - opts?: object | null, -): node is t.PipelineTopicExpression { - if (!node) return false; - - const nodeType = (node as t.Node).type; - if (nodeType === "PipelineTopicExpression") { - if (typeof opts === "undefined") { - return true; - } else { - return shallowEqual(node, opts); - } - } - - return false; -} -export function isPipelineBareFunction( - node: object | null | undefined, - opts?: object | null, -): node is t.PipelineBareFunction { - if (!node) return false; - - const nodeType = (node as t.Node).type; - if (nodeType === "PipelineBareFunction") { - if (typeof opts === "undefined") { - return true; - } else { - return shallowEqual(node, opts); - } - } - - return false; -} -export function isPipelinePrimaryTopicReference( - node: object | null | undefined, - opts?: object | null, -): node is t.PipelinePrimaryTopicReference { - if (!node) return false; - - const nodeType = (node as t.Node).type; - if (nodeType === "PipelinePrimaryTopicReference") { - if (typeof opts === "undefined") { - return true; - } else { - return shallowEqual(node, opts); - } - } - - return false; -} export function isClassPrivateProperty( node: object | null | undefined, opts?: object | null, @@ -3065,6 +3014,23 @@ export function isModuleExpression( return false; } +export function isTopicReference( + node: object | null | undefined, + opts?: object | null, +): node is t.TopicReference { + if (!node) return false; + + const nodeType = (node as t.Node).type; + if (nodeType === "TopicReference") { + if (typeof opts === "undefined") { + return true; + } else { + return shallowEqual(node, opts); + } + } + + return false; +} export function isTSParameterProperty( node: object | null | undefined, opts?: object | null, @@ -4181,7 +4147,6 @@ export function isExpression( "JSXElement" === nodeType || "JSXFragment" === nodeType || "BindExpression" === nodeType || - "PipelinePrimaryTopicReference" === nodeType || "DoExpression" === nodeType || "RecordExpression" === nodeType || "TupleExpression" === nodeType ||