akre54 / Backbone.NativeView

A reference implementation of a native Backbone.View
MIT License
113 stars 18 forks source link

Safari events attaching and detaching fix #25

Closed radist2s closed 8 years ago

radist2s commented 8 years ago

I closed my previous pull request. This is better. Also, a I used apply instead of direct calling because it's better to pass all arguments.

akre54 commented 8 years ago

Two things. 1) no need to close a pull request to amend it, just push to the same branch and it'll show up. 2) .apply is slow, much slower than calling the function directly, and we know exactly what arguments will be passed so there's no need for arguments here.

radist2s commented 8 years ago

1) Sorry, I created another PR because I removed wrong commit 2) It's unexpectedly for me. I created small benchmark to test performance, so yes: apply really slower than direct call but no so much. I updated the code. Check it please.

akre54 commented 8 years ago

It's mostly a style thing, but thanks for fixing. Squash down to one commit and I'll merge.

radist2s commented 8 years ago

I used useCapture in my code earlier, it's a reason why I passed it to arguments.