[Pkg-javascript-commits] [backbone] 41/211: Taking some of dvv's suggestions.

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:00 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.5.0
in repository backbone.

commit a0ace0d9d6a7b5c0221322c6198d0d3dd13d4fbf
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Tue Dec 21 12:15:56 2010 -0500

    Taking some of dvv's suggestions.
---
 backbone.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/backbone.js b/backbone.js
index 01801e1..797dac1 100644
--- a/backbone.js
+++ b/backbone.js
@@ -946,7 +946,7 @@
 
     // Default JSON-request options.
     var params = _.extend({
-      url:          getUrl(model) || urlError(),
+      url:          getUrl(model),
       type:         type,
       contentType:  'application/json',
       data:         modelJSON,
@@ -954,11 +954,14 @@
       processData:  false
     }, options);
 
+    // Ensure that we have a URL.
+    if (!params.url) urlError();
+
     // For older servers, emulate JSON by encoding the request into an HTML-form.
     if (Backbone.emulateJSON) {
       params.contentType = 'application/x-www-form-urlencoded';
       params.processData = true;
-      params.data        = modelJSON ? {model : modelJSON} : {};
+      params.data        = params.data ? {model : params.data} : {};
     }
 
     // For older servers, emulate HTTP by mimicking the HTTP method with `_method`

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git



More information about the Pkg-javascript-commits mailing list