зеркало из https://github.com/mozilla/snowl.git
make Request module do synchronous requests by default since XMLHttpRequest processes the event queue nowadays during synchronous requests, so all our requests will be synchronous (otherwise we would have used Sync.js to make them synchronous anyway)
--HG-- extra : rebase_source : 2db75bf16f935ad8610145939ffaedfab184dfc8
This commit is contained in:
Родитель
f8dc926cad
Коммит
c7b7f9092b
|
@ -76,8 +76,24 @@ function Request(args) {
|
|||
|
||||
Request.prototype = {
|
||||
method: "GET",
|
||||
async: true,
|
||||
body: null
|
||||
async: false,
|
||||
body: null,
|
||||
|
||||
get status() this._request.status,
|
||||
|
||||
// Sometimes getting statusText throws. When it does, we return the exception
|
||||
// instead, which seems more useful.
|
||||
get statusText() {
|
||||
try {
|
||||
return this._request.statusText;
|
||||
}
|
||||
catch(ex) {
|
||||
return ex;
|
||||
}
|
||||
},
|
||||
|
||||
get responseText() this._request.responseText,
|
||||
get channel() this._request.channel
|
||||
};
|
||||
|
||||
function Callback(func, thisObject) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче