Skip to content

Commit

Permalink
Remove FunctionExpression conversion logic
Browse files Browse the repository at this point in the history
  • Loading branch information
not-an-aardvark committed Mar 30, 2017
1 parent 5aa33c6 commit 44db540
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions espree.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,6 @@ function esprimaFinishNode(result) {
}
}

// Acorn currently uses expressions instead of declarations in default exports
if (result.type === "ExportDefaultDeclaration") {
if (/^(Class|Function)Expression$/.test(result.declaration.type)) {
result.declaration.type = result.declaration.type.replace("Expression", "Declaration");
}
}

// Acorn uses undefined instead of null, which affects serialization
if (result.type === "Literal" && result.value === undefined) {
result.value = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
38
],
"declaration": {
"type": "FunctionDeclaration",
"type": "FunctionExpression",
"loc": {
"start": {
"line": 1,
Expand Down Expand Up @@ -274,4 +274,4 @@ module.exports = {
]
}
]
}
}

0 comments on commit 44db540

Please sign in to comment.