From 859935585a1ce7233fc3585b81c0053e2d1a6ecf Mon Sep 17 00:00:00 2001 From: Paul Shapiro Date: Wed, 31 Oct 2018 14:46:38 -0500 Subject: [PATCH] minor comment, and catching undefined reject in monero_utils --- monero_utils/MyMoneroCoreBridge.js | 9 +++++---- monero_utils/monero_utils.js | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/monero_utils/MyMoneroCoreBridge.js b/monero_utils/MyMoneroCoreBridge.js index 45a2001..e5ac791 100644 --- a/monero_utils/MyMoneroCoreBridge.js +++ b/monero_utils/MyMoneroCoreBridge.js @@ -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 { diff --git a/monero_utils/monero_utils.js b/monero_utils/monero_utils.js index adeb61a..25a58a0 100644 --- a/monero_utils/monero_utils.js +++ b/monero_utils/monero_utils.js @@ -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); }