commit 32a46044817b5639330076fb4083202ddcfd6d08
parent 9c0dc327e02693adf4c54f22a9073b367d1989ef
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 22 Mar 2015 02:42:21 -0400
Rename Zotero.HTTP.promise() to Zotero.HTTP.request()
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js
@@ -46,9 +46,14 @@ Zotero.HTTP = new function() {
return this.message;
};
+ this.promise = function () {
+ Zotero.debug("Zotero.HTTP.promise() is deprecated -- use Zotero.HTTP.request()", 2);
+ return this.request.apply(this, arguments);
+ }
+
/**
* Get a promise for a HTTP request
- *
+ *
* @param {String} method The method of the request ("GET", "POST", "HEAD", or "OPTIONS")
* @param {nsIURI|String} url URL to request
* @param {Object} [options] Options for HTTP request:<ul>
@@ -69,7 +74,7 @@ Zotero.HTTP = new function() {
* succeeds, or rejected if the browser is offline or a non-2XX status response
* code is received (or a code not in options.successCodes if provided).
*/
- this.promise = function promise(method, url, options) {
+ this.request = function (method, url, options) {
if (url instanceof Components.interfaces.nsIURI) {
// Don't display password in console
var dispURL = this.getDisplayURI(url).spec;