     mediator.unsubscribe null, null, this
 
   publishEvent: (type, args...) ->
+    if typeof type isnt 'string'
+      throw new TypeError 'EventBroker#publishEvent: ' +
+        'type argument must be a string'
+
     # Publish global handler.
     mediator.publish type, args...
 

    mediator.subscribeOnce type, handler, this

  unsubscribeEvent: (type, handler) ->
    # Remove global handler.
    mediator.unsubscribe type, handler


    mediator.subscribe type, handler, this

  subscribeEventOnce: (type, handler) ->
    if typeof type isnt 'string'
      throw new TypeError 'EventBroker#subscribeEventOnce: ' +
        'type argument must be a string'
    if typeof handler isnt 'function'
      throw new TypeError 'EventBroker#subscribeEventOnce: ' +
        'handler argument must be a function'

    # Ensure that a handler isn’t registered twice.
    mediator.unsubscribe type, handler, this

