ES4 draft: Object

liorean liorean at
Tue Mar 11 05:01:48 PDT 2008

On 11/03/2008, Maciej Stachowiak <mjs at> wrote:
> This is not unreasonable, but if adding to Object.prototype is truly
>  terrifying then I think the approach Mark Miller linked to, of static
>  methods on the Object constructor, is cleaner:
>  It might even be better to make this transition one-way, since it
>  shouldn't be allowed to make built-in properties that are DontEnum
>  enumerable:

Could as well make it a global function then. Just give it an obscure
__preventEnumeration__(obj, propName) signature or something.

I would very much like to see a declarative keyword for use with
global, class and namespace variable and function declarations and in
object literals. There's really not much reason to require a function
call for a declarative feature if there's a cheap and much nicer way
to do it in ES4, as long as you have a solution for ES3.

(Kinda like how there's a specific slice syntax in ES4, but the slice
functionality itself is ES3 compatible.)
David "liorean" Andersson

More information about the Es4-discuss mailing list