diff options
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 9 | 
1 files changed, 7 insertions, 2 deletions
| diff --git a/src/Angular.js b/src/Angular.js index 2d4b1671..05b9989e 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -1077,10 +1077,15 @@ function bindJQuery(){  /**   * throw error of the argument is falsy.   */ -function assertArg(arg, name) { +function assertArg(arg, name, reason) {    if (!arg) { -    var error = new Error("Argument '" + name + "' is required"); +    var error = new Error("Argument '" + (name||'?') + "' is " + +        (reason || "required"));      if (window.console) window.console.log(error.stack);      throw error;    }  }; + +function assertArgFn(arg, name) { +  assertArg(isFunction(arg, name, 'not a function')); +}; | 
