Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Fixed optional util
Browse files Browse the repository at this point in the history
  • Loading branch information
jollytoad committed May 16, 2011
1 parent dcad269 commit 6825a37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/resources/modules/common/optional.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
* @public
*/

/*global require */
/*global require, exports */

function optional(name, callback) {
var module = require(name);
var module;
try {
module = require(name);
} catch(e) {}
if (module && callback) {
callback(module);
}
Expand Down

0 comments on commit 6825a37

Please sign in to comment.