From 6d41492fd7a05d7015fcfac8732811497e4eecfd Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 2 Sep 2011 18:08:37 -0700 Subject: [PATCH] it's important to test your code, corey --- src/require.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/require.coffee b/src/require.coffee index bd5bad3f5..9bb6c041e 100644 --- a/src/require.coffee +++ b/src/require.coffee @@ -31,9 +31,9 @@ defines = [] # cb - The Function that will actually run the code. define = (args...) -> defines.push -> - file = args[0] + file = args[0] if args.length > 1 cb = args[1] or args[0] - exports = if file then __modules[file] else {} + exports = if file? then __modules[file] else {} module = exports: exports cb.call exports, require, exports, module module.exports or exports