3 ms·
How about improving coffeescript language? I tested in on a small project recently and run into lot of ugly edge cases, where I had to read the generated code t
by tomaskafka 15y ago
How about improving coffeescript language? I tested in on a small project recently and run into lot of ugly edge cases, where I had to read the generated code to find out that coffeescript compiled code differently than my expectations were?
example: http://t.co/omIdeNGA http://t.co/omIdeNGA (jQuery chaining)
# I'd expect these two blocks ...
$output
.html 'a'
.prepend renderedHtml
$output
.html ('a')
.prepend renderedHtml
# ... to generate exactly same code as this:
$output
.html('a') # you cannot put whitespace or omit parentheses here - but in other places, you are guided to remove them and use spaces
.prepend renderedHtml
Coffeescript:
$output.html('a'.prepend(renderedHtml));
$output.html('a'.prepend(renderedHtml));
$output.html('a').prepend(renderedHtml);