if (!Array.prototype.toByteString) {
Array.prototype.toByteString = function(charset) {
return new ByteString(this);
};
}
should become:
if (!Array.prototype.toByteString) {
Array.prototype.toByteString = function(charset) {
return new ByteString(this);
};
if(Object.defineProperty){
Object.defineProperty(Array.prototype, "toByteString",
{enumerable:false});
}
}
And same thing for "toByteArray". I have grown very fond of using for
each(var item in array) for nice terse syntax for iterating over arrays,
but that doesn't work well with Array.prototype enumerables.
Kris
This is very reasonable. We even have a defineProperty stub that we patch in.
http://github.com/tlrobinson/narwhal/issues#issue/43
Kris Kowal