diff --git a/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/index.js b/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/index.js rename to packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/input.js diff --git a/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/output.json b/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/output.json new file mode 100644 index 0000000000..c17c84eca9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/output.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSDeclareFunction", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 9, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [], + "returnType": { + "type": "TSTypeAnnotation", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start": 14, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 18 + } + } + } + } + }, + { + "type": "FunctionDeclaration", + "start": 20, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ExportNamedDeclaration", + "start": 37, + "end": 50, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + } + }, + "local": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + }, + "exported": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 10 + }, + "identifierName": "f" + }, + "name": "f" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file