fix export default function expression disambiguation - fixes #2189

This commit is contained in:
Sebastian McKenzie
2015-08-10 13:04:08 +01:00
parent 4fda34ce6f
commit b581a7590c
5 changed files with 146 additions and 17 deletions

View File

@@ -0,0 +1,2 @@
export default function () {}
(foo);

View File

@@ -0,0 +1,115 @@
{
"type": "File",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"program": {
"type": "Program",
"start": 0,
"end": 36,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"sourceType": "module",
"body": [
{
"type": "ExportDefaultDeclaration",
"start": 0,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 29
}
},
"declaration": {
"type": "FunctionExpression",
"start": 15,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 15
},
"end": {
"line": 1,
"column": 29
}
},
"id": null,
"generator": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 27,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 27
},
"end": {
"line": 1,
"column": 29
}
},
"body": []
}
}
},
{
"type": "ExpressionStatement",
"start": 30,
"end": 36,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 6
}
},
"expression": {
"type": "Identifier",
"start": 31,
"end": 34,
"loc": {
"start": {
"line": 2,
"column": 1
},
"end": {
"line": 2,
"column": 4
}
},
"name": "foo",
"parenthesizedExpression": true
}
}
]
}
}

View File

@@ -1,3 +0,0 @@
{
"sourceType": "module"
}