Re: Would some like Object.inspect(myObj) be useful?

2012-06-19 Thread Tom Van Cutsem
2012/6/14 Allen Wirfs-Brock al...@wirfs-brock.com On Jun 14, 2012, at 10:52 AM, Brendan Eich wrote: ... Thanks. Any reason this wasn't included in ES5 that you recall? Minimalism. Object.* wasn't intended to be a comprehensive reflection library, just a set of essential primitives that

Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
Was just wondering if something like *Object.inspect(myObj) *would give all the attributes of that particular object. -- *'I am what I am because of who we all are'* h3manth.com http://www.h3manth.com *-- Hemanth HM * ___ es-discuss mailing list

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread T.J. Crowder
On 14 June 2012 10:42, Hemanth H.M hemanth...@gmail.com wrote: Was just wondering if something like *Object.inspect(myObj) *would give all the attributes of that particular object. Is there a proposal or strawman you're referring to? I'm not immediately seeing it, but I'm still new here.

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
No there is no proposal of that I'm aware of in Strawman, just asking the group if it's useful? On Thu, Jun 14, 2012 at 3:23 PM, T.J. Crowder t...@crowdersoftware.comwrote: On 14 June 2012 10:42, Hemanth H.M hemanth...@gmail.com wrote: Was just wondering if something like

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread David Bruant
Le 14/06/2012 11:42, Hemanth H.M a écrit : Was just wondering if something like *Object.inspect(myObj) *would give all the attributes of that particular object. In ES5, there are Object.getOwnPropertyNames as well as Object.getOwnPropertyDescriptor. These are the lowest-level constructs you

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread T.J. Crowder
On 14 June 2012 11:07, Hemanth H.M hemanth...@gmail.com wrote: No there is no proposal of that I'm aware of in Strawman, just asking the group if it's useful? I can't speak for the group, but I think you'd need to explain it a lot more. :-) What would it return? How does it relate to the

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Russell Leggett
On Thu, Jun 14, 2012 at 5:42 AM, Hemanth H.M hemanth...@gmail.com wrote: Was just wondering if something like *Object.inspect(myObj) *would give all the attributes of that particular object. What would this function return? There's already an

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
The inspect module provides functions for introspecting on live objects and their source code. On Thu, Jun 14, 2012 at 6:21 PM, Russell Leggett russell.legg...@gmail.comwrote: On Thu, Jun 14, 2012 at 5:42 AM, Hemanth H.M hemanth...@gmail.com wrote: Was just wondering if something like

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Allen Wirfs-Brock
On Jun 14, 2012, at 9:49 AM, Hemanth H.M wrote: The inspect module provides functions for introspecting on live objects and their source code. As do many of the ES5 methods in Object.*. It's not clear what you mean by source code in this context. If you want to have discussion about an

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
var info = { name: Hemanth, url: http://h3manth.com/;, location : Earth, get : function() {} }; Object.keys(info) [name, url, location, get] Now, it's not clear about the 'type' of the keys; name is a String, where as get is a function. Compared to something like inspect module in python that

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Brendan Eich
Hemanth H.M wrote: var info = { name: Hemanth, url: http://h3manth.com/;, location : Earth, get : function() {} }; Object.keys(info) [name, url, location, get] Now, it's not clear about the 'type' of the keys; name is a String, where as get is a function. Compared to something like inspect

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Hemanth H.M
WOW! Thanks a ton for the clarification. On Thu, Jun 14, 2012 at 10:52 PM, Brendan Eich bren...@mozilla.com wrote: ES5 has plural Object.defineProperties for defining more than one property on an object, and of course Object.create that defines all the properties on a new object from a

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Brendan Eich
Brendan Eich wrote: ES5 has plural Object.defineProperties for defining more than one property on an object, and of course Object.create that defines all the properties on a new object from a descriptor-map. But it doesn't have anything like this inspect. We could add such an

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Brendan Eich
Allen Wirfs-Brock wrote: On Jun 14, 2012, at 10:22 AM, Brendan Eich wrote: Hemanth H.M wrote: var info = { name: Hemanth, url: http://h3manth.com/;, location : Earth, get : function() {} }; Object.keys(info) [name, url, location, get] Now, it's not clear about the 'type' of the keys; name

Re: Would some like Object.inspect(myObj) be useful?

2012-06-14 Thread Allen Wirfs-Brock
On Jun 14, 2012, at 10:52 AM, Brendan Eich wrote: ... Thanks. Any reason this wasn't included in ES5 that you recall? Minimalism. Object.* wasn't intended to be a comprehensive reflection library, just a set of essential primitives that could be used tin building such. Allen