varvet / serenade.js

Client side MVC framework
http://serenadejs.org
Other
524 stars 27 forks source link

Collection.forEach() does not accept optional this scope argument #63

Closed KirillGrishin closed 12 years ago

KirillGrishin commented 12 years ago

Looks like passing scope to Serenade's collection.forEach() as an optional argument has no effect.

example:

mythings.forEach(function(mything){ .. code .. }, this)

this is not passed to the callback function.

Please confirm.

jnicklas commented 12 years ago

Just checked the ECMAscript spec, and you're right. In fact, there are other Array methods which should take an optional this argument as well, map, every, some and filter at least.

jnicklas commented 12 years ago

This is now fixed.

KirillGrishin commented 12 years ago

Thank you Jonas!