new Error to Error

This commit is contained in:
the-djmaze 2024-03-04 01:12:40 +01:00
parent 870019d2df
commit 644c8ad389
13 changed files with 44 additions and 44 deletions

View file

@ -2,7 +2,7 @@ var captionPlaceholder = {};
ko.bindingHandlers['options'] = {
'init': element => {
if (!element.matches("SELECT"))
throw new Error("options binding applies only to SELECT elements");
throw Error("options binding applies only to SELECT elements");
// Remove all existing <option>s.
let l = element.length;

View file

@ -1,7 +1,7 @@
ko.bindingHandlers['submit'] = {
'init': (element, valueAccessor, allBindings, viewModel, bindingContext) => {
if (typeof valueAccessor() != "function")
throw new Error("The value for a submit binding must be a function");
throw Error("The value for a submit binding must be a function");
element.addEventListener("submit", event => {
var handlerReturnValue;
var value = valueAccessor();