From a7f03f4aeba3f128b527bfb2fd45a07782cf96f6 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 18 Jan 2013 09:08:34 -0800 Subject: [PATCH] Use __moduleExists from require --- src/stdlib/require.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stdlib/require.coffee b/src/stdlib/require.coffee index 94e7f1b65..14b1a0506 100644 --- a/src/stdlib/require.coffee +++ b/src/stdlib/require.coffee @@ -28,7 +28,7 @@ require = (path, cb) -> parts = file.split '.' ext = parts[parts.length-1] - if __modules[file]? + if __moduleExists file if not __modules.loaded[file.toLowerCase()]? console.warn "Circular require: #{__filename} required #{file}" return __modules[file] @@ -102,7 +102,7 @@ resolve = (name, {verifyExistence}={}) -> null __moduleExists = (path) -> - __modules[path] isnt undefined + __modules[path]? __moduleExpand = (path) -> return path if __moduleExists path