summaryrefslogtreecommitdiff
path: root/tests/examplefiles/example.ts
diff options
context:
space:
mode:
authorAndy Li <andy@onthewings.net>2013-02-19 02:30:44 +0800
committerAndy Li <andy@onthewings.net>2013-02-19 02:30:44 +0800
commit565a8ec40162f20a004b826ad339c655f696b45e (patch)
treea4ba4fe5b8874e3305941613034e6f6548bdb6a9 /tests/examplefiles/example.ts
parent25273ed077997a0ed8ca8bcf34be7b94e248c5cb (diff)
parent054c464c70c115f476608a51bb0b4a931d1fa400 (diff)
downloadpygments-565a8ec40162f20a004b826ad339c655f696b45e.tar.gz
Merge upstream changes.
Diffstat (limited to 'tests/examplefiles/example.ts')
-rw-r--r--tests/examplefiles/example.ts28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/examplefiles/example.ts b/tests/examplefiles/example.ts
new file mode 100644
index 00000000..545c6cf5
--- /dev/null
+++ b/tests/examplefiles/example.ts
@@ -0,0 +1,28 @@
+class Animal {
+ constructor(public name) { }
+ move(meters) {
+ alert(this.name + " moved " + meters + "m.");
+ }
+}
+
+class Snake extends Animal {
+ constructor(name) { super(name); }
+ move() {
+ alert("Slithering...");
+ super.move(5);
+ }
+}
+
+class Horse extends Animal {
+ constructor(name) { super(name); }
+ 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)