 # if location.hostname is "localhost"
 # window.onerror = (desc,page,line,chr)=> alert "Line: #{line}, desc: #{desc}, chr:#{chr}, page:#{page}"
 
-Function::bind or= do ->  
+Function::bind or= do ->
   {slice} = []
   (context)->
     func = @

        duration : 3000
    else
      callback?()
  
  socketConnected:()->
    @backendIsConnected = yes
    @propagateEvent "KDBackendConnectedEvent"
  
  setApplicationPartials:(partials)->
    @appPartials = partials


    # warn "Instance being overwritten!!", anInstance if @instances[anInstance.id]
    @instances[anInstance.id] = anInstance
    @classes[anInstance.constructor.name] ?= anInstance.constructor

  unregisterInstance: (anInstanceId)->
    # warn "Instance being unregistered doesn't exist in registry!!", anInstance unless @instances[anInstance.id]
    delete @instances[anInstanceId]

  deleteInstance:(anInstanceId)->
    @unregisterInstance anInstanceId
    # anInstance = null #FIXME: Redundant? See unregisterInstance

  registerSingleton:(singletonName,object,override = no)->
    if (existingSingleton = KD.singletons[singletonName])?
      if override
