When trying to connect and generally play with some non-browser, I came across getters and setters that looked like normal properties of an object. Something like that:
js> var o = { a: 4, get b(){ return this.a + 3; }, set b(val){ this.a = val - 3; } }; js> oa 4 js> ob 7 js> ob=10 10 js> oa 7
This seems to work in the latest versions of Rhino and Spidermonkey, but is it possible to implement or simulate the behavior (the definition syntax is less important to me) in JScript (Windows Script Host)?
hillu source share