diff --git a/test/fixtures/experimental/function-sent/enabled-if-statement/actual.js b/test/fixtures/experimental/function-sent/enabled-if-statement/actual.js new file mode 100644 index 0000000000..bc34f78278 --- /dev/null +++ b/test/fixtures/experimental/function-sent/enabled-if-statement/actual.js @@ -0,0 +1,3 @@ +function* foo() { + if (true) function.sent; +} diff --git a/test/fixtures/experimental/function-sent/enabled-if-statement/expected.json b/test/fixtures/experimental/function-sent/enabled-if-statement/expected.json new file mode 100644 index 0000000000..7ed356f20a --- /dev/null +++ b/test/fixtures/experimental/function-sent/enabled-if-statement/expected.json @@ -0,0 +1,184 @@ +{ + "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", + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": true, + "expression": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "IfStatement", + "start": 20, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 24, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "value": true + }, + "consequent": { + "type": "ExpressionStatement", + "start": 30, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "expression": { + "type": "MetaProperty", + "start": 30, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 25 + } + }, + "meta": { + "type": "Identifier", + "start": 30, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "function" + }, + "name": "function" + }, + "property": { + "type": "Identifier", + "start": 39, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 25 + }, + "identifierName": "sent" + }, + "name": "sent" + } + } + }, + "alternate": null + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/test/fixtures/experimental/function-sent/enabled-if-statement/options.json b/test/fixtures/experimental/function-sent/enabled-if-statement/options.json new file mode 100644 index 0000000000..fea46c76c3 --- /dev/null +++ b/test/fixtures/experimental/function-sent/enabled-if-statement/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["functionSent"] +}