   unless file = resolve(path)
     throw new Error("Require can't find file at path '#{path}'")
 
-  parts = file.split '.'
-  ext   = parts[parts.length-1]
+  ext = file.split('.').pop()
 
   if __moduleExists file
     if not __modules.loaded[file.toLowerCase()]?


getPath = (path) ->
  path = resolve(path)
  parts = path.split '.'
  return path unless parts[parts.length - 1] is 'coffee'

  cacheFilePath = getCacheFilePath(path)
  unless __exists(cacheFilePath)

  verifyExistence ?= true
  file = name
  if /!/.test file
    file = file.split('!').pop()

  if file[0..1] is './'
    prefix = window.__filename.split('/')[0..-2].join '/'
