From b0aea54544fa40d790d006049abb9d06849d215e Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 9 Oct 2014 11:08:45 -0700 Subject: [PATCH] Check cache before atom require short-circuit --- src/module-cache.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/module-cache.coffee b/src/module-cache.coffee index 1976626d9..dd5a79939 100644 --- a/src/module-cache.coffee +++ b/src/module-cache.coffee @@ -102,8 +102,6 @@ resolveFilePath = (relativePath, parentModule) -> return resolveModulePath = (relativePath, parentModule) -> - return cache.atomExportsPath if relativePath is 'atom' - return unless relativePath return unless parentModule?.id @@ -115,7 +113,11 @@ resolveModulePath = (relativePath, parentModule) -> folderPath = path.dirname(parentModule.id) range = cache.folders[folderPath]?[relativePath] - return unless range? + unless range? + if relativePath is 'atom' + return cache.atomExportsPath + else + return candidates = cache.dependencies[relativePath] return unless candidates?