Commit b8730576 authored by Jérome Perrin's avatar Jérome Perrin

Revert "monaco_editor: abort pending checkPythonSourceCode requests"

This reverts commit 93d60201.
parent a1b8ee7d
......@@ -107,22 +107,6 @@ $script.onload = function() {
}
var timeout = null;
// minimal pollyfil for AbortController
if (self.AbortController === undefined) {
class AbortController {
constructor() {
this.signal = { aborted: false };
}
abort() {
this.signal.aborted = true;
}
}
console.log("AbortController not available");
self.AbortController = AbortController;
}
var controller = new AbortController();
function checkPythonSourceCode() {
const data = new FormData();
const checker_parameters = {
......@@ -139,8 +123,7 @@ $script.onload = function() {
data.append("data", JSON.stringify(checker_parameters));
fetch(portal_url + "/ERP5Site_checkPythonSourceCodeAsJSON", {
method: "POST",
body: data,
signal: controller.signal
body: data
})
.then(response => response.json())
.then(data => {
......@@ -162,12 +145,7 @@ $script.onload = function() {
})
);
timeout = null;
}, e => {
if (!e instanceof DOMException /* AbortError */ ) {
throw e;
}
/* ignore aborted requests */
});
});
}
editor.model.onDidChangeContent(event => {
......@@ -175,8 +153,6 @@ $script.onload = function() {
changed = true; /* global variable used in erp5.js for onbeforeunload event */
if (mode == "python") {
// debounced `checkPythonSourceCode`
controller.abort();
controller = new AbortController();
if (timeout) {
clearTimeout(timeout);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment