mirror of
https://github.com/atom/atom.git
synced 2026-02-13 08:04:56 -05:00
Use __moduleExists from require
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user