Subj : enumerate methods
To : DOVE-Net.Sync_JavaScript
From : Ragnarok
Date : Sat Feb 09 2008 03:15 am
hi all!
i try to enumerate methos and properties from one object:
------------
function writeln(str)
{
write(str + "\n");
}
function document_methods(n,obj)
{
for(method in obj._method_list) {
writeln (n + ":method:" +obj._method_list[method].name);
writeln (n + ":method:" +obj._method_list[method].desc);
writeln (n + ":method:" +obj._method_list[method].args);
}
}
function document_properties(n,obj)
{
for(prop in obj) {
writeln (n +":prop:" + prop);
}
}
function document_object(n,obj)
{
document_methods(n,obj);
document_properties(n,obj);
}
document_object("System",system);
document_object("Sqlite",new Sqlite("/tmp/base"));
--------------
ragnarok@ntbkragnarok:/sbbs/exec$ ./jsexec -n jsfer.js
System:prop:host_name
System:prop:socket_lib
System:prop:uptime
System:prop:status
System:prop:errors
System:prop:action
System:prop:useron
System:prop:connection
System:prop:misc
System:prop:aux
System:prop:extaux
Sqlite:prop:name
Sqlite:prop:stmt
Sqlite:prop:debug
Sqlite:prop:errormsg
-------------------------------
is this code wrong or does not enumerate the methods?
--
Dock Sud BBS
http://bbs.docksud.com.ar
telnet://bbs.docksud.com.ar
---
� Synchronet � Dock Sud BBS TLD 24 HS -
http://www.docksud.com.ar - telnet://bbs.docksud.com.ar