[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.
This commit is contained in:
@@ -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);
|
||||
};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user