diff --git a/documentation/js/array_comprehensions.js b/documentation/js/array_comprehensions.js index f7ce5e09..fe7d5db6 100644 --- a/documentation/js/array_comprehensions.js +++ b/documentation/js/array_comprehensions.js @@ -2,12 +2,12 @@ var __a, __b, __c, __d, __e, __f, __g, food, lunch, roid, roid2; // Eat lunch. lunch = (function() { - __c = []; __a = ['toast', 'cheese', 'wine']; - for (__b=0; __b<__a.length; __b++) { - food = __a[__b]; - __c.push(eat(food)); + __a = []; __b = ['toast', 'cheese', 'wine']; + for (__c=0; __c<__b.length; __c++) { + food = __b[__c]; + __a.push(eat(food)); } - return __c; + return __a; })(); // Naive collision detection. __d = asteroids; diff --git a/documentation/js/expressions_comprehension.js b/documentation/js/expressions_comprehension.js index 262bab7e..2d159d9f 100644 --- a/documentation/js/expressions_comprehension.js +++ b/documentation/js/expressions_comprehension.js @@ -2,12 +2,12 @@ var __a, __b, globals, name; // The first ten global properties. globals = ((function() { - __b = []; __a = window; - for (name in __a) { - if (__a.hasOwnProperty(name)) { - __b.push(name); + __a = []; __b = window; + for (name in __b) { + if (__b.hasOwnProperty(name)) { + __a.push(name); } } - return __b; + return __a; })()).slice(0, 10); })(); \ No newline at end of file diff --git a/documentation/js/object_comprehensions.js b/documentation/js/object_comprehensions.js index c3865f6e..81d94a41 100644 --- a/documentation/js/object_comprehensions.js +++ b/documentation/js/object_comprehensions.js @@ -6,13 +6,13 @@ tim: 11 }; ages = (function() { - __b = []; __a = years_old; - for (child in __a) { - age = __a[child]; - if (__a.hasOwnProperty(child)) { - __b.push(child + " is " + age); + __a = []; __b = years_old; + for (child in __b) { + age = __b[child]; + if (__b.hasOwnProperty(child)) { + __a.push(child + " is " + age); } } - return __b; + return __a; })(); })(); \ No newline at end of file diff --git a/documentation/js/overview.js b/documentation/js/overview.js index 6ecf2944..1e61b371 100644 --- a/documentation/js/overview.js +++ b/documentation/js/overview.js @@ -33,11 +33,11 @@ } // Array comprehensions: cubed_list = (function() { - __c = []; __a = list; - for (__b=0; __b<__a.length; __b++) { - num = __a[__b]; - __c.push(math.cube(num)); + __a = []; __b = list; + for (__c=0; __c<__b.length; __c++) { + num = __b[__c]; + __a.push(math.cube(num)); } - return __c; + return __a; })(); })(); \ No newline at end of file diff --git a/documentation/js/range_comprehensions.js b/documentation/js/range_comprehensions.js index 8631bb6c..9272dcff 100644 --- a/documentation/js/range_comprehensions.js +++ b/documentation/js/range_comprehensions.js @@ -1,21 +1,21 @@ (function(){ var __a, __b, __c, __d, __e, countdown, egg_delivery, num; countdown = (function() { - __b = []; __d = 10; __e = 1; + __a = []; __d = 10; __e = 1; for (__c=0, num=__d; (__d <= __e ? num <= __e : num >= __e); (__d <= __e ? num += 1 : num -= 1), __c++) { - __b.push(num); + __a.push(num); } - return __b; + return __a; })(); egg_delivery = function egg_delivery() { var __f, __g, __h, __i, __j, dozen_eggs, i; - __g = []; __i = 0; __j = eggs.length; + __f = []; __i = 0; __j = eggs.length; for (__h=0, i=__i; (__i <= __j ? i < __j : i > __j); (__i <= __j ? i += 12 : i -= 12), __h++) { - __g.push((function() { + __f.push((function() { dozen_eggs = eggs.slice(i, i + 12); return deliver(new egg_carton(dozen)); })()); } - return __g; + return __f; }; })(); \ No newline at end of file diff --git a/index.html b/index.html index 6060bc0f..43a1b611 100644 --- a/index.html +++ b/index.html @@ -137,12 +137,12 @@ race = function // Array comprehensions: cubed_list = (function() { - __c = []; __a = list; - for (__b=0; __b<__a.length; __b++) { - num = __a[__b]; - __c.push(math.cube(num)); + __a = []; __b = list; + for (__c=0; __c<__b.length; __c++) { + num = __b[__c]; + __a.push(math.cube(num)); } - return __c; + return __a; })();
@@ -707,12 +707,12 @@ backwards("stairway", "to", "heaven");
var __a, __b, __c, __d, __e, __f, __g, food, lunch, roid, roid2;
 // Eat lunch.
 lunch = (function() {
-  __c = []; __a = ['toast', 'cheese', 'wine'];
-  for (__b=0; __b<__a.length; __b++) {
-    food = __a[__b];
-    __c.push(eat(food));
+  __a = []; __b = ['toast', 'cheese', 'wine'];
+  for (__c=0; __c<__b.length; __c++) {
+    food = __b[__c];
+    __a.push(eat(food));
   }
-  return __c;
+  return __a;
 })();
 // Naive collision detection.
 __d = asteroids;
@@ -743,41 +743,41 @@ __d = asteroids;
     deliver(new egg_carton(dozen))
 
var __a, __b, __c, __d, __e, countdown, egg_delivery, num;
 countdown = (function() {
-  __b = []; __d = 10; __e = 1;
+  __a = []; __d = 10; __e = 1;
   for (__c=0, num=__d; (__d <= __e ? num <= __e : num >= __e); (__d <= __e ? num += 1 : num -= 1), __c++) {
-    __b.push(num);
+    __a.push(num);
   }
-  return __b;
+  return __a;
 })();
 egg_delivery = function egg_delivery() {
   var __f, __g, __h, __i, __j, dozen_eggs, i;
-  __g = []; __i = 0; __j = eggs.length;
+  __f = []; __i = 0; __j = eggs.length;
   for (__h=0, i=__i; (__i <= __j ? i < __j : i > __j); (__i <= __j ? i += 12 : i -= 12), __h++) {
-    __g.push((function() {
+    __f.push((function() {
       dozen_eggs = eggs.slice(i, i + 12);
       return deliver(new egg_carton(dozen));
     })());
   }
-  return __g;
+  return __f;
 };
 

@@ -796,14 +796,14 @@ years_old = { tim: 11 }; ages = (function() { - __b = []; __a = years_old; - for (child in __a) { - age = __a[child]; - if (__a.hasOwnProperty(child)) { - __b.push(child + " is " + age); + __a = []; __b = years_old; + for (child in __b) { + age = __b[child]; + if (__b.hasOwnProperty(child)) { + __a.push(child + " is " + age); } } - return __b; + return __a; })();
@@ -932,24 +932,24 @@ six = (one = 1) + (two = 2) + (three = 3);

var __a, __b, globals, name;
 // The first ten global properties.
 globals = ((function() {
-  __b = []; __a = window;
-  for (name in __a) {
-    if (__a.hasOwnProperty(name)) {
-      __b.push(name);
+  __a = []; __b = window;
+  for (name in __b) {
+    if (__b.hasOwnProperty(name)) {
+      __a.push(name);
     }
   }
-  return __b;
+  return __a;
 })()).slice(0, 10);
 

diff --git a/lib/coffee_script/nodes.rb b/lib/coffee_script/nodes.rb index 9fae471f..55d85ae6 100644 --- a/lib/coffee_script/nodes.rb +++ b/lib/coffee_script/nodes.rb @@ -655,9 +655,9 @@ module CoffeeScript name_found = @name && scope.find(@name) index_found = @index && scope.find(@index) body_dent = idt(1) + rvar = scope.free_variable unless top_level svar = scope.free_variable ivar = range ? name : @index ? @index : scope.free_variable - rvar = scope.free_variable unless top_level if range index_var = scope.free_variable source_part = source.compile_variables(o)