[Proto-Scripty] Re: Why created object is not extended with Object methods?

2011-10-18 Thread T.J. Crowder
On Oct 18, 8:30 am, buda www...@pochta.ru wrote: I try var o = {}; o.name = 'propertyName'; alert(o.keys); -- undefined why? but in debugger I see that Object has all methods, but o - not! `keys` is not an instance method, it's a method of the `Object` function: alert(Object.keys(o)); //

[Proto-Scripty] Re: Why created object is not extended with Object methods?

2011-10-18 Thread buda
T.J. what the reasons not to make them Object.prtototype methods? On 18 окт, 14:21, T.J. Crowder t...@crowdersoftware.com wrote: On Oct 18, 8:30 am, buda www...@pochta.ru wrote: I try var o = {}; o.name = 'propertyName'; alert(o.keys); -- undefined why? but in debugger I see that

[Proto-Scripty] Re: Why created object is not extended with Object methods?

2011-10-18 Thread T.J. Crowder
On Oct 18, 3:08 pm, buda www...@pochta.ru wrote: T.J. what the reasons not to make them Object.prtototype methods? If you add something to `Object.prototype`, it shows up on *every* object. So for instance: Object.prototype.foo = function() { return bar; }; var a = {}; console.log(typeof

RE: [Proto-Scripty] Re: Why created object is not extended with Object methods?

2011-10-18 Thread wwwboy
thanks for the explanation! -Original Message- From: prototype-scriptaculous@googlegroups.com [mailto:prototype-scriptaculous@googlegroups.com] On Behalf Of T.J. Crowder Sent: Tuesday, October 18, 2011 6:52 PM To: Prototype script.aculo.us Subject: [Proto-Scripty] Re: Why created object