Skip to content
This repository

Fix to make Backbone.sync options parameter optional again #1052

Merged
merged 1 commit into from about 2 years ago

2 participants

Oliver Cannings Jeremy Ashkenas
Oliver Cannings

Added a default value for the options parameter in the Backbone.sync function to bring it in line with the documentation.

Jeremy Ashkenas jashkenas merged commit a91b325 into from February 27, 2012
Jeremy Ashkenas jashkenas closed this February 27, 2012
brad dunbar braddunbar referenced this pull request from a commit February 27, 2012
brad dunbar Add a test for #1052. 111d5a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Feb 27, 2012
Oliver Cannings Made Backbone.sync options parameter optional daea564
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  backbone.js
3  backbone.js
@@ -1246,6 +1246,9 @@
1246 1246
   Backbone.sync = function(method, model, options) {
1247 1247
     var type = methodMap[method];
1248 1248
 
  1249
+    // Default options to an empty object.
  1250
+    options = options || {};
  1251
+
1249 1252
     // Default JSON-request options.
1250 1253
     var params = {type: type, dataType: 'json'};
1251 1254
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.