Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaScript object browser?

Tags:

javascript

I was recently tasked to document a large JavaScript application I have been maintaining for some time. So I do have a good knowledge of the system.

But due the sheer size of the application, it will probably take a lot of time even with prior knowledge around the code and the source code itself in uncompressed form.

So I'm looking for tools that would help me explore classes and methods and their relationships in JavaScript and if possible, document them along the way, is there one available?

Something like object browser in VS would be nice, but any tools that help me get things done faster will do.

Thanks!

like image 458
chakrit Avatar asked Sep 27 '08 05:09

chakrit


2 Answers

Firebug's DOM tab lets you browse the contents of the global window object, and you can inspect a particular object by entering inspect(whatever) in the command line.

You won't be able to use it to detect relationships unless an instance of one object holds an instance of a related object, but it's a start.

You can also use the Options menu on the DOM tab to restrict what's shown to user-defined functions and properties, which should help reduce clutter.

like image 178
Jonny Buchanan Avatar answered Sep 23 '22 21:09

Jonny Buchanan


Take a look at Aptana, they have an outline that can help you to determine what are the objects and somtetimes their relationship.

like image 35
gizmo Avatar answered Sep 21 '22 21:09

gizmo