to improve debugging, added debugging notes to the README.
This commit is contained in:
Michael Mathews 2011-04-12 21:49:40 +02:00
parent be570e701b
commit 95eebc9250
3 changed files with 26 additions and 4 deletions

View File

@ -62,8 +62,24 @@ older Rhino.
The build script for JSDoc 3 requires Apache ant. It is know to work with
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)
JSDoc User's Group: <http://groups.google.com/group/jsdoc-users>

View File

@ -4,6 +4,7 @@
* @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
@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.
@param {string} id The identifier of the module you require.
@ -112,6 +113,11 @@ app = {
}
try { main(); }
catch(e) {
if (e.rhinoException != null) {
e.rhinoException.printStackTrace();
}
}
finally { env.run.finish = new Date(); }
/** Print string/s out to the console.

View File

@ -1,7 +1,7 @@
{
"name": "jsdoc",
"version": "3.0.0beta1",
"revision": "2011-04-10-2223",
"revision": "2011-04-12-2149",
"description": "An automatic documentation generator for javascript.",
"keywords": [ "documentation", "javascript" ],
"licenses": [