Skip to content
Snippets Groups Projects
Commit 9882c882 authored by Xavier Morel's avatar Xavier Morel
Browse files

[IMP] web: improve Widget.proxy's error reporting

Provide a more informative error message than "undefined is not a
function" when a method passed by name to the events object is missing
on the widget.
parent 330bf5ec
No related branches found
No related tags found
No related merge requests found
......@@ -392,6 +392,9 @@ var Widget = core.Class.extend(mixins.PropertiesMixin, {
var self = this;
return function () {
var fn = (typeof method === 'string') ? self[method] : method;
if (fn === void 0) {
throw new Error("Couldn't find method '" + method + "' in widget " + self);
}
return fn.apply(self, arguments);
};
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment