mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 18:32:56 +01:00
Fix 'Hover Provider Example' incorrect Promise syntax
This commit is contained in:
parent
2f556e3f9d
commit
0b9f3c15d2
1 changed files with 25 additions and 28 deletions
|
|
@ -31,8 +31,7 @@ monaco.editor.create(document.getElementById("container"), {
|
|||
|
||||
function xhr(url) {
|
||||
var req = null;
|
||||
return new Promise(
|
||||
function (c, e) {
|
||||
return new Promise(function (c, e) {
|
||||
req = new XMLHttpRequest();
|
||||
req.onreadystatechange = function () {
|
||||
if (req._canceled) {
|
||||
|
|
@ -56,10 +55,8 @@ function xhr(url) {
|
|||
req.responseType = "";
|
||||
|
||||
req.send(null);
|
||||
},
|
||||
function () {
|
||||
}).catch(function () {
|
||||
req._canceled = true;
|
||||
req.abort();
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue