public void emit(String event, Object... args) {
		List<EventHandler> handlers = listeners(event);

		if (handlers == null || handlers.size() == 0) {
			if (!event.equals("error"))
				return;

			StringBuilder sb = new StringBuilder("error");
			if (args.length > 0)
				sb.append(":");
			for (Object arg : args)
				sb.append(" " + arg.toString());
			throw new Error(sb.toString());
		}

		for (int i = 0, n = handlers.size(); i < n;) {
			EventHandler handler = handlers.get(i);

			if (handler.once) {
				handlers.remove(i);
				--n;
			} else
				++i;

			handler.callback(args);
		}

		if (handlers.size() == 0)
			events.remove(event);
	}