sonygod / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

jQuery.each has incorrect method parameters #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The current jQuery.each method parameters are same as jQueryContext.J().each 
method. That is incorrect as per jQuery documentation 
(http://api.jquery.com/jQuery.each/).

$.each is different from $().each. Not exactly sure what the method prototype 
should look like but maybe something like:
(JsNumber index, JsObject value)
&
(JsString index, JsObject value)

Original issue reported on code.google.com by sergio.d...@gmail.com on 16 Jun 2011 at 3:24

GoogleCodeExporter commented 9 years ago
Correct, changed signature to:
public static JsObject each(object collection, JsAction<JsNumber, object> 
callback)

Original comment by DanelK...@gmail.com on 16 Jun 2011 at 3:30

GoogleCodeExporter commented 9 years ago
Would be nice to have an overload in the case that the returned index is a 
string for the case where one enumerates over an object. The index value would 
be the property name.

Original comment by sergio.d...@gmail.com on 16 Jun 2011 at 3:44