Merge pull request #3583 from madcodelife/main

Fix 'Hover Provider Example' incorrect Promise syntax
pull/3315/head^2
Henning Dieterichs 2 years ago committed by GitHub
commit 3b800d8192
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -31,8 +31,7 @@ monaco.editor.create(document.getElementById("container"), {
function xhr(url) { function xhr(url) {
var req = null; var req = null;
return new Promise( return new Promise(function (c, e) {
function (c, e) {
req = new XMLHttpRequest(); req = new XMLHttpRequest();
req.onreadystatechange = function () { req.onreadystatechange = function () {
if (req._canceled) { if (req._canceled) {
@ -56,10 +55,8 @@ function xhr(url) {
req.responseType = ""; req.responseType = "";
req.send(null); req.send(null);
}, }).catch(function () {
function () {
req._canceled = true; req._canceled = true;
req.abort(); req.abort();
} });
);
} }

Loading…
Cancel
Save