minor comment, and catching undefined reject in monero_utils

pull/66/head
Paul Shapiro 6 years ago
parent 18b281e134
commit 859935585a

@ -712,10 +712,11 @@ module.exports = function(options)
};
} else if (ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER) {
read_fn = function(url)
{
var xhr = new XMLHttpRequest;
xhr.open("GET", url, false);
xhr.send(null);
{ // it's an option to move this over to fetch, but, fetch requires a polyfill for these older browsers anyway - making fetch an automatic dep just for asmjs fallback - probably not worth it yet - but it would be if fetch were to become a dep for another reason, such as a networked SendFunds() implementation
var xhr = new XMLHttpRequest()
xhr.open("GET", url, false)
xhr.send(null)
//
return xhr.responseText
};
} else {

@ -123,7 +123,11 @@ const moneroUtils_promise = new Promise(function(resolve, reject)
{
console.error("Error: ", e);
// this may be insufficient… being able to throw would be nice
reject(e);
if (reject) {
reject(e)
} else {
throw "Promise passed no reject function to monero_utils load fn"
}
});
coreBridgeLoading_promise.then(_didLoad);
}

Loading…
Cancel
Save