zjquery: Give clear error when handlers are not set.

This commit is contained in:
Steve Howell 2018-03-01 06:43:42 -05:00
parent 5e6649ba87
commit 2d8c1f6d93
1 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,10 @@ exports.make_zjquery = function () {
on_functions.set(event_name, arg);
} else {
var handler = on_functions.get(event_name);
assert(handler);
if (!handler) {
var error = 'Cannot find ' + event_name + ' handler for ' + selector;
throw Error(error);
}
handler(arg);
}
}