From d83b79dd2ffda5971d02229b4d7e4503019831d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=C2=A0S=2E=20Choi?= Date: Thu, 8 Apr 2021 00:10:11 -0400 Subject: [PATCH] Rename "smart" pipe-proposal option to "hack" See babel/babel#11600 and https://github.com/js-choi/proposal-hack-pipes. --- .../input.js | 0 .../test/fixtures/types/PipeBody/options.json | 3 ++ .../output.js | 0 .../types/PipelineBareFunction/input.js | 1 - .../types/PipelineBareFunction/options.json | 3 -- .../types/PipelineBareFunction/output.js | 1 - .../PipelineTopicExpression/options.json | 3 -- packages/babel-parser/ast/spec.md | 43 ++----------------- .../babel-parser/src/parser/error-message.js | 12 +++--- .../babel-parser/src/parser/expression.js | 34 +++++++-------- packages/babel-parser/src/plugin-utils.js | 2 +- packages/babel-parser/src/tokenizer/state.js | 4 +- .../output.json | 4 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 2 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 11 +++++ .../input.js | 0 .../hack-proposal-async-await/options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 2 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 2 +- .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 4 ++ .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 2 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 2 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 2 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 4 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 2 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 2 +- .../input.js | 0 .../options.json | 4 +- .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../input.js | 0 .../options.json | 3 ++ .../output.json | 0 .../invalid-proposal/options.json | 2 +- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 4 -- .../smart-proposal-async-await/options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 4 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../options.json | 3 -- .../babel-parser/typings/babel-parser.d.ts | 2 +- .../src/{smartVisitor.js => hackVisitor.js} | 4 +- .../src/index.js | 4 +- .../{smart+arrow => hack}/await/exec.js | 11 ++--- .../{smart+arrow => hack}/await/options.json | 1 + .../fixtures/{smart => hack}/basic/exec.js | 0 .../test/fixtures/hack/indirect-eval/exec.js | 4 ++ .../fixtures/{smart => hack}/nested/exec.js | 0 .../{smart => hack}/object-literal/exec.js | 4 +- .../test/fixtures/hack/options.json | 6 +++ .../fixtures/hack/topic-as-callee/input.js | 1 + .../{smart => hack}/topic-as-callee/output.js | 0 .../hack/topic-inside-arrow-function/exec.js | 5 +++ .../transform-arrow-functions}/exec.js | 7 ++- .../transform-arrow-functions}/options.json | 2 +- .../for-init/output.js => hack/while/exec.js} | 6 +-- .../fixtures/{smart => hack}/yield/exec.js | 2 +- .../test/fixtures/smart/await/input.js | 6 --- .../test/fixtures/smart/await/options.json | 7 --- .../test/fixtures/smart/await/output.js | 5 --- .../test/fixtures/smart/bare-function/exec.js | 7 --- .../fixtures/smart/bare-function/input.js | 5 --- .../fixtures/smart/bare-function/output.js | 4 -- .../test/fixtures/smart/basic/input.js | 4 -- .../test/fixtures/smart/basic/output.js | 3 -- .../test/fixtures/smart/for-init/exec.js | 5 --- .../test/fixtures/smart/for-init/input.js | 5 --- .../test/fixtures/smart/for-update/exec.js | 6 --- .../test/fixtures/smart/for-update/input.js | 6 --- .../test/fixtures/smart/for-update/output.js | 9 ---- .../test/fixtures/smart/for/exec.js | 5 --- .../test/fixtures/smart/for/input.js | 5 --- .../test/fixtures/smart/for/output.js | 9 ---- .../test/fixtures/smart/if/input.js | 4 -- .../test/fixtures/smart/if/output.js | 3 -- .../test/fixtures/smart/indirect-eval/exec.js | 7 --- .../fixtures/smart/indirect-eval/input.js | 7 --- .../fixtures/smart/indirect-eval/output.js | 8 ---- .../test/fixtures/smart/nested/input.js | 5 --- .../test/fixtures/smart/nested/output.js | 7 --- .../fixtures/smart/object-literal/input.js | 8 ---- .../fixtures/smart/object-literal/output.js | 10 ----- .../test/fixtures/smart/options.json | 6 --- .../fixtures/smart/topic-as-callee/input.js | 1 - .../smart/topic-inside-arrow-function/exec.js | 7 --- .../topic-inside-arrow-function/input.js | 5 --- .../topic-inside-arrow-function/output.js | 7 --- .../test/fixtures/smart/while/exec.js | 7 --- .../test/fixtures/smart/while/input.js | 7 --- .../test/fixtures/smart/while/output.js | 10 ----- .../test/fixtures/smart/yield/input.js | 5 --- .../test/fixtures/smart/yield/output.js | 5 --- .../src/index.js | 2 +- 218 files changed, 205 insertions(+), 435 deletions(-) rename packages/babel-generator/test/fixtures/types/{PipelineTopicExpression => PipeBody}/input.js (100%) create mode 100644 packages/babel-generator/test/fixtures/types/PipeBody/options.json rename packages/babel-generator/test/fixtures/types/{PipelineTopicExpression => PipeBody}/output.js (100%) delete mode 100644 packages/babel-generator/test/fixtures/types/PipelineBareFunction/input.js delete mode 100644 packages/babel-generator/test/fixtures/types/PipelineBareFunction/options.json delete mode 100644 packages/babel-generator/test/fixtures/types/PipelineBareFunction/output.js delete mode 100644 packages/babel-generator/test/fixtures/types/PipelineTopicExpression/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-addition-with-topic-first => hack-proposal-addition-with-topic-first}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-addition-with-topic-first => hack-proposal-addition-with-topic-first}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-addition-with-topic-last => hack-proposal-addition-with-topic-last}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-addition-with-topic-last => hack-proposal-addition-with-topic-last}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-addition-without-topic => hack-proposal-addition-without-topic}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-addition-without-topic => hack-proposal-addition-without-topic}/output.json (93%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-arrow-function-parenthesized => hack-proposal-arrow-function-parenthesized}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-arrow-function-parenthesized => hack-proposal-arrow-function-parenthesized}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-arrow-function-unparenthesized => hack-proposal-arrow-function-unparenthesized}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-unparenthesized/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-async-await => hack-proposal-async-await}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-async-await => hack-proposal-async-await}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-computed-no-topic => hack-proposal-computed-no-topic}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-computed-no-topic => hack-proposal-computed-no-topic}/output.json (93%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head}/input.js (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head}/options.json (56%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head => hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-if-statement-and-topic-in-else-body => hack-proposal-do-expression-with-if-statement-and-topic-in-else-body}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-if-statement-and-topic-in-else-body => hack-proposal-do-expression-with-if-statement-and-topic-in-else-body}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-if-statement-and-topic-in-else-if-body => hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-if-statement-and-topic-in-else-if-body => hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-if-statement-and-topic-in-if-body => hack-proposal-do-expression-with-if-statement-and-topic-in-if-body}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-if-statement-and-topic-in-if-body => hack-proposal-do-expression-with-if-statement-and-topic-in-if-body}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-if-statement-and-topic-in-if-head => hack-proposal-do-expression-with-if-statement-and-topic-in-if-head}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-if-statement-and-topic-in-if-head => hack-proposal-do-expression-with-if-statement-and-topic-in-if-head}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-body => hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-body => hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-head => hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-head => hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-topic-identity => hack-proposal-do-expression-with-topic-identity}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-topic-identity => hack-proposal-do-expression-with-topic-identity}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause => hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause => hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause => hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause => hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-try-catch-statements-topic-in-try-clause => hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-try-catch-statements-topic-in-try-clause => hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-while-loop-topic-in-loop-head => hack-proposal-do-expression-with-while-loop-topic-in-loop-head}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-do-expression-with-while-loop-topic-in-loop-head => hack-proposal-do-expression-with-while-loop-topic-in-loop-head}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-function-call-with-topic-in-argument => hack-proposal-function-call-with-topic-in-argument}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-function-call-with-topic-in-argument => hack-proposal-function-call-with-topic-in-argument}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-function-definition-with-topic-in-default-parameter => hack-proposal-function-definition-with-topic-in-default-parameter}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-function-definition-with-topic-in-default-parameter => hack-proposal-function-definition-with-topic-in-default-parameter}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-generator-yield => hack-proposal-generator-yield}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-generator-yield => hack-proposal-generator-yield}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-invalid-hash-token-followed-by-digit => hack-proposal-invalid-hash-token-then-digit}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-then-digit/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-mixed-pipeline-plugins => hack-proposal-mixed-pipeline-plugins}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-mixed-pipeline-plugins => hack-proposal-mixed-pipeline-plugins}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-with-arrow-function => hack-proposal-nested-pipelines-with-arrow-function-with-required-topics}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-with-required-topics/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-with-arrow-function => hack-proposal-nested-pipelines-with-arrow-function-with-required-topics}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic => hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic => hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic}/output.json (96%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic => hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic => hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic}/output.json (95%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines => hack-proposal-nested-pipelines-with-function-call}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-function-call/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines => hack-proposal-nested-pipelines-with-function-call}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-without-inner-topic => hack-proposal-nested-pipelines-without-inner-topic}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-without-inner-topic => hack-proposal-nested-pipelines-without-inner-topic}/output.json (94%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-without-outer-topic => hack-proposal-nested-pipelines-without-outer-topic}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-nested-pipelines-without-outer-topic => hack-proposal-nested-pipelines-without-outer-topic}/output.json (88%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-no-topic-class-expression => hack-proposal-no-topic-class-expression}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-no-topic-class-expression => hack-proposal-no-topic-class-expression}/output.json (92%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-no-topic-function-expression => hack-proposal-no-topic-function-expression}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-no-topic-function-expression => hack-proposal-no-topic-function-expression}/output.json (94%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-simple-unbound-topic => hack-proposal-simple-unbound-topic}/input.js (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-simple-unbound-topic => hack-proposal-simple-unbound-topic}/options.json (79%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-topic-identity-parenthesized => hack-proposal-topic-identity-parenthesized}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-topic-identity-parenthesized => hack-proposal-topic-identity-parenthesized}/output.json (100%) rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-topic-identity-unparenthesized => hack-proposal-topic-identity-unparenthesized}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/options.json rename packages/babel-parser/test/fixtures/experimental/pipeline-operator/{smart-proposal-topic-identity-unparenthesized => hack-proposal-topic-identity-unparenthesized}/output.json (100%) delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-first/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-last/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-without-topic/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-unparenthesized/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-async-await/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-computed-no-topic/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-else-body/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-if-body/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-if-head/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-topic-identity/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-while-loop-topic-in-loop-head/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-call-with-topic-in-argument/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-definition-with-topic-in-default-parameter/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-generator-yield/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-invalid-hash-token-followed-by-digit/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-mixed-pipeline-plugins/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-class-expression/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-function-expression/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-identity-parenthesized/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-identity-unparenthesized/options.json rename packages/babel-plugin-proposal-pipeline-operator/src/{smartVisitor.js => hackVisitor.js} (95%) rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart+arrow => hack}/await/exec.js (51%) rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart+arrow => hack}/await/options.json (56%) rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart => hack}/basic/exec.js (100%) create mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/indirect-eval/exec.js rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart => hack}/nested/exec.js (100%) rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart => hack}/object-literal/exec.js (81%) create mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/options.json create mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/topic-as-callee/input.js rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart => hack}/topic-as-callee/output.js (100%) create mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/topic-inside-arrow-function/exec.js rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart/await => hack/transform-arrow-functions}/exec.js (66%) rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart+arrow => hack/transform-arrow-functions}/options.json (65%) rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart/for-init/output.js => hack/while/exec.js} (62%) rename packages/babel-plugin-proposal-pipeline-operator/test/fixtures/{smart => hack}/yield/exec.js (93%) delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/options.json delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/exec.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/bare-function/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/exec.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-init/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/exec.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for-update/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/exec.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/for/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/if/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/if/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/exec.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/indirect-eval/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/object-literal/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/options.json delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-as-callee/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/exec.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-inside-arrow-function/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/exec.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/while/output.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/input.js delete mode 100644 packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/yield/output.js diff --git a/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/input.js b/packages/babel-generator/test/fixtures/types/PipeBody/input.js similarity index 100% rename from packages/babel-generator/test/fixtures/types/PipelineTopicExpression/input.js rename to packages/babel-generator/test/fixtures/types/PipeBody/input.js diff --git a/packages/babel-generator/test/fixtures/types/PipeBody/options.json b/packages/babel-generator/test/fixtures/types/PipeBody/options.json new file mode 100644 index 000000000000..bae88d1de4ef --- /dev/null +++ b/packages/babel-generator/test/fixtures/types/PipeBody/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }], "doExpressions"] +} diff --git a/packages/babel-generator/test/fixtures/types/PipelineTopicExpression/output.js b/packages/babel-generator/test/fixtures/types/PipeBody/output.js similarity index 100% rename from packages/babel-generator/test/fixtures/types/PipelineTopicExpression/output.js rename to packages/babel-generator/test/fixtures/types/PipeBody/output.js 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/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-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 35c24b1dd9ae..4ecf3bdc5d2b 100644 --- a/packages/babel-parser/src/parser/error-message.js +++ b/packages/babel-parser/src/parser/error-message.js @@ -129,14 +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', + PipeBodyCannotBeArrow: + 'Unexpected arrow "=>" after pipeline body; arrow function acting as pipe body must be parenthesized due to operator precedence', PipelineTopicUnused: - "Pipeline is in topic style but does not use topic reference", + "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once", 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.", + "Topic reference is unbound; it must be inside a Hack-style pipe body", + PrimaryTopicRequiresHackPipes: + "Topic reference is used, but the pipelineOperator plugin was not passed a 'proposal': 'hack' option.", 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 c466b025f664..38e24ef582fc 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -459,9 +459,9 @@ export default class ExpressionParser extends LValParser { switch (op) { case tt.pipeline: switch (this.getPluginOption("pipelineOperator", "proposal")) { - case "smart": - return this.withTopicPermittingContext(() => { - return this.parseSmartPipelineBody( + case "hack": + return this.withTopicBindingContext(() => { + return this.parseHackPipelineBody( this.parseExprOpBaseRightExpr(op, prec), startPos, startLoc, @@ -1152,10 +1152,8 @@ 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.PrimaryTopicRequiresHackPipes); } this.next(); @@ -2465,32 +2463,32 @@ export default class ExpressionParser extends LValParser { return this.finishNode(node, "YieldExpression"); } - parseSmartPipelineBody( + parseHackPipelineBody( childExpression: N.Expression, startPos: number, startLoc: Position, ): N.PipelineBody { - this.checkSmartPipelineBodyEarlyErrors(); + this.checkHackPipelineBodyEarlyErrors(); - return this.parseSmartPipelineBodyInStyle( + return this.parseHackPipelineBodyInStyle( childExpression, startPos, startLoc, ); } - checkSmartPipelineBodyEarlyErrors(): void { + checkHackPipelineBodyEarlyErrors(): void { if (this.match(tt.arrow)) { // If the following token is invalidly `=>`, then throw a human-friendly error // instead of something like 'Unexpected token, expected ";"'. // For example, `x => x |> y => %` groups into `x => (x |> y) => %`, // and `(x |> y) => %` is an invalid arrow function. // This is because Hack-style `|>` has tighter precedence than `=>`. - throw this.raise(this.state.start, Errors.PipelineBodyNoArrow); + throw this.raise(this.state.start, Errors.PipeBodyCannotBeArrow); } } - parseSmartPipelineBodyInStyle( + parseHackPipelineBodyInStyle( childExpression: N.Expression, startPos: number, startLoc: Position, @@ -2506,13 +2504,13 @@ export default class ExpressionParser extends LValParser { return this.finishNode(bodyNode, "PipelineTopicExpression"); } - // 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. 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/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-primary-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-primary-topic/output.json index 6c724302e0b3..09d380af7eee 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-primary-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/fsharp-proposal-invalid-primary-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", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-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/smart-proposal-addition-with-topic-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/smart-proposal-addition-with-topic-first/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-first/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-first/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-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/smart-proposal-addition-with-topic-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/smart-proposal-addition-with-topic-last/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-last/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-with-topic-last/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-without-topic/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/smart-proposal-addition-without-topic/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/smart-proposal-addition-without-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/output.json similarity index 93% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-without-topic/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-addition-without-topic/output.json index 6e09acd357ab..8e6373dc4b66 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-without-topic/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", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/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/smart-proposal-arrow-function-parenthesized/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/smart-proposal-arrow-function-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-arrow-function-parenthesized/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-unparenthesized/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/smart-proposal-arrow-function-unparenthesized/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/smart-proposal-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/smart-proposal-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/smart-proposal-async-await/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-async-await/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-async-await/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-computed-no-topic/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/smart-proposal-computed-no-topic/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/smart-proposal-computed-no-topic/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/output.json similarity index 93% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-computed-no-topic/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/output.json index 556699d07afc..03f785140fc2 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-computed-no-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-computed-no-topic/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:9)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-do-while-loop-and-topic-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/smart-proposal-do-expression-with-do-while-loop-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-await-of-loop-and-topic-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/smart-proposal-do-expression-with-for-await-of-loop-and-topic-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/smart-proposal-do-expression-with-for-await-of-loop-and-topic-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/smart-proposal-do-expression-with-for-await-of-loop-and-topic-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/smart-proposal-do-expression-with-for-await-of-loop-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-await-of-loop-and-topic-in-loop-head/output.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/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-classic-loop-and-topic-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/smart-proposal-do-expression-with-for-classic-loop-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-in-loop-and-topic-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/smart-proposal-do-expression-with-for-in-loop-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-of-loop-and-topic-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/smart-proposal-do-expression-with-for-of-loop-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-else-body/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-body/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-if-body/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-body/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-if-head/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-if-statement-and-topic-in-if-head/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-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/smart-proposal-do-expression-with-switch-statement-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-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/smart-proposal-do-expression-with-switch-statement-and-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-topic-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/smart-proposal-do-expression-with-topic-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/smart-proposal-do-expression-with-topic-identity/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-topic-identity/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-topic-identity/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/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/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/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/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/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/smart-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-while-loop-topic-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/smart-proposal-do-expression-with-while-loop-topic-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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-while-loop-topic-in-loop-head/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-do-expression-with-while-loop-topic-in-loop-head/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-call-with-topic-in-argument/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/smart-proposal-function-call-with-topic-in-argument/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/smart-proposal-function-call-with-topic-in-argument/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-call-with-topic-in-argument/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-call-with-topic-in-argument/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-definition-with-topic-in-default-parameter/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/smart-proposal-function-definition-with-topic-in-default-parameter/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/smart-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 similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-definition-with-topic-in-default-parameter/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-function-definition-with-topic-in-default-parameter/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-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/smart-proposal-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/smart-proposal-generator-yield/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-generator-yield/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-generator-yield/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-invalid-hash-token-followed-by-digit/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-then-digit/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-invalid-hash-token-followed-by-digit/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-then-digit/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-then-digit/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-invalid-hash-token-then-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-then-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/smart-proposal-mixed-pipeline-plugins/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/smart-proposal-mixed-pipeline-plugins/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/smart-proposal-mixed-pipeline-plugins/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-mixed-pipeline-plugins/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-mixed-pipeline-plugins/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-with-required-topics/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-with-required-topics/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-with-required-topics/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-with-required-topics/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-with-required-topics/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-with-required-topics/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-with-required-topics/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/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/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/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/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/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 96% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/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 e8ce055d0d81..564ec9b03566 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-inner-topic/output.json @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:16)" + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:16)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/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/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/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/smart-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 similarity index 95% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-arrow-function-without-outer-topic/output.json index 1c55597d1ea8..b3a11c15ae94 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:5)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-function-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines/input.js rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-function-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-function-call/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-function-call/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-function-call/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "hack" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-function-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-with-function-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/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/smart-proposal-nested-pipelines-without-inner-topic/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/smart-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 similarity index 94% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-inner-topic/output.json index 4e08420cc88a..76351842ac58 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-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 @@ -2,7 +2,7 @@ "type": "File", "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15}}, "errors": [ - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:11)" + "SyntaxError: Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/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/smart-proposal-nested-pipelines-without-outer-topic/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/smart-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 similarity index 88% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-nested-pipelines-without-outer-topic/output.json index ad7f01b6f022..328cd3371d44 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-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 @@ -2,8 +2,8 @@ "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:11)", - "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" + "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", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-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/smart-proposal-no-topic-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/smart-proposal-no-topic-class-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/output.json similarity index 92% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-class-expression/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-class-expression/output.json index 4c0d88c5a719..ca143969373f 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-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", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-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/smart-proposal-no-topic-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/smart-proposal-no-topic-function-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/output.json similarity index 94% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-function-expression/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-no-topic-function-expression/output.json index 18fa5a9166ad..630a31a6e40c 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-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", diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-simple-unbound-topic/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/smart-proposal-simple-unbound-topic/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/smart-proposal-simple-unbound-topic/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/smart-proposal-simple-unbound-topic/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/smart-proposal-simple-unbound-topic/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/smart-proposal-topic-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/smart-proposal-topic-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/smart-proposal-topic-identity-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-identity-parenthesized/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-parenthesized/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-identity-unparenthesized/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/smart-proposal-topic-identity-unparenthesized/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/smart-proposal-topic-identity-unparenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-identity-unparenthesized/output.json rename to packages/babel-parser/test/fixtures/experimental/pipeline-operator/hack-proposal-topic-identity-unparenthesized/output.json 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/smart-proposal-addition-with-topic-first/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-first/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-first/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-last/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-last/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-with-topic-last/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-without-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-without-topic/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-addition-without-topic/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-parenthesized/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-unparenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-unparenthesized/options.json deleted file mode 100644 index a684795fbfb9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-arrow-function-unparenthesized/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/smart-proposal-async-await/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-async-await/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-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/smart-proposal-computed-no-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-computed-no-topic/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-computed-no-topic/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-do-while-loop-and-topic-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-do-while-loop-and-topic-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/smart-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-classic-loop-and-topic-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-classic-loop-and-topic-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/smart-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-in-loop-and-topic-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-in-loop-and-topic-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/smart-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-of-loop-and-topic-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-for-of-loop-and-topic-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/smart-proposal-do-expression-with-if-statement-and-topic-in-else-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-else-body/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-else-if-body/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-proposal-do-expression-with-if-statement-and-topic-in-if-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-if-body/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-proposal-do-expression-with-if-statement-and-topic-in-if-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-in-if-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-if-statement-and-topic-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/smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-body/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-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/smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-in-switch-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-switch-statement-and-topic-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/smart-proposal-do-expression-with-topic-identity/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-topic-identity/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-topic-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/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-clause/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-finally-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/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-clause/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-finally-statements-and-topic-in-try-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/smart-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-statements-topic-in-try-clause/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-try-catch-statements-topic-in-try-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/smart-proposal-do-expression-with-while-loop-topic-in-loop-head/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-while-loop-topic-in-loop-head/options.json deleted file mode 100644 index edb7679c6a74..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-do-expression-with-while-loop-topic-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/smart-proposal-function-call-with-topic-in-argument/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-call-with-topic-in-argument/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-call-with-topic-in-argument/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-definition-with-topic-in-default-parameter/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-definition-with-topic-in-default-parameter/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-function-definition-with-topic-in-default-parameter/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-generator-yield/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-generator-yield/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-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/smart-proposal-invalid-hash-token-followed-by-digit/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-invalid-hash-token-followed-by-digit/options.json deleted file mode 100644 index a2f6f625f90c..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-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/smart-proposal-mixed-pipeline-plugins/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-mixed-pipeline-plugins/options.json deleted file mode 100644 index 887155e27e68..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-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/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-inner-topic/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function-without-outer-topic/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-arrow-function/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-with-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/smart-proposal-nested-pipelines-without-inner-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-inner-topic/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines-without-outer-topic/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-nested-pipelines/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["pipelineOperator", { "proposal": "smart" }]] -} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-class-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-class-expression/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-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/smart-proposal-no-topic-function-expression/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-function-expression/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-no-topic-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/smart-proposal-topic-identity-parenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-identity-parenthesized/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-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/smart-proposal-topic-identity-unparenthesized/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-identity-unparenthesized/options.json deleted file mode 100644 index 17e4e327bbad..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/smart-proposal-topic-identity-unparenthesized/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/smartVisitor.js b/packages/babel-plugin-proposal-pipeline-operator/src/hackVisitor.js similarity index 95% rename from packages/babel-plugin-proposal-pipeline-operator/src/smartVisitor.js rename to packages/babel-plugin-proposal-pipeline-operator/src/hackVisitor.js index 4b41ffabba31..a5cc641cb13d 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/src/smartVisitor.js +++ b/packages/babel-plugin-proposal-pipeline-operator/src/hackVisitor.js @@ -9,7 +9,7 @@ const updateTopicReferenceVisitor = { }, }; -const smartVisitor = { +const hackVisitor = { BinaryExpression(path) { const { scope } = path; const { node } = path; @@ -45,4 +45,4 @@ const smartVisitor = { }, }; -export default smartVisitor; +export default hackVisitor; 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/test/fixtures/smart+arrow/await/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/await/exec.js similarity index 51% 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/await/exec.js index 7e7ea94bd4cb..22f7d8529839 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/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/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/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/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/smart/basic/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/basic/exec.js similarity index 100% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/basic/exec.js rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/basic/exec.js diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/indirect-eval/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/indirect-eval/exec.js new file mode 100644 index 000000000000..0a1c0ce7409d --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/indirect-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/smart/nested/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/nested/exec.js similarity index 100% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/nested/exec.js rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/nested/exec.js 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/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/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/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/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/topic-as-callee/input.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/topic-as-callee/input.js new file mode 100644 index 000000000000..1edae3c479c0 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/topic-as-callee/input.js @@ -0,0 +1 @@ +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/hack/topic-as-callee/output.js similarity index 100% rename from packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/topic-as-callee/output.js rename to packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/topic-as-callee/output.js diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/topic-inside-arrow-function/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/topic-inside-arrow-function/exec.js new file mode 100644 index 000000000000..d65f5abae857 --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/topic-inside-arrow-function/exec.js @@ -0,0 +1,5 @@ +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/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/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/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/exec.js similarity index 62% 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/exec.js index 23b1465b27a5..a7d99f77ef42 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/exec.js @@ -1,9 +1,7 @@ +let i = 0; let sum = 0; -for (var i = (_ = 0, _); i <= 10; i++) { - var _; - +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/yield/exec.js b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/hack/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/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/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/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/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/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-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);