You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
typeConstructor<T={}>=new(...args: any[])=>T;functionMixin<TextendsConstructor>(Base: T){returnclassextendsBase{NonArrowFunction(){console.log("Non Arrow Function");}ArrowFunction=()=>{console.log("Arrow Function");}}}classAextendsMixin(Object){constructor(){super()// No runtime errorsthis.ArrowFunction();// Runtime error in es5 exportthis.NonArrowFunction();}}newA();
Expected behavior:
No runtime error when compiled with --target es5 and run with latest node version.
Actual behavior:
TypeError: _this.NonArrowFunction is not a function
at new A (C:\Users\Daniel\Desktop\mixines5.js:31:15)
at Object.<anonymous> (C:\Users\Daniel\Desktop\mixines5.js:36:1)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:158:16)
at bootstrap_node.js:575:3
The runtime error does not happen when mixing into an empty class as opposed to Object.
The text was updated successfully, but these errors were encountered:
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.5.2
Code
Expected behavior:
No runtime error when compiled with
--target es5
and run with latest node version.Actual behavior:
The runtime error does not happen when mixing into an empty class as opposed to
Object
.The text was updated successfully, but these errors were encountered: