mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Changes
to improve debugging, added debugging notes to the README.
This commit is contained in:
parent
be570e701b
commit
95eebc9250
20
README.md
20
README.md
@ -62,8 +62,24 @@ older Rhino.
|
|||||||
The build script for JSDoc 3 requires Apache ant. It is know to work with
|
The build script for JSDoc 3 requires Apache ant. It is know to work with
|
||||||
version 1.8.2 of ant.
|
version 1.8.2 of ant.
|
||||||
|
|
||||||
See
|
Debugging
|
||||||
---
|
---------
|
||||||
|
|
||||||
|
Rhino is not always very friendly when it comes to reporting errors in
|
||||||
|
JavaScript. Luckily it comes with a full-on debugger included that can be much
|
||||||
|
more useful than a simple stack trace. To invoke JSDoc with the debugger try the
|
||||||
|
following command:
|
||||||
|
|
||||||
|
$ java -classpath build-files/java/classes/js.jar \
|
||||||
|
org.mozilla.javascript.tools.debugger.Main.main main.js `pwd` \
|
||||||
|
your/script.js
|
||||||
|
|
||||||
|
This will open a debugging window. Choose "Break on Exceptions" from the "Debug"
|
||||||
|
menu, then press the "Run" button. If there is an error, you should see exactly
|
||||||
|
where it is in the source code.
|
||||||
|
|
||||||
|
See Also
|
||||||
|
--------
|
||||||
|
|
||||||
Project Documentation: <http://usejsdoc.org/> (under development)
|
Project Documentation: <http://usejsdoc.org/> (under development)
|
||||||
JSDoc User's Group: <http://groups.google.com/group/jsdoc-users>
|
JSDoc User's Group: <http://groups.google.com/group/jsdoc-users>
|
||||||
|
|||||||
8
main.js
8
main.js
@ -4,6 +4,7 @@
|
|||||||
* @license See LICENSE.md file included in this distribution.
|
* @license See LICENSE.md file included in this distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// try: $ java -classpath build-files/java/classes/js.jar org.mozilla.javascript.tools.shell.Main main.js `pwd` script/to/parse.js
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
|
||||||
|
|
||||||
@ -11,7 +12,7 @@
|
|||||||
@type string
|
@type string
|
||||||
@global
|
@global
|
||||||
*/
|
*/
|
||||||
const BASEDIR = arguments[0].replace(/([\/\\])main\.js$/, '$1'); // jsdoc.jar sets argument[0] to the abspath to main.js
|
const BASEDIR = arguments[0].replace(/([\/\\])main\.js$/, '$1') + '/'; // jsdoc.jar sets argument[0] to the abspath to main.js
|
||||||
|
|
||||||
/** Include a JavaScript module, defined in the CommonJS way.
|
/** Include a JavaScript module, defined in the CommonJS way.
|
||||||
@param {string} id The identifier of the module you require.
|
@param {string} id The identifier of the module you require.
|
||||||
@ -112,6 +113,11 @@ app = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try { main(); }
|
try { main(); }
|
||||||
|
catch(e) {
|
||||||
|
if (e.rhinoException != null) {
|
||||||
|
e.rhinoException.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
finally { env.run.finish = new Date(); }
|
finally { env.run.finish = new Date(); }
|
||||||
|
|
||||||
/** Print string/s out to the console.
|
/** Print string/s out to the console.
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jsdoc",
|
"name": "jsdoc",
|
||||||
"version": "3.0.0beta1",
|
"version": "3.0.0beta1",
|
||||||
"revision": "2011-04-10-2223",
|
"revision": "2011-04-12-2149",
|
||||||
"description": "An automatic documentation generator for javascript.",
|
"description": "An automatic documentation generator for javascript.",
|
||||||
"keywords": [ "documentation", "javascript" ],
|
"keywords": [ "documentation", "javascript" ],
|
||||||
"licenses": [
|
"licenses": [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user