The sync() method gets a reference to the Deferred function in two different places. First, it gets it from Backbone.$.Deferred; and then a few lines later, it gets it from $.Deferred.
The latter isn't ideal, because a global "$" object may not be present (in an AMD, node, etc environment), whereas if jQuery is present, then Backbone will make it available as Backbone.$. Earlier versions of this library used the following test, which handles this case better:
The sync() method gets a reference to the Deferred function in two different places. First, it gets it from Backbone.$.Deferred; and then a few lines later, it gets it from $.Deferred.
The latter isn't ideal, because a global "$" object may not be present (in an AMD, node, etc environment), whereas if jQuery is present, then Backbone will make it available as Backbone.$. Earlier versions of this library used the following test, which handles this case better:
Also, since there is now no test for the presence of Backbone.$.Deferred before calling it, there is a new dependency on $.Deferred, where it was optional prior to this changeset.