mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-16 05:58:32 -06:00
Elides functions with invalid bodies.
This commit is contained in:
parent
e50469948f
commit
816467ceea
@ -1903,6 +1903,10 @@ namespace ts {
|
||||
* @param node The function expression node.
|
||||
*/
|
||||
function visitFunctionExpression(node: FunctionExpression) {
|
||||
if (nodeIsMissing(node.body)) {
|
||||
return createNode(SyntaxKind.OmittedExpression);
|
||||
}
|
||||
|
||||
return createFunctionExpression(
|
||||
node.asteriskToken,
|
||||
node.name,
|
||||
@ -1919,7 +1923,7 @@ namespace ts {
|
||||
* @param node The declaration node.
|
||||
*/
|
||||
function shouldElideFunctionLikeDeclaration(node: FunctionLikeDeclaration) {
|
||||
return node.body === undefined
|
||||
return nodeIsMissing(node.body)
|
||||
|| hasModifier(node, ModifierFlags.Abstract | ModifierFlags.Ambient);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user