Deleting Getters and Setters (was Re: Controlling DontEnum...)

Kris Zyp kris at sitepen.com
Thu Mar 13 17:14:21 PDT 2008


> the fact; getters and setters defined by an object initializer
> or in a class are fixtures and hence not deletable.
Really, that doesn't create a compatibility problem? I realize getters and 
setters aren't in ES3, but this seems like ES4 would be making a significant 
departure in behavior from the majority of current browser implementations 
of the same getter/setter syntax used by ES4:
>>> obj = {get foo() { return 'hi' }}
Object foo=hi
>>> obj.foo
"hi"
>>> delete obj.foo
true
>>> obj.foo = 'goodbye'
"goodbye"
>>> obj.foo
"goodbye"

With ES4, obj.foo would still be returning "hi" at the end? That sounds 
nice, but is there no fear of compatibility issues with that?
Kris 




More information about the Es4-discuss mailing list