Skip to content

Commit

Permalink
test: duplicate declare function and function would not throw
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jul 24, 2019
1 parent a61fa14 commit 1bf302b
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 3 deletions.
Expand Up @@ -3,6 +3,5 @@
"plugins": [
"jsx",
"flow"
],
"throws": "Identifier 'A' has already been declared (2:9)"
}
]
}
@@ -0,0 +1,168 @@
{
"type": "File",
"start": 0,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 15
}
},
"program": {
"type": "Program",
"start": 0,
"end": 43,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 15
}
},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "DeclareFunction",
"start": 0,
"end": 27,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 27
}
},
"id": {
"type": "Identifier",
"start": 17,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 17
},
"end": {
"line": 1,
"column": 26
},
"identifierName": "A"
},
"name": "A",
"typeAnnotation": {
"type": "TypeAnnotation",
"start": 18,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 26
}
},
"typeAnnotation": {
"type": "FunctionTypeAnnotation",
"start": 18,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 1,
"column": 26
}
},
"typeParameters": null,
"params": [],
"rest": null,
"returnType": {
"type": "VoidTypeAnnotation",
"start": 22,
"end": 26,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 26
}
}
}
}
}
},
"predicate": null
},
{
"type": "FunctionDeclaration",
"start": 28,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 15
}
},
"id": {
"type": "Identifier",
"start": 37,
"end": 38,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 10
},
"identifierName": "A"
},
"name": "A"
},
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 41,
"end": 43,
"loc": {
"start": {
"line": 2,
"column": 13
},
"end": {
"line": 2,
"column": 15
}
},
"body": [],
"directives": []
}
}
],
"directives": []
}
}

0 comments on commit 1bf302b

Please sign in to comment.