debt - more promise cleanup

This commit is contained in:
Johannes Rieken 2019-02-08 15:19:17 +01:00
parent a404c91e22
commit 70e48eeb52
5 changed files with 386 additions and 392 deletions

View file

@ -60,7 +60,7 @@ monaco.editor.create(document.getElementById("container"), {
function xhr(url) {
var req = null;
return new monaco.Promise(function(c,e,p) {
return new Promise(function(c,e) {
req = new XMLHttpRequest();
req.onreadystatechange = function () {
if (req._canceled) { return; }
@ -72,8 +72,6 @@ function xhr(url) {
e(req);
}
req.onreadystatechange = function () { };
} else {
p(req);
}
};
@ -92,4 +90,4 @@ function xhr(url) {
});
</script>
</body>
</html>
</html>