Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anything after Debug.failBadSyntaxKind is dead code #22922

Merged
1 commit merged into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/compiler/transformers/es2015.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1510,8 +1510,7 @@ namespace ts {
break;

default:
Debug.failBadSyntaxKind(node);
break;
return Debug.failBadSyntaxKind(node);
}

const captureNewTargetStatement = createVariableStatement(
Expand Down
3 changes: 1 addition & 2 deletions src/compiler/transformers/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,7 @@ namespace ts {
return visitFunctionExpression(<FunctionExpression>node);

default:
Debug.failBadSyntaxKind(node);
return visitEachChild(node, visitor, context);
return Debug.failBadSyntaxKind(node);
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/compiler/transformers/jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ namespace ts {
return visitJsxFragment(node, /*isChild*/ true);

default:
Debug.failBadSyntaxKind(node);
return undefined;
return Debug.failBadSyntaxKind(node);
}
}

Expand Down Expand Up @@ -182,7 +181,7 @@ namespace ts {
return visitJsxExpression(node);
}
else {
Debug.failBadSyntaxKind(node);
return Debug.failBadSyntaxKind(node);
}
}

Expand Down
13 changes: 4 additions & 9 deletions src/compiler/transformers/ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ namespace ts {
return node;

default:
Debug.failBadSyntaxKind(node);
return undefined;
return Debug.failBadSyntaxKind(node);
}
}

Expand Down Expand Up @@ -531,8 +530,7 @@ namespace ts {
return visitImportEqualsDeclaration(<ImportEqualsDeclaration>node);

default:
Debug.failBadSyntaxKind(node);
return visitEachChild(node, visitor, context);
return Debug.failBadSyntaxKind(node);
}
}

Expand Down Expand Up @@ -1870,10 +1868,8 @@ namespace ts {
return createIdentifier("Boolean");

default:
Debug.failBadSyntaxKind((<LiteralTypeNode>node).literal);
break;
return Debug.failBadSyntaxKind((<LiteralTypeNode>node).literal);
}
break;

case SyntaxKind.NumberKeyword:
return createIdentifier("Number");
Expand All @@ -1900,8 +1896,7 @@ namespace ts {
break;

default:
Debug.failBadSyntaxKind(node);
break;
return Debug.failBadSyntaxKind(node);
}

return createIdentifier("Object");
Expand Down