Closed
Description
Currently private functions are put on the prototype of a function so they are not really private. I suggest adding them as normal functions in the scope of the class so that they are in fact only accessible to the class.
Example
module Example
{
export class ExampleClass
{
method()
{
this.privateMethod();
}
private privateMethod()
{
console.log("private");
}
}
}
would create
var Example;
(function (Example) {
var ExampleClass = (function () {
function ExampleClass() {
}
function ExampleClass_privateMethod()
{
console.log("private");
}
ExampleClass.prototype.method = function () {
privateMethod();
};
return ExampleClass;
})();
Example.ExampleClass = ExampleClass;
})(Example || (Example = {}));