From e916d4648d0b6ba93b0a9d983e4ee1261dcb3685 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Tue, 22 Dec 2009 12:08:29 -0500 Subject: [PATCH] removed all traces of 'extends' -- it's not any shorter or more convenient than just setting the prototype --- documentation/cs/super.cs | 4 ++-- documentation/js/array_comprehensions.js | 3 +++ documentation/js/expressions_assignment.js | 3 --- documentation/js/intro.js | 2 ++ documentation/js/punctuation.js | 4 ++++ documentation/js/super.js | 1 - documentation/js/switch.js | 4 +++- examples/code.cs | 4 ++-- index.html | 11 +++++++---- .../Syntaxes/CoffeeScript.tmLanguage | 2 +- lib/coffee_script/grammar.y | 10 ++-------- lib/coffee_script/lexer.rb | 2 +- lib/coffee_script/nodes.rb | 15 --------------- 13 files changed, 27 insertions(+), 38 deletions(-) delete mode 100644 documentation/js/expressions_assignment.js diff --git a/documentation/cs/super.cs b/documentation/cs/super.cs index 21c89a26..2c97fb99 100644 --- a/documentation/cs/super.cs +++ b/documentation/cs/super.cs @@ -3,13 +3,13 @@ Animal.prototype.move: meters => alert(this.name + " moved " + meters + "m."). Snake: name => this.name: name. -Snake extends new Animal() +Snake.prototype: new Animal() Snake.prototype.move: => alert("Slithering...") super(5). Horse: name => this.name: name. -Horse extends new Animal() +Horse.prototype: new Animal() Horse.prototype.move: => alert("Galloping...") super(45). diff --git a/documentation/js/array_comprehensions.js b/documentation/js/array_comprehensions.js index 75242df7..3fcbd836 100644 --- a/documentation/js/array_comprehensions.js +++ b/documentation/js/array_comprehensions.js @@ -1,4 +1,6 @@ (function(){ + + // Eat lunch. var lunch; var a = ['toast', 'cheese', 'wine']; var d = []; @@ -7,6 +9,7 @@ d[b] = food.eat(); } lunch = d; + // Zebra-stripe a table. var e = table; for (var f=0, g=e.length; f alert(this.name + " moved " + meters + "m."). Snake: name => this.name: name. -Snake extends Animal +Snake.prototype: Animal Snake.prototype.move: => alert('Slithering...') super(5). Horse: name => this.name: name. -Horse extends Animal +Horse.prototype: Animal Horse.prototype.move: => alert('Galloping...') super(45). diff --git a/index.html b/index.html index 11480003..63b99d6a 100644 --- a/index.html +++ b/index.html @@ -275,7 +275,9 @@ lunch: food.eat() for # Zebra-stripe a table. highlight(row) for row, i in table if i % 2 is 0. -
var lunch;
+
+// Eat lunch.
+var lunch;
 var a = ['toast', 'cheese', 'wine'];
 var d = [];
 for (var b=0, c=a.length; b<c; b++) {
@@ -283,6 +285,7 @@ highlight(row) for row, i in<
   d[b] = food.eat();
 }
 lunch = d;
+// Zebra-stripe a table.
 var e = table;
 for (var f=0, g=e.length; f<g; f++) {
   var row = e[f];
@@ -333,7 +336,6 @@ tom: new var Animal = function() {
-
 };
 Animal.prototype.move = function(meters) {
   return alert(this.name + " moved " + meters + "m.");
@@ -359,7 +361,6 @@ tom.move()
 sam.move();
 tom.move();