Subj : Hook into Array To : netscape.public.mozilla.jseng From : Niklas Lindquist Date : Wed Apr 21 2004 03:43 pm Is there a way to hook into predefined classes e.g. the Array class to get notifications when individual objects are inserted/reassigned/deleted, or when the entire Array is sorted or reversed? Also, is there a way to not initialize array elements until its values are requested? Currently I'm initializing all elements right after the JS_NewArray call, which is rather time consuming when only a few elements actually are needed in the script. My arrays could contain 100,000+ elements. The only idea I've came up with so far is to skip the Array alltogther, and expose a function returning objects by index. By the way, are there any constraints regarding the number of elements to the Array class, except runtime memory? Oops, ended up with three questions in one... Thanks in advance. .