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

Merge pull request #1888 from joliss/fat-arrow-doc

Document fat arrow in class definitions.
This commit is contained in:
Jeremy Ashkenas 2011-11-23 09:18:00 -08:00
commit b9c17cab3c

View file

@ -780,10 +780,15 @@ Expressions
</p>
<%= code_for('fat_arrow') %>
<p>
If we had used <tt>-></tt> in the callback above, <tt>@customer</tt> would
If we had used <tt>-&gt;</tt> in the callback above, <tt>@customer</tt> would
have referred to the undefined "customer" property of the DOM element,
and trying to call <tt>purchase()</tt> on it would have raised an exception.
</p>
<p>
When used in a class definition, methods declared with the fat arrow will
be automatically bound to each instance of the class when the instance is
constructed.
</p>
<p>
<span id="embedded" class="bookmark"></span>