-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle multiple values for a GET parameter as p=1&p=2 instead of p=1,2 #12
base: master
Are you sure you want to change the base?
Conversation
@@ -11,6 +11,13 @@ | |||
} else if (typeof exports === 'object') { module.exports = factory(); | |||
} else { Backbone.ajax = factory(); } | |||
}(function() { | |||
|
|||
if (!Array.isArray) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be polyfilling this. We can add a note to the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted to a local function. Do you still prefer adding note to docs over an extra couple lines of code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please remove the function entirely. IE9 has been EOL'd, and it's trivial to add in a polyfill. Most code these days is targeting ES5+ (including this project, with it's reliance on bind
), no need for the extra bloat.
This would be fine with me, but I'm wondering if we should expose the There are many ways to skin this particular cat ( |
Are |
If CommonJS environment detected, assume a module 'xmlhttprequest' is defined that exports an object satisfying the XMLHttpRequest interface.
if (typeof define === 'function' && define.amd) { | ||
define(factory.bind(this, this.XMLHttpRequest)); | ||
} else if (typeof exports === 'object') { | ||
module.exports = factory(require('xmlhttprequest').XMLHttpRequest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary now. If it's only for testing, let's do that in the tests file.
I almost would rather have the dev write their own stringify logic if doing something custom. It's not super hard, should be as simple as: import ajax from 'backbone.ajax';
import { stringify } from querystring;
Backbone.ajax = function(options) {
return ajax(_.extend(options, {url: options.url + stringify(options.data)}));
}; |
Whoops, sorry, the later xmlhttprequest changes were not intended to be PR'd/automatically added to this PR. I'll close and resubmit if you're still interested. |
No need to close, just amend your pull request by rebasing against master and force-pushing to this branch. |
I changed the Sinon dependency URL because npm had a problem installing the git one, not sure if that's an issue with my configuration or not.