From 51e1a785f80cccf8ed480e615ec34f31da18232c Mon Sep 17 00:00:00 2001 From: Michael Mathews Date: Sun, 8 Jul 2012 01:07:49 +0100 Subject: [PATCH 1/4] Rhino likes the filepaths (all args really) to be url encoded, which is an issue if spaces appear in filepaths. This makes JSDoc cooperate better with that rule. --- jsdoc | 10 ++++++---- rhino_modules/jsdoc/src/scanner.js | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/jsdoc b/jsdoc index 14c31656..a6f216dd 100755 --- a/jsdoc +++ b/jsdoc @@ -10,7 +10,9 @@ URLPATH="file://"$BASEPATH URLPATH=`echo "$URLPATH" | sed -e 's/ /%20/g'` ENCODEDBASEPATH=`echo "$BASEPATH" | sed -e 's/ /%20/g'` -if test $1 = "--debug" +ARGS="$@" + +if test "$1" = "--debug" then echo "Running Debug" CMD="org.mozilla.javascript.tools.debugger.Main -debug" @@ -20,12 +22,12 @@ else fi #Conditionally execute different command lines depending on whether we're running tests or not -if test $1 = "-T" +if test "$1" = "-T" then echo "Running Tests" - java -classpath "${BASEPATH}/lib/js.jar" ${CMD} -opt -1 -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $@ --dirname="${BASEPATH}/" + java -classpath "${BASEPATH}/lib/js.jar" ${CMD} -opt -1 -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/" else # normal mode should be quiet - java -classpath "${BASEPATH}/lib/js.jar" ${CMD} -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $@ --dirname="${BASEPATH}/" + java -classpath "${BASEPATH}/lib/js.jar" ${CMD} -modules "${URLPATH}/node_modules" -modules "${URLPATH}/rhino_modules" -modules "${URLPATH}" "${BASEPATH}/jsdoc.js" $ARGS --dirname="${BASEPATH}/" fi diff --git a/rhino_modules/jsdoc/src/scanner.js b/rhino_modules/jsdoc/src/scanner.js index 2c5ad30a..8ca2f70c 100644 --- a/rhino_modules/jsdoc/src/scanner.js +++ b/rhino_modules/jsdoc/src/scanner.js @@ -36,11 +36,12 @@ exports.Scanner.prototype.scan = function(searchPaths, depth, filter) { depth = depth || 1; searchPaths.forEach(function($) { - if ( fs.stat($).isFile() ) { - filePaths.push($); + var filepath = decodeURIComponent($); + if ( fs.stat(filepath).isFile() ) { + filePaths.push(filepath); } else { - filePaths = filePaths.concat(fs.ls($, depth)); + filePaths = filePaths.concat(fs.ls(filepath, depth)); } }); From 99cf39fe96a0abbd56d2fa8bd4d7736f8aebd37d Mon Sep 17 00:00:00 2001 From: Michael Mathews Date: Sun, 8 Jul 2012 01:09:22 +0100 Subject: [PATCH 2/4] Avoid linting code that isnt owned by JSDoc. Avoid me having to fix errors in temporary folders I keep inside the main project folder. --- test/specs/jshint/jshint-clean.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/specs/jshint/jshint-clean.js b/test/specs/jshint/jshint-clean.js index 436aaab3..361d4015 100644 --- a/test/specs/jshint/jshint-clean.js +++ b/test/specs/jshint/jshint-clean.js @@ -41,8 +41,8 @@ describe("jshint-clean", function() { // check all .js files unless they're tests; rhino shim files that probably can't be // delinted; or third-party modules source = { - includePattern: ".+\\.js$", - excludePattern: ".+[\\\\|/]test[\\\\|/].+|.+rhino-shim\\.js|.+[\\\\|/]Jake[\\\\|/].+|.+[\\\\|/]node_modules[\\\\|/].+" + includePattern: '.+[\\|/]rhino_modules[\\|/].+\.js$|.+[\\|/]plugins[\\|/]\w+\.js$', + excludePattern: '.+[\\|/]test[\\|/].+' }; filter = new (require('jsdoc/src/filter').Filter)(source); From 22e48122750ae0af7ad6152d653d190060abcf97 Mon Sep 17 00:00:00 2001 From: Michael Mathews Date: Sun, 8 Jul 2012 01:10:50 +0100 Subject: [PATCH 3/4] Allow externally documented objects to be extended, as if they were classes. Addresses Issue #145 --- rhino_modules/jsdoc/augment.js | 3 ++- rhino_modules/jsdoc/tag/dictionary/definitions.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rhino_modules/jsdoc/augment.js b/rhino_modules/jsdoc/augment.js index bff28a1e..68e2a660 100644 --- a/rhino_modules/jsdoc/augment.js +++ b/rhino_modules/jsdoc/augment.js @@ -27,7 +27,7 @@ var doop = require("jsdoc/util/doop").doop; doclets = index[name]; for (var i=0, ii=doclets.length; i Date: Sun, 8 Jul 2012 01:11:54 +0100 Subject: [PATCH 4/4] Added test fixture for extended external. --- test/fixtures/externals2.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/fixtures/externals2.js diff --git a/test/fixtures/externals2.js b/test/fixtures/externals2.js new file mode 100644 index 00000000..0099f0c1 --- /dev/null +++ b/test/fixtures/externals2.js @@ -0,0 +1,11 @@ +/** + Namespace provided by the browser. + @external XMLHttpRequest + @see https://developer.mozilla.org/en/xmlhttprequest + */ + +/** + Extends the built in XMLHttpRequest to send data encoded with a secret key. + @class EncryptedRequest + @extends external:XMLHttpRequest +*/ \ No newline at end of file