Other than the unnecessary assignment to `child`, doesn't look that
bad to me... How would you improve it?
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com

On Nov 30, 6:38 am, Victor <[email protected]> wrote:
> Also CoffeeScript sometimes generates very ugly code. Example:
>
> CoffeeScript:
> SelectParser.select_to_array = (select) ->
>   parser = new SelectParser()
>   parser.add_node( child ) for child in select.childNodes
>   parser.parsed
>
> Generated JavaScript:
>   SelectParser.select_to_array = function(select) {
>     var child, parser, _i, _len, _ref;
>     parser = new SelectParser();
>     _ref = select.childNodes;
>     for (_i = 0, _len = _ref.length; _i < _len; _i++) {
>       child = _ref[_i];
>       parser.add_node(child);
>     }
>     return parser.parsed;
>   };

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to