mkuklis/asEvented — pull request #6 by rk (2012-03-22 18:19:39+00:00)
Title: Performance tweak to trigger() & minor shrinking of one()

In reading back through [John Resig's](http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/) article on ES5 and Strict Mode, I realized that I forgot one aspect of javascript that makes assigning a closure/callback to a function pointless for unbinding it. So I built it into the `one()` method.

function one(event, fn) {
this.bind(event, function fnc() {
fn.apply(this, [].slice.call(arguments));
this.unbind(event, fnc);
})
}

Which is identical to the old method.

I tested this change in Chrome and Firefox without trouble. But IE8 and lower do not support `unbind()` because they lack an implementation of `indexOf`! This is pretty ridiculous. Think we should [provide a fix](http://stackoverflow.com/questions/1744310/how-to-fix-array-indexof-in-javascript-for-ie-browsers) or not? This doesn't directly affect me yet, since I'm only using asEvented in an AIR app.

The tweak to `trigger` is caching the sliced arguments in the for-loop initializer rather than slicing with each call. This is a negligible optimization, but good practice in my opinion.