Fix m.request/m.jsonp to not mutate arguments, simplify code (#2288)

I basically recast it to remove 99% of the duplication. They're
basically the same function mod how they fire their requests and append
query parameters.
This commit is contained in:
Isiah Meadows 2018-11-28 20:10:46 -05:00 committed by GitHub
parent eee2c1b032
commit 7cbc15e7a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 97 additions and 111 deletions

View file

@ -11,7 +11,9 @@ module.exports = function() {
return {status: 500, responseText: "server error, most likely the URL was not defined " + url}
}
function FormData() {}
var $window = {
FormData: FormData,
XMLHttpRequest: function XMLHttpRequest() {
var args = {}
var headers = {}