Fix indentation to make compiled JS more readable

This commit is contained in:
Kaleb Davis 2015-10-06 21:31:07 -04:00
parent 6ac7368b3b
commit 7afadb0181

View File

@ -54,19 +54,19 @@ math =
square: square
cube: (x) -> x * square x
#=> var math = {
# "root": Math.sqrt,
# "square": square,
# "cube": function(x) { return x * square(x); }
#}
# "root": Math.sqrt,
# "square": square,
# "cube": function(x) { return x * square(x); }
# };
# Splats:
race = (winner, runners...) ->
print winner, runners
#=>race = function() {
# var runners, winner;
# winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
# return print(winner, runners);
#};
# var runners, winner;
# winner = arguments[0], runners = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
# return print(winner, runners);
# };
# Existence:
alert "I knew it!" if elvis?
@ -75,14 +75,14 @@ alert "I knew it!" if elvis?
# Array comprehensions:
cubes = (math.cube num for num in list)
#=>cubes = (function() {
# var _i, _len, _results;
# _results = [];
# var _i, _len, _results;
# _results = [];
# for (_i = 0, _len = list.length; _i < _len; _i++) {
# num = list[_i];
# _results.push(math.cube(num));
# }
# return _results;
# })();
# num = list[_i];
# _results.push(math.cube(num));
# }
# return _results;
# })();
foods = ['broccoli', 'spinach', 'chocolate']
eat food for food in foods when food isnt 'chocolate'