[Webkit-unassigned] [Bug 9508] JavaScript Comparing a form element group to itself returns false.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jan 23 09:44:10 PST 2007
http://bugs.webkit.org/show_bug.cgi?id=9508
------- Comment #8 from sanjay12 at gmail.com 2007-01-23 09:44 PDT -------
I think I was concerned that temporarily caching it could create cases where
the comparsion would still fail, but I guess really that doesn't make sense,
since the lifetime of the object will be however long it is still referenced.
Regarding strict equal, are you saying that "strict equal in this case should
be false" or "strict equal already works, so we don't need to change it." Well
currently, strict equal returns false in this case (for objects it's still
doing a pointer comparison), but Firefox says it should be true. So I'm pretty
sure strict equal does need to be fixed as well. Making the caching change will
fix it at the same time as reguar equal.
Good point about getting rid of the second virtual call and having it just do a
the pointer comparison first in an isEqual() function to save virtual call
overhead, but I guess that's irrelevant anyways with the caching solution.
Anyways, I agree the caching solution is a much more elegant way to solve the
problem. I was going to do it that way originally, but then I had the lifetime
concerns. However it seems like that shouldn't be a problem. I'll rewrite the
patch and post something either tonight or tomorrow night. Hey, well at least I
already have a test case for it! :)
David: While you certainly could overload operator ==, since JSObjects are
almost exclusively passed around as pointers, whenever you wanted to call it
you'd have to write code like (*v1) == (*v2), which certainly isn't fun :).
--
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list