Skip to content

Commit fea8561

Browse files
committed
Remove dead code from binder
`getNameOfDeclaration` now handles a lot of the special property assignment kinds in `getDeclarationName`
1 parent 3c6393a commit fea8561

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/compiler/binder.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,9 @@ namespace ts {
260260
case SyntaxKind.ExportAssignment:
261261
return (<ExportAssignment>node).isExportEquals ? "export=" : "default";
262262
case SyntaxKind.BinaryExpression:
263-
switch (getSpecialPropertyAssignmentKind(node as BinaryExpression)) {
264-
case SpecialPropertyAssignmentKind.ModuleExports:
265-
// module.exports = ...
266-
return "export=";
267-
case SpecialPropertyAssignmentKind.ExportsProperty:
268-
case SpecialPropertyAssignmentKind.ThisProperty:
269-
case SpecialPropertyAssignmentKind.Property:
270-
// exports.x = ... or this.y = ...
271-
return ((node as BinaryExpression).left as PropertyAccessExpression).name.text;
272-
case SpecialPropertyAssignmentKind.PrototypeProperty:
273-
// className.prototype.methodName = ...
274-
return (((node as BinaryExpression).left as PropertyAccessExpression).expression as PropertyAccessExpression).name.text;
263+
if (getSpecialPropertyAssignmentKind(node as BinaryExpression) === SpecialPropertyAssignmentKind.ModuleExports) {
264+
// module.exports = ...
265+
return "export=";
275266
}
276267
Debug.fail("Unknown binary declaration kind");
277268
break;

0 commit comments

Comments
 (0)