[Prototype-core] Re: Element.build and element.build

2007-05-30 Thread Радослав Станков
this sounds like: $('some_element_id').appendChild( new Element(tagName, options) ); --~--~-~--~~~---~--~~ 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] To make Object.extend() support methods named 'toString'

2007-05-30 Thread jdalton
Hi guys, I was looking through some of my old source code and noticed that I added a modified Object.extend method. Apparently the normal for-in loop used in the Object.extend guts ignores methods named 'toString'. I fixed this: /* * * * * * * * * * * * * * * * * * * * *Prototype

[Prototype-core] Re: To make Object.extend() support methods named 'toString'

2007-05-30 Thread Mislav Marohnić
On 5/30/07, jdalton [EMAIL PROTECTED] wrote: I was looking through some of my old source code and noticed that I added a modified Object.extend method. Apparently the normal for-in loop used in the Object.extend guts ignores methods named 'toString'. Yeah, toString is non-iterable in JS.

[Prototype-core] Re: To make Object.extend() support methods named 'toString'

2007-05-30 Thread Ryan Gahl
Then this opens up the whole can of worms of, well if we're adding explicit support for this non-iterable property, why not others, and the list could grow along with any resulting code. If anything, I'd add support for passing an array of member names to check for at extend-time (thus making it

[Prototype-core] Re: To make Object.extend() support methods named 'toString'

2007-05-30 Thread jdalton
Honestly, I don't care about the core dev teams inner soul searching on what they want to do. I just merely posted this to point out that the for-loop doesn't iterate over the method 'toString'. I am happy with my solution and if it's left up to the Devs to fix on an 'as needed' basis I am

[Prototype-core] Re: Element.build and element.build

2007-05-30 Thread Mislav Marohnić
On 5/30/07, timcharper [EMAIL PROTECTED] wrote: What do you think if we added a shortcut method to an instantiated method capable of building and appending a new element to it in one swoop? So you're proposing a wrapper around new Element(); appendChild()? It's useful, yeah... But is build

[Prototype-core] Re: To make Object.extend() support methods named 'toString'

2007-05-30 Thread jdalton
My comment was not intended to be malicious, but rather sarcastic. Tone and inflection don't translate well to text. As always keep up the great work! 8P --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Prototype:

[Prototype-core] SV: [Prototype-core] To make Object.extend() support methods named 'toString'

2007-05-30 Thread Tobias Haagen Michaelsen
It does not ignore based on name -- if you define a property named 'toString' as a function (or some other object) it will be included in the for-in loop. But the for-in loop ignores 'build-in' properties like 'toString' on Object etc. and 'length' on Array. -Tobias -Oprindelig

[Prototype-core] Re: To make Object.extend() support methods named 'toString'

2007-05-30 Thread Mislav Marohnić
On 5/30/07, jdalton [EMAIL PROTECTED] wrote: @Tobias, I dont know if that is true. This works: foo = Object.extend({}, { toString:function(){ return 'BOO!' } }) foo.toString() This doesn't: Dummy = Class.create() Object.extend(Dummy.prototype, { toString:function(){ return 'BOO!' } }) new