Created
August 23, 2015 16:43
-
-
Save gintsgints/704ba90cdbdd5a92ac4e to your computer and use it in GitHub Desktop.
This is how Typescript generate supper call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var __extends = (this && this.__extends) || function (d, b) { | |
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | |
function __() { this.constructor = d; } | |
__.prototype = b.prototype; | |
d.prototype = new __(); | |
}; | |
var Person = (function () { | |
function Person(name, age) { | |
this.name = name; | |
this.age = age; | |
} | |
Person.prototype.getDescription = function () { | |
return "Returns person description"; | |
}; | |
return Person; | |
})(); | |
var Man = (function (_super) { | |
__extends(Man, _super); | |
function Man(name, age) { | |
_super.call(this, name, age); | |
} | |
Man.prototype.getDescription = function () { | |
var desc; | |
desc = _super.prototype.getDescription.call(this); | |
return desc + this.name + " is " + this.age + " years old"; | |
}; | |
return Man; | |
})(Person); | |
var lee = new Man("Lee", 39); | |
console.log(lee.getDescription()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Typescrpit compiled from: