From 0a3f6c49f800641333baf5af9adbecb36f490f79 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Fri, 23 Jul 2010 09:34:54 -0700 Subject: [PATCH] updating documentation with correct variable names. --- documentation/index.html.erb | 4 ++-- documentation/js/classes.js | 5 ++-- documentation/js/range_comprehensions.js | 7 +++--- index.html | 30 ++++++++++++------------ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/documentation/index.html.erb b/documentation/index.html.erb index ff6ec46f..b84d1d1a 100644 --- a/documentation/index.html.erb +++ b/documentation/index.html.erb @@ -405,8 +405,8 @@ coffee --print app/scripts/*.coffee > concatenation.js

Notice how the all of the variable declarations have been pushed up to the top of the closest scope, the first time they appear. - num is not redeclared within the inner function, because it's - already in scope; the new_num within the function, on the other hand, + outer is not redeclared within the inner function, because it's + already in scope; inner within the function, on the other hand, should not be able to change the value of the external variable of the same name, and therefore has a declaration of its own.

diff --git a/documentation/js/classes.js b/documentation/js/classes.js index 1f5ca1dd..a4fccd95 100644 --- a/documentation/js/classes.js +++ b/documentation/js/classes.js @@ -3,11 +3,12 @@ var __extends = function(child, parent) { var ctor = function(){ }; ctor.prototype = parent.prototype; - child.__superClass__ = parent.prototype; child.prototype = new ctor(); child.prototype.constructor = child; + if (typeof parent.extended === "function") parent.extended(child); + child.__superClass__ = parent.prototype; }; - Animal = function() { }; + Animal = function() {}; Animal.prototype.move = function(meters) { return alert(this.name + " moved " + meters + "m."); }; diff --git a/documentation/js/range_comprehensions.js b/documentation/js/range_comprehensions.js index dfcca44e..e7b2cc30 100644 --- a/documentation/js/range_comprehensions.js +++ b/documentation/js/range_comprehensions.js @@ -2,16 +2,15 @@ var _a, countdown, deliverEggs, num; countdown = (function() { _a = []; - for (num = 10; num >= 1; num += -1) { + for (num = 10; num >= 1; num--) { _a.push(num); } return _a; })(); deliverEggs = function() { var _b, _c, dozen, i; - _b = []; (_c = eggs.length); - - for (i = 0; i < _c; i += 12) { + _b = []; _c = eggs.length; + for (i = 0; (0 <= _c ? i < _c : i > _c); i += 12) { _b.push((function() { dozen = eggs.slice(i, i + 12); return deliver(new eggCarton(dozen)); diff --git a/index.html b/index.html index d70c57b2..14ae5c9f 100644 --- a/index.html +++ b/index.html @@ -570,8 +570,8 @@ inner = changeNumbers();

Notice how the all of the variable declarations have been pushed up to the top of the closest scope, the first time they appear. - num is not redeclared within the inner function, because it's - already in scope; the new_num within the function, on the other hand, + outer is not redeclared within the inner function, because it's + already in scope; inner within the function, on the other hand, should not be able to change the value of the external variable of the same name, and therefore has a declaration of its own.

@@ -877,7 +877,7 @@ _f = asteroids; in fixed-size increments, you can use a range to specify the start and end of your comprehension.

-
countdown: num for num in [10..1] by -1
+    
countdown: num for num in [10..1]
 
 deliverEggs: ->
   for i in [0...eggs.length] by 12
@@ -886,16 +886,15 @@ _f = asteroids;
 
var _a, countdown, deliverEggs, num;
 countdown = (function() {
   _a = [];
-  for (num = 10; num >= 1; num += -1) {
+  for (num = 10; num >= 1; num--) {
     _a.push(num);
   }
   return _a;
 })();
 deliverEggs = function() {
   var _b, _c, dozen, i;
-  _b = []; (_c = eggs.length);
-
-  for (i = 0; i < _c; i += 12) {
+  _b = []; _c = eggs.length;
+  for (i = 0; (0 <= _c ? i < _c : i > _c); i += 12) {
     _b.push((function() {
       dozen = eggs.slice(i, i + 12);
       return deliver(new eggCarton(dozen));
@@ -906,16 +905,15 @@ countdown = (function(