diff --git a/.jshintrc b/.jshintrc index a8d17196e..bc41ce0af 100644 --- a/.jshintrc +++ b/.jshintrc @@ -49,6 +49,7 @@ "notEqual", "require", "requirejs", + "hasModule", "Blob", "File"], "node" : false, diff --git a/vendor/assets/javascripts/loader.js b/vendor/assets/javascripts/loader.js index eaee097c7..b05ae92b2 100644 --- a/vendor/assets/javascripts/loader.js +++ b/vendor/assets/javascripts/loader.js @@ -1,4 +1,4 @@ -var define, requireModule, require, requirejs; +var define, requireModule, require, requirejs, hasModule; (function() { var registry = {}, seen = {}, state = {}; @@ -32,6 +32,10 @@ var define, requireModule, require, requirejs; }; } + hasModule = function(name){ + return !!registry[name]; + }; + requirejs = require = requireModule = function(name) { if (state[name] !== FAILED && seen.hasOwnProperty(name)) {