-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Handbook applyMixins code does not compile #682
Comments
It looks like we might just need a guard, like this: function applyMixins(derivedCtor: any, baseCtors: any[]) {
baseCtors.forEach((baseCtor) => {
Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => {
const baseCtorName = Object.getOwnPropertyDescriptor(baseCtor.prototype, name);
if (!baseCtorName) {
return;
}
Object.defineProperty(derivedCtor.prototype, name, baseCtorName);
});
});
} |
Fixed by my re-write of the mixins docs for the new site #719 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TypeScript Version: 3.8.3
Search Terms:
Expected behavior:
I expected the example in the Handbook to compile without problems.
Actual behavior:
Copying the suggested code from the docs/handbook failed to compile
Related Issues:
Code
Output
Compiler Options
Playground Link: Provided
The text was updated successfully, but these errors were encountered: