DmitryBaranovskiy/raphael — Issue #497: Element.attr(attrNames) does not return an array
Author: beldaz
Created: 2012-01-18 01:40:20+00:00
State: open

http://raphaeljs.com/reference.html#Element.attr states that when an array "attrNames" is passed in to Element.attr(...) the method returns array of current values for given attribute names. However, in version 2.0.1 what is returned is an object. Hence
el.attr(['x','y']) returns {x: xval, y: yval} when I believe it is supposed to return [xval, yval].

The cause seems to be around line 4195:
if (value == null && R.is(name, "array")) {
out = {};
for (i = 0, ii = name.length; i < ii; i++) {
out[name[i]] = this.attr(name[i]);
}
return out;
}

I think it should be:
if (value == null && R.is(name, "array")) {
out = [];
for (i = 0, ii = name.length; i < ii; i++) {
out[i] = this.attr(name[i]);
}
return out;
}