1 Apr 23:22
Re: __defineGetter__
jfwittmann <neokolor <at> gmx.de>
2007-04-01 21:22:04 GMT
2007-04-01 21:22:04 GMT
Michael Platzer schrieb: > Hi list, > > One of the cool new features of Helma 1.6.0 will be the ability to > define methods for retrieving and setting properties throught the use of > defineGetter, and defineSetter. > -> > http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Creating_New_Objects:Defining_Getters_and_Setters > In the Mustang includes Rhino JavaScript engine it's already possible. this was a little test by me with the known prototype lib on server side. .... function MapAdapter(map) { this.__has__ = function(name) { return map.containsKey(name); } this.__get__ = function(name) { return map.get(name); } this.__put__ = function(name, value) { map.put(name, value); } this.__delete__ = function(name) { map.remove(name); } this.__getIds__ = function() { var result = []; for (var keyIterator = map.keySet().iterator(); keyIterator.hasNext();) {(Continue reading)
RSS Feed