getter & setter for private objects

memolus at memolus at
Mon Nov 2 02:34:49 PST 2009

I like to use getter and setter on private objects (e.g. "var test").
I didn't found any way to do this. I don't need sth. like
Object.definePrivateProperty, because I only want to set getter and
setter when I define the private object.

Example proposal:
var test;
get test = function() { [..] };
set test = function(newval) { [..] };

I'll be pleased to hear your feedback.

More information about the es-discuss mailing list