mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
new Error to Error
This commit is contained in:
parent
870019d2df
commit
644c8ad389
13 changed files with 44 additions and 44 deletions
|
|
@ -19,7 +19,7 @@ ko.dependencyDetection = {
|
|||
registerDependency: subscribable => {
|
||||
if (currentFrame) {
|
||||
if (!ko.isSubscribable(subscribable))
|
||||
throw new Error("Only subscribable things can act as dependencies");
|
||||
throw Error("Only subscribable things can act as dependencies");
|
||||
currentFrame.callback.call(currentFrame.callbackTarget, subscribable,
|
||||
subscribable._id || (subscribable._id = ++lastId));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ ko.computed = (evaluatorFunctionOrOptions, options) => {
|
|||
function computedObservable() {
|
||||
if (arguments.length > 0) {
|
||||
if (typeof writeFunction !== "function") {
|
||||
throw new Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
|
||||
throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
|
||||
}
|
||||
// Writing a value
|
||||
writeFunction(...arguments);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ ko['observableArray'] = initialValues => {
|
|||
initialValues = initialValues || [];
|
||||
|
||||
if (!Array.isArray(initialValues))
|
||||
throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
|
||||
throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
|
||||
|
||||
return Object.setPrototypeOf(ko.observable(initialValues), ko['observableArray']['fn']).extend({'trackArrayChanges':true});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue