Apologies -- I didn't fully understand this question until I re-read
#3592.

I agree that we need to apply this patch and will raise some hell
forthwith.  In the meantime, the issue is specific to Hash, so can't
you do...

Object.extend(Hash.prototype, {
reject: function() { /* ... */ },
findAll: function() { /* ... */ },
_add: function() { /* ... */ },
_new: function() { /* ... */ }
});

I think this is the best band-aid until this problem gets permanently
fixed.

On Feb 8, 6:26 pm, Alexander Presber <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I have a little trouble porting stuff to from prototype 1.4 to 1.5.
> Some has to do with ticket #3592, where the results of filters on  
> enumerables are discussed. As long as this patch is not accepted I  
> could just patch the behaviour for myself, overloading Enumerables  
> reject and findAll methods after loading prototype.js.
> This would work, because the Enumerable methods were copied to the  
> Hash object _when_creating_a_new_Hash_.
>
> Now with 1.5 that cannot be done anymore, because the Enumerable  
> methods are copied to the Hash _prototype_, from where they are  
> copied by JS when instatiating a new Hash via the new operator.
> So effectively to overwriite Enumerable methods I would have to  
> reextend Hash.prototype with Enumerable after applying my fixes on  
> Enumerable (the same goes for Array and Range and future Enumerable  
> descendants).
>
> Now my question is: What is the advantage of the new Hash  
> implementation? Why did Class.create not suffice? I can see added  
> complexity but no real gain, since Enumerable is not really in the  
> prototype chain of Hash, its methods are just copied to the Hashes  
> prototype.
>
> Please don't think I want to troll around, I am really appreciating  
> your work.
> I have a lot of code depending on Prototype and there is just so much  
> broken now.
> On the other hand I would not want to miss on features and  
> improvements by staying on 1.4, you see.
>
> Alex


--~--~---------~--~----~------------~-------~--~----~
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 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to