Hi Christophe, i think i understand, but when i override the standard Array anyway, do i need the Delegator still? Couldn´t i just overwrite the Arrays has, get and put equal to the way i did in the Delegator?
Best Regards Normen "Christophe Grand" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Normen a écrit : >> that really works great; thanks for the advice. >> >> Do you also know how I can "reedelgate" JAvascript array methods like >> pop, shift et al. > > Your array-like object already supports Array methods... as long as they > don't change its length (remember your object is backed by a Java array). > Shift, splice, unshift, pop and push don't work but map, forEach, some, > every work. > > If what you want is to have specialized versions of these methods, instead > of creating an Array, instantiate a (javascript) FlagsArray (you'll need > to have a FlagsArray constructor whose prototype is an Array plus your > customized methods). > > Do you see what I mean? > > Christophe. > > PS: BTW I'm not a big fan of defineClass, I find easier/cleaner to write > plain javascript objects and classes delegating to plain java classes > rather than writing java adapters full of jsGet_ etc. > > >
_______________________________________________ dev-tech-js-engine-rhino mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
