diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/input.js b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/input.js new file mode 100644 index 0000000000..ea421c59a0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/input.js @@ -0,0 +1,3 @@ +async function f () { + return x |> await #; +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/options.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/options.json new file mode 100644 index 0000000000..17e4e327bb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["pipelineOperator", { "proposal": "smart" }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json new file mode 100644 index 0000000000..9337eb29bf --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json @@ -0,0 +1,181 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 20, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ReturnStatement", + "start": 24, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "argument": { + "type": "BinaryExpression", + "start": 31, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "left": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "x" + }, + "name": "x" + }, + "operator": "|>", + "right": { + "type": "PipelineTopicExpression", + "start": 36, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 36, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "argument": { + "type": "PipelinePrimaryTopicReference", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + } + } + } + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file