forked from babel/babel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(flow): declare interface identifier as lexcial binding
Fixes babel#10044
- Loading branch information
Showing
3 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/babel-parser/test/fixtures/flow/regression/issue-10044/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
interface Foo {} | ||
|
||
export type { Foo } |
160 changes: 160 additions & 0 deletions
160
packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
{ | ||
"type": "File", | ||
"start": 0, | ||
"end": 37, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 19 | ||
} | ||
}, | ||
"program": { | ||
"type": "Program", | ||
"start": 0, | ||
"end": 37, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 19 | ||
} | ||
}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "InterfaceDeclaration", | ||
"start": 0, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"id": { | ||
"type": "Identifier", | ||
"start": 10, | ||
"end": 13, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 10 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 13 | ||
}, | ||
"identifierName": "Foo" | ||
}, | ||
"name": "Foo" | ||
}, | ||
"typeParameters": null, | ||
"extends": [], | ||
"implements": [], | ||
"mixins": [], | ||
"body": { | ||
"type": "ObjectTypeAnnotation", | ||
"start": 14, | ||
"end": 16, | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"callProperties": [], | ||
"properties": [], | ||
"indexers": [], | ||
"internalSlots": [], | ||
"exact": false | ||
} | ||
}, | ||
{ | ||
"type": "ExportNamedDeclaration", | ||
"start": 18, | ||
"end": 37, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 19 | ||
} | ||
}, | ||
"specifiers": [ | ||
{ | ||
"type": "ExportSpecifier", | ||
"start": 32, | ||
"end": 35, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
} | ||
}, | ||
"local": { | ||
"type": "Identifier", | ||
"start": 32, | ||
"end": 35, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
}, | ||
"identifierName": "Foo" | ||
}, | ||
"name": "Foo" | ||
}, | ||
"exported": { | ||
"type": "Identifier", | ||
"start": 32, | ||
"end": 35, | ||
"loc": { | ||
"start": { | ||
"line": 3, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 3, | ||
"column": 17 | ||
}, | ||
"identifierName": "Foo" | ||
}, | ||
"name": "Foo" | ||
} | ||
} | ||
], | ||
"source": null, | ||
"exportKind": "type", | ||
"declaration": null | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |