Add snapshot of release-1.0.3 sources

This commit is contained in:
Mohamed Hegazy
2014-07-12 15:32:26 -07:00
parent 99ec3a9688
commit 79727ee12f
13130 changed files with 2079574 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
===== TypeScript Sample: Simple =====
=== Overview ===
Simple use of classes and inheritance:
- Classes: A base class and two subclasses
- Super calls: Derived classes make super calls
=== Running ===
tsc animals.ts
+26
View File
@@ -0,0 +1,26 @@
class Animal {
constructor(public name) { }
move(meters) {
alert(this.name + " moved " + meters + "m.");
}
}
class Snake extends Animal {
move() {
alert("Slithering...");
super.move(5);
}
}
class Horse extends Animal {
move() {
alert("Galloping...");
super.move(45);
}
}
var sam = new Snake("Sammy the Python")
var tom: Animal = new Horse("Tommy the Palomino")
sam.move()
tom.move(34)