mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Check candidates after ranges
This way builtins are checked for correctly when the range isn’t found
This commit is contained in:
@@ -121,9 +121,6 @@ resolveModulePath = (relativePath, parentModule) ->
|
||||
return if relativePath[0] is '.'
|
||||
return if isAbsolute(relativePath)
|
||||
|
||||
candidates = cache.dependencies[relativePath]
|
||||
return unless candidates?
|
||||
|
||||
folderPath = path.dirname(parentModule.filename)
|
||||
|
||||
range = cache.folders[folderPath]?[relativePath]
|
||||
@@ -133,6 +130,9 @@ resolveModulePath = (relativePath, parentModule) ->
|
||||
else
|
||||
return
|
||||
|
||||
candidates = cache.dependencies[relativePath]
|
||||
return unless candidates?
|
||||
|
||||
for version, resolvedPath of candidates
|
||||
if Module._cache.hasOwnProperty(resolvedPath) or isCorePath(resolvedPath)
|
||||
return resolvedPath if satisfies(version, range)
|
||||
|
||||
Reference in New Issue
Block a user