TypeScript Version: 2.5.2
Code
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.
TypeScript Version: 2.5.2
Code
Expected behavior:
No runtime error when compiled with
--target es5and run with latest node version.Actual behavior:
The runtime error does not happen when mixing into an empty class as opposed to
Object.