On 8/17/07, Wiktor Ihárosi <[EMAIL PROTECTED]> wrote:
> I have checked the new prototype, and after a few hours I ran into a
> problem. It seems the method of Enumerable.include has been changed.
> It uses === operator instead of ==.

This is my fault from [7170]. I changed it to strict equality because
Enumerable#include uses Array#indexOf internally (if the enumerable is an
array). The latter (native) method uses strict equality (
while Ruby uses the normal equality operator for #include (

Because we are following Ruby semantics for Enumerable#include, not
JavaScript semantics for #indexOf, this should be corrected. I have whipped
up the following patch: http://pastie.caboo.se/private/j7xeidwpb4jtfflrta

It changes the equality operator from strict to weak and adds unit tests for
this. The method still uses native #indexOf internally, but if the element
is not found using #indexOf it doesn't immediately return false, but still
performs the search using weak equality.

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to