diff --git a/vendors/knockout/src/tasks.js b/vendors/knockout/src/tasks.js index c267277a2..fd58e194c 100644 --- a/vendors/knockout/src/tasks.js +++ b/vendors/knockout/src/tasks.js @@ -24,7 +24,8 @@ ko.tasks = (() => { if (nextIndexToProcess > mark) { if (++countMarks >= 5000) { nextIndexToProcess = taskQueueLength; // skip all tasks remaining in the queue since any of them could be causing the recursion - ko.utils.deferError(Error("'Too much recursion' after processing " + countMarks + " task groups.")); + setTimeout(() => + throw Error(`'Too much recursion' after processing ${countMarks} task groups.`), 0) break; } mark = taskQueueLength; @@ -32,7 +33,7 @@ ko.tasks = (() => { try { task(); } catch (ex) { - ko.utils.deferError(ex); + setTimeout(() => throw ex, 0); } } } diff --git a/vendors/knockout/src/utils.js b/vendors/knockout/src/utils.js index fdb127389..7c66b3335 100644 --- a/vendors/knockout/src/utils.js +++ b/vendors/knockout/src/utils.js @@ -94,26 +94,10 @@ ko.utils = { domNodeIsAttachedToDocument: node => ko.utils.domNodeIsContainedBy(node, node.ownerDocument.documentElement), - catchFunctionErrors: delegate => { - return ko['onError'] ? function () { - try { - return delegate.apply(this, arguments); - } catch (e) { - ko['onError'] && ko['onError'](e); - throw e; - } - } : delegate; - }, - - setTimeout: (handler, timeout) => setTimeout(ko.utils.catchFunctionErrors(handler), timeout), - - deferError: error => setTimeout(() => { - ko['onError'] && ko['onError'](error); - throw error; - }, 0), + setTimeout: (handler, timeout) => setTimeout(handler, timeout), registerEventHandler: (element, eventType, handler) => - element.addEventListener(eventType, ko.utils.catchFunctionErrors(handler), false), + element.addEventListener(eventType, handler, false), triggerEvent: (element, eventType) => { if (!(element && element.nodeType))