Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Throw an error if Module is instantiated with undefined inputs.

  • Loading branch information...
commit 8a6f19fb467b5b4f92b60b03b6cb107d38feaaaf 1 parent 5c49c61
@jcoglan authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 source/core/module.js
View
5 source/core/module.js
@@ -3,6 +3,11 @@ JS.Module.__queue__ = [];
JS.extend(JS.Module.prototype, {
initialize: function(name, methods, options) {
+ for (var i = 0, n = arguments.length; i < n; i++) {
+ if (arguments[i] === undefined)
+ throw new Error('Module instantiated with undefined argument');
+ }
+
if (typeof name !== 'string') {
options = arguments[1];
methods = arguments[0];
Please sign in to comment.
Something went wrong with that request. Please try again.