Warn about legacy function calls using too many arguments

This commit is contained in:
Nathan Gray 2014-09-08 23:01:55 +00:00
parent 1b0cefe5f2
commit 4e6c5c3a1f
2 changed files with 8 additions and 4 deletions

View File

@ -143,6 +143,10 @@
// Dump the executed code for debugging // Dump the executed code for debugging
egw.debug('log', 'Executing legacy JS code: ', _code); egw.debug('log', 'Executing legacy JS code: ', _code);
if(arguments && arguments.length > 2)
{
egw.debug('warn', 'Legacy JS code only supports 2 arguments (event and widget)', _code, arguments);
}
// Return the result of the called function // Return the result of the called function
return func.call(context, ev, _widget); return func.call(context, ev, _widget);
}; };