Bug 1478267 - Drop the callback parameter to getShortcutOrURIAndPostData r=standard8

This commit is contained in:
Siddhant 2018-08-01 15:00:51 +05:30
parent 97855cd84d
commit 76afa8409f

View file

@ -2417,14 +2417,7 @@ function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
* @resolves { url, postData, mayInheritPrincipal }. If it's not possible
* to discern a keyword or an alias, url will be the input string.
*/
function getShortcutOrURIAndPostData(url, callback = null) {
if (callback) {
Deprecated.warning("Please use the Promise returned by " +
"getShortcutOrURIAndPostData() instead of passing a " +
"callback",
"https://bugzilla.mozilla.org/show_bug.cgi?id=1100294");
}
return (async function() {
async function getShortcutOrURIAndPostData(url) {
let mayInheritPrincipal = false;
let postData = null;
// Split on the first whitespace.
@ -2472,12 +2465,6 @@ function getShortcutOrURIAndPostData(url, callback = null) {
}
return { url, postData, mayInheritPrincipal };
})().then(data => {
if (callback) {
callback(data);
}
return data;
});
}
function getPostDataStream(aPostDataString,