       requiredAs = './' + (path.resolve requiredAs).replace basePath, ''
 
     # use cached resolution if possible
-    return cached if (cached = cache[resolveFrom+requiredAs])?
+    return cached if (cached = cache resolveFrom, requiredAs)?
 
     # resolve absolute path to module
     if builtins[requiredAs]?

    null

module.exports = ->
  cache = {}

  (requiredAs, opts = {}) ->
    # asked to cache lookup in advance
    if opts.cache?
      cache[opts.resolveFrom+requiredAs] = opts
      return

    paths = NODE_PATHS.concat opts.paths ? []

    unless /^node_modules/.test normalizedPath
      requireAs = './' + requireAs

    cache resolveFrom, requiredAs,
      absolutePath:   absolutePath
      basePath:       basePath
      extension:      extension
