remove unnecessary global uncaught promise handler

- monaco issue https://github.com/microsoft/monaco-editor/issues/2382
This commit is contained in:
Steve-Mcl 2021-06-24 11:27:24 +01:00
parent 7f30748a41
commit db90e1f801
1 changed files with 0 additions and 13 deletions

View File

@ -150,19 +150,6 @@ RED.editor.codeEditor.monaco = (function() {
function init(options) {
//Handles "Uncaught (in promise) Canceled: Canceled"
//@see https://github.com/microsoft/monaco-editor/issues/2382
//This is fixed in commit microsoft/vscode@49cad9a however it is not yet present monaco-editor
//Remove the below addEventListener once monaco-editor V0.23.1 or greater is published
window.addEventListener('unhandledrejection', function(evt) {
if(evt && evt.reason && evt.reason.stack) {
if (evt.reason.name === 'Canceled' && evt.reason.stack.indexOf('vendor/monaco/dist') >= 0) {
evt.preventDefault();
evt.stopImmediatePropagation();
}
}
});
//Handles orphaned models
//ensure loaded models that are not explicitly destroyed by a call to .destroy() are disposed
RED.events.on("editor:close",function() {