class Test { otherFunction() {} method() { this.otherFunction(); } }El mecanografiado anterior generará ES5 js como este
var Test = /** @class */ (function () { function Test() { } Test.prototype.otherFunction = function () { }; Test.prototype.method = function () { this.otherFunction(); }; return Test; }());¿Cómo obtener una salida como la siguiente función después de compilar mecanografiado?
var Test = (function() { function Test() {} function otherFunction() {} Test.prototype.method = function () { otherFunction(); } return Test; })();compila este
(function () { function Test() {} function otherFunction() {} Test.prototype.method = function () { this.otherFunction(); }; return Test; })();generará
(function () { function Test() { } function otherFunction() { } Test.prototype.method = function () { this.otherFunction(); }; return Test; })();