mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
debt - more promise cleanup
This commit is contained in:
parent
a404c91e22
commit
70e48eeb52
5 changed files with 386 additions and 392 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue