Skip to content

Commit

Permalink
Tweaking 'this' FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Nov 6, 2013
1 parent 00d2782 commit ae33e34
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3952,19 +3952,10 @@ <h2 id="faq">F.A.Q.</h2>
<a href="#Events-on">object.on</a>, to name a few).
<a href="#View-delegateEvents">View events</a> are automatically bound to
the view's context for you.
<p>

<p>
You may also find it helpful to use
<a href="http://underscorejs.org/#bind">_.bind</a> and
<a href="http://underscorejs.org/#bindAll">_.bindAll</a>
from Underscore.js. Be aware, however, that due to an imperfect shim in older
browsers, the bound function's <em>arity</em> (that is, its <tt>length</tt>
property) is not preserved when a native <tt>bind</tt> is not present.
This is known to cause problems with <tt>constructor</tt> and collection
<a href="#Collection-comparator"><tt>comparator</tt></a>
functions bound from within the object instance and this pattern is
highly discouraged for this reason.
from Underscore.js.
</p>

<pre>
Expand Down

2 comments on commit ae33e34

@akre54
Copy link
Collaborator

@akre54 akre54 commented on ae33e34 Nov 6, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasnt the whole point of the pull these lines? Should the documentation punt to underscore's for this?

@jashkenas
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dug your changes to point to listenTo and explain how delegated events are already bound. Now that Underscore doesn't allow automatic bindAll of every function on the prototype ... bound comparators shouldn't be much of a problem anymore.

Please sign in to comment.