mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
We don't use ko.onError so remove it
This commit is contained in:
parent
07443407e9
commit
8babd10f69
2 changed files with 5 additions and 20 deletions
5
vendors/knockout/src/tasks.js
vendored
5
vendors/knockout/src/tasks.js
vendored
|
|
@ -24,7 +24,8 @@ ko.tasks = (() => {
|
||||||
if (nextIndexToProcess > mark) {
|
if (nextIndexToProcess > mark) {
|
||||||
if (++countMarks >= 5000) {
|
if (++countMarks >= 5000) {
|
||||||
nextIndexToProcess = taskQueueLength; // skip all tasks remaining in the queue since any of them could be causing the recursion
|
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;
|
break;
|
||||||
}
|
}
|
||||||
mark = taskQueueLength;
|
mark = taskQueueLength;
|
||||||
|
|
@ -32,7 +33,7 @@ ko.tasks = (() => {
|
||||||
try {
|
try {
|
||||||
task();
|
task();
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
ko.utils.deferError(ex);
|
setTimeout(() => throw ex, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
vendors/knockout/src/utils.js
vendored
20
vendors/knockout/src/utils.js
vendored
|
|
@ -94,26 +94,10 @@ ko.utils = {
|
||||||
|
|
||||||
domNodeIsAttachedToDocument: node => ko.utils.domNodeIsContainedBy(node, node.ownerDocument.documentElement),
|
domNodeIsAttachedToDocument: node => ko.utils.domNodeIsContainedBy(node, node.ownerDocument.documentElement),
|
||||||
|
|
||||||
catchFunctionErrors: delegate => {
|
setTimeout: (handler, timeout) => setTimeout(handler, timeout),
|
||||||
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),
|
|
||||||
|
|
||||||
registerEventHandler: (element, eventType, handler) =>
|
registerEventHandler: (element, eventType, handler) =>
|
||||||
element.addEventListener(eventType, ko.utils.catchFunctionErrors(handler), false),
|
element.addEventListener(eventType, handler, false),
|
||||||
|
|
||||||
triggerEvent: (element, eventType) => {
|
triggerEvent: (element, eventType) => {
|
||||||
if (!(element && element.nodeType))
|
if (!(element && element.nodeType))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue