TypeScript-Handbook icon indicating copy to clipboard operation
TypeScript-Handbook copied to clipboard

Documented applyMixins doesn't compile since TypeScript 2.7

Open ferk6a opened this issue 5 years ago • 1 comments

The following snippet from the handbook doesn't compile anymore:

function applyMixins(derivedCtor: any, baseCtors: any[]) {
    baseCtors.forEach(baseCtor => {
        Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
            Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
        });
    });
}

2.7.2 Playground 2.4.1 Playground

Any suggestions on how to fix it?

ferk6a avatar Feb 19 '20 02:02 ferk6a

Bump

Akazm avatar Jun 05 '20 07:06 Akazm