I dunno how much you guys like these changes. I figure findValue and
findIdentical probably have some
performance requirements, so this might be superfluous, but here it is
(I copied the actual check directly from extend)
I hope you guys don't mind the endless spam of noob questions and
suggestions. :)
- Aaron
Index: Base.js
===================================================================
--- Base.js (revision 1264)
+++ Base.js (working copy)
@@ -969,6 +969,13 @@
/** @id MochiKit.Base.findIdentical */
findIdentical: function (lst, value, start/* = 0 */, /* optional
*/end) {
+ if (typeof(lst.length) != 'number' /* !isArrayLike(lst) */) {
+ if (typeof(MochiKit.Iter) != "undefined") {
+ lst = MochiKit.Iter.list(lst);
+ } else {
+ throw new TypeError("Argument not an array-like
and MochiKit.Iter
not present");
+ }
+ }
if (typeof(end) == "undefined" || end === null) {
end = lst.length;
}
@@ -1029,6 +1036,13 @@
/** @id MochiKit.Base.findValue */
findValue: function (lst, value, start/* = 0 */, /* optional */
end) {
+ if (typeof(lst.length) != 'number' /* !isArrayLike(lst) */) {
+ if (typeof(MochiKit.Iter) != "undefined") {
+ lst = MochiKit.Iter.list(lst);
+ } else {
+ throw new TypeError("Argument not an array-like
and MochiKit.Iter
not present");
+ }
+ }
if (typeof(end) == "undefined" || end === null) {
end = lst.length;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---