 windowAdditions =
   editor: null
 
-  extensions: []
+  extensions: {}
 
   appRoot: OSX.NSBundle.mainBundle.resourcePath
 

      Event.trigger 'window:open', path

  close: (path) ->
    extension.shutdown() for extension in @extensions

    atomController.close
    Event.trigger 'window:close', path

    "window:" + @path

  loadExtensions: ->
    extension.shutdown() for name, extension of @extensions
    @extensions = {}

    extensionPaths = fs.list require.resourcePath + "/extensions"
    for extensionPath in extensionPaths when fs.isDirectory extensionPath
      try
        extension = require extensionPath
        @extensions[extension.name] = new extension
      catch error
        console.warn "window: Loading Extension '#{fs.base extensionPath}' failed."
        console.warn error

    # After all the extensions are created, start them up.
    for name, extension of @extensions
      try
        extension.startup()
      catch error
