Object.prototype.inspect ?

2009-03-07 Thread Tobie Langel
Hi, I've been working on a unit test framework recently. The lack of a more developer-friendly representation of objects than the one obtained through their toString method (or by calling Object.prototype.toString) made me long for an ES equivalent of Ruby's inspect instance method. I se

Re: name property for built-in functions??

2009-03-07 Thread Maciej Stachowiak
On Mar 5, 2009, at 11:18 PM, Brendan Eich wrote: On Mar 5, 2009, at 9:26 PM, Allen Wirfs-Brock wrote: In their code generation scheme, do they ever require the generated function to have a particular non-global scope, or will global scope do? Are you really talking about "scopes" in the f

RE: What is an Object Type(O)?

2009-03-07 Thread Allen Wirfs-Brock
From: Juriy Zaytsev [mailto:kan...@gmail.com] Sent: Saturday, March 07, 2009 11:32 AM ... My initial test tries to rule out exactly all of the "ECMAScript language types" except an Object one - Undefined, Null, Boolean, String and Number. I think of these types as of "primitives", therefore `is

Re: What is an Object Type(O)?

2009-03-07 Thread Juriy Zaytsev
On Mar 7, 2009, at 1:53 PM, Allen Wirfs-Brock wrote: Your understand in your last paragraph is correct. In general, the term “type” used in the specification is referring to the categorization of values defined in Section 8. One of those “types” is “object”. Functions are values of the ob

RE: What is an Object Type(O)?

2009-03-07 Thread Allen Wirfs-Brock
Your understand in your last paragraph is correct. In general, the term "type" used in the specification is referring to the categorization of values defined in Section 8. One of those "types" is "object". Functions are values of the object type. The section 5.2 definition of Type(x) is corre

Re: name property for built-in functions??

2009-03-07 Thread David-Sarah Hopwood
David-Sarah Hopwood wrote: > Brendan Eich wrote: >> The utility of mutable name for anonymous functions is not at issue if >> we do not define name at all on such functions -- this is the proposal >> Allen and I were converging on. You can set name on such anonymous, >> expressed functions to whate

Re: What is an Object Type(O)?

2009-03-07 Thread David-Sarah Hopwood
Juriy Zaytsev wrote: > When implementing ES3.1 `Object.keys` in ES3, one of the steps in > algorithm of `Object.keys` seemed a bit confusing: > > ... > 1. If the Type(O) is not Object, throw a TypeError exception. > ... > > Based on my understanding, I implemented this check as: > > function isP

Re: name property for built-in functions??

2009-03-07 Thread David-Sarah Hopwood
Brendan Eich wrote: > The utility of mutable name for anonymous functions is not at issue if > we do not define name at all on such functions -- this is the proposal > Allen and I were converging on. You can set name on such anonymous, > expressed functions to whatever value you like, delete it, sh