diff --git a/documentation/index.html.erb b/documentation/index.html.erb index 72078981..1d339828 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -485,7 +485,7 @@ coffee --print app/scripts/*.coffee > concatenation.js and return. If you make use of them within a block of code, CoffeeScript won't try to perform the conversion.

- +

The Existential Operator It's a little difficult to check for the existence of a variable in @@ -509,8 +509,8 @@ coffee --print app/scripts/*.coffee > concatenation.js

<%= code_for('soaks') %>

- Soaking up nulls is similar to Ruby's - andand gem, and to the + Soaking up nulls is similar to Ruby's + andand gem, and to the safe navigation operator in Groovy.

@@ -668,7 +668,7 @@ coffee --print app/scripts/*.coffee > concatenation.js

Change Log

- +

0.3.2 @property is now a shorthand for this.property.
@@ -824,5 +824,13 @@ coffee --print app/scripts/*.coffee > concatenation.js + + + + + + + + diff --git a/documentation/js/existence.js b/documentation/js/existence.js index cfc27fd2..9ac6438f 100644 --- a/documentation/js/existence.js +++ b/documentation/js/existence.js @@ -1,6 +1,6 @@ (function(){ var solipsism, speed; - if ((typeof mind !== "undefined" && mind !== null) && (typeof !world !== "undefined" && !world !== null)) { + if ((typeof mind !== "undefined" && mind !== null) && !(typeof world !== "undefined" && world !== null)) { solipsism = true; } speed = (typeof speed !== "undefined" && speed !== null) ? speed : 140; diff --git a/documentation/js/fat_arrow.js b/documentation/js/fat_arrow.js index 139ad2c7..f7a08321 100644 --- a/documentation/js/fat_arrow.js +++ b/documentation/js/fat_arrow.js @@ -1,10 +1,9 @@ (function(){ var Account; Account = function Account(customer, cart) { - var __a; this.customer = customer; this.cart = cart; - __a = $('.shopping_cart').bind('click', (function(__this) { + return $('.shopping_cart').bind('click', (function(__this) { var __func = function(event) { return this.customer.purchase(this.cart); }; @@ -12,6 +11,5 @@ return __func.apply(__this, arguments); }); })(this)); - return Account === this.constructor ? this : __a; }; })(); \ No newline at end of file diff --git a/documentation/js/super.js b/documentation/js/super.js index 0cefebf8..96ae4eda 100644 --- a/documentation/js/super.js +++ b/documentation/js/super.js @@ -5,33 +5,31 @@ return alert(this.name + " moved " + meters + "m."); }; Snake = function Snake(name) { - var __a; - __a = this.name = name; - return Snake === this.constructor ? this : __a; + this.name = name; + return this; + }; + Snake.prototype.move = function move() { + alert("Slithering..."); + return Snake.__superClass__.move.call(this, 5); }; __a = function(){}; __a.prototype = Animal.prototype; Snake.__superClass__ = Animal.prototype; Snake.prototype = new __a(); Snake.prototype.constructor = Snake; - Snake.prototype.move = function move() { - alert("Slithering..."); - return Snake.__superClass__.move.call(this, 5); - }; Horse = function Horse(name) { - var __b; - __b = this.name = name; - return Horse === this.constructor ? this : __b; + this.name = name; + return this; + }; + Horse.prototype.move = function move() { + alert("Galloping..."); + return Horse.__superClass__.move.call(this, 45); }; __b = function(){}; __b.prototype = Animal.prototype; Horse.__superClass__ = Animal.prototype; Horse.prototype = new __b(); Horse.prototype.constructor = Horse; - Horse.prototype.move = function move() { - alert("Galloping..."); - return Horse.__superClass__.move.call(this, 45); - }; sam = new Snake("Sammy the Python"); tom = new Horse("Tommy the Palomino"); sam.move(); diff --git a/index.html b/index.html index cea3591c..12a24f77 100644 --- a/index.html +++ b/index.html @@ -1036,7 +1036,7 @@ globals = ((function() { and return. If you make use of them within a block of code, CoffeeScript won't try to perform the conversion.

- +

The Existential Operator It's a little difficult to check for the existence of a variable in @@ -1058,12 +1058,12 @@ speed ?= var solipsism, speed; -if ((typeof mind !== "undefined" && mind !== null) && (typeof !world !== "undefined" && !world !== null)) { +if ((typeof mind !== "undefined" && mind !== null) && !(typeof world !== "undefined" && world !== null)) { solipsism = true; } speed = (typeof speed !== "undefined" && speed !== null) ? speed : 140;