   # Returns `true` if case sensitive, `false` otherwise.
   isCaseSensitive: -> not fsPlus.isCaseInsensitive()
 
-statSyncNoException = (args...) ->
-  if fs.statSyncNoException
-    fs.statSyncNoException(args...)
-  else
-    try
-      fs.statSync(args...)
-    catch error
-      false
-
-lstatSyncNoException = (args...) ->
-  if fs.lstatSyncNoException
-    fs.lstatSyncNoException(args...)
-  else
-    try
-      fs.lstatSync(args...)
-    catch error
-      false
+{statSyncNoException, lstatSyncNoException} = fs
+statSyncNoException ?= (args...) ->
+  try
+    fs.statSync(args...)
+  catch error
+    false
+
+lstatSyncNoException ?= (args...) ->
+  try
+    fs.lstatSync(args...)
+  catch error
+    false
 
 BINARY_EXTENSIONS =
   '.ds_store': true

  # Public: Like {.resolve} but uses node's modules paths as the load paths to
  # search.
  resolveOnLoadPath: (args...) ->
    modulePaths = null
    if module.paths?
      modulePaths = module.paths
    else if process.resourcesPath
      modulePaths = [path.join(process.resourcesPath, 'app', 'node_modules')]
    else
      modulePaths = []

    loadPaths = Module.globalPaths.concat(modulePaths)
    fsPlus.resolve(loadPaths..., args...)

  # Public: Finds the first file in the given path which matches the extension

#
# [fs]: http://nodejs.org/api/fs.html
fsPlus =
  getHomeDirectory: ->
    if process.platform is 'win32'
      process.env.USERPROFILE
