 ###
 
 root.Deferred.when = (args...) ->
-  return new Deferred().resolve().promise() if args.length == 0
-  return args[0].promise() if args.length == 1
+  return new Deferred().resolve().promise() if args.length is 0
+  return args[0].promise() if args.length is 1
   allReady = new Deferred()
   readyCount = 0
   allDoneArgs = []

  the first parameter is used as this when calling the done and always callbacks.
  ###
  resolveWith: (context, args...) =>
    return this if @_state != 'pending'
    @_state = 'resolved'
    @_context = context
    @_withArguments = args

  the first parameter is used as this when calling the fail and always callbacks.
  ###
  rejectWith: (context, args...) =>
    return this if @_state isnt 'pending'
    @_state = 'rejected'
    @_withArguments = args
    @_context = context
