Can anyone help me ?
What do you mean by basic functions?
You could try using a recursive for-in loop to iterate through EVERY object, starting at the window object. If the type of the object's property is "function", call that property's toString method. If it contains "[native code]" then it is a native function.
Of course this would bring any browser and computer to its knees.
For each match, loop through an array of native objects
and increment your count (and quit the loop) if any of their prototypes include as a property the matched string- and it is not enumerable.
It gets complicated if you use any native method identifiers as method names for your own objects, so don't .
Last edited by mrhoo; 12-11-2008 at 10:11 AM.
i think a string-based approach matching the program code would be the simplest way.
you can find all the natives listed at w3 schools.
since it is case sensitive, writing something that matches a list of names is fairly simple.
what's more fun (and complicated) is building a dependency tree; scan window for names, scan functions to find names, scan newly found functions' code for more/new functions. repeat until the result is the same twice in a row and you have a standalone package..
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)