1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

removing object comprehensions from CoffeeScript, they were necessitating the generation of too much ugly JS

This commit is contained in:
Jeremy Ashkenas 2010-01-10 14:45:44 -05:00
parent 8ea75290b5
commit 13fc8aea04
14 changed files with 128 additions and 211 deletions

View file

@ -1,5 +1,5 @@
(function(){
var __a, __b, __c, __d, cubed_list, list, math, num, number, opposite_day, race, square;
var __a, __b, __c, cubed_list, list, math, number, opposite_day, race, square;
// Assignment:
number = 42;
opposite_day = true;
@ -33,14 +33,10 @@
}
// Array comprehensions:
cubed_list = (function() {
__a = list;
__c = [];
for (__b in __a) {
if (__a.hasOwnProperty(__b)) {
num = __a[__b];
__d = math.cube(num);
__c.push(__d);
}
__c = []; __a = list;
for (__b=0; __b<__a.length; __b++) {
num = __a[__b];
__c.push(math.cube(num));
}
return __c;
})();