Ignore abstract methods when decorating class (#11345)

* Ignore abstract methods when decorating class

* Address Nico's feedback

* Add input/output test

* Update test output to account for _nonIterableRest changes
This commit is contained in:
Oliver Dunk
2020-03-28 23:17:29 +00:00
committed by GitHub
parent 6a00cbe0ab
commit 71e7a7b1e0
5 changed files with 133 additions and 1 deletions

View File

@@ -128,7 +128,10 @@ export function buildDecoratedClass(ref, path, elements, file) {
const classDecorators = takeDecorators(node);
const definitions = t.arrayExpression(
elements.map(extractElementDescriptor.bind(file, node.id, superId)),
elements
// Ignore TypeScript's abstract methods (see #10514)
.filter(element => !element.node.abstract)
.map(extractElementDescriptor.bind(file, node.id, superId)),
);
let replacement = template.expression.ast`