From 9af5ea424e8a40cf94e2665fe5bf5c5f7b2d5a9f Mon Sep 17 00:00:00 2001 From: Ernst Haagsman Date: Wed, 8 May 2013 21:30:25 +0200 Subject: [PATCH 01/10] @default tag: added support for object literal defaults Default object literals are now stored as a string. In the default template they are shown with syntax highlighting. --- lib/jsdoc/tag/dictionary/definitions.js | 4 ++++ templates/default/static/styles/jsdoc-default.css | 5 +++-- templates/default/tmpl/details.tmpl | 11 ++++++++++- test/fixtures/defaulttag.js | 7 ++++++- test/specs/tags/defaulttag.js | 12 +++++++++--- 5 files changed, 32 insertions(+), 7 deletions(-) diff --git a/lib/jsdoc/tag/dictionary/definitions.js b/lib/jsdoc/tag/dictionary/definitions.js index 137b0286..4c9b68f7 100644 --- a/lib/jsdoc/tag/dictionary/definitions.js +++ b/lib/jsdoc/tag/dictionary/definitions.js @@ -251,6 +251,10 @@ exports.defineTags = function(dictionary) { // TODO: handle escaped quotes in values doclet.defaultvalue = 'null'; } + else if (doclet.meta.code.type === 'OBJECTLIT'){ + doclet.defaultvalue = String(doclet.meta.code.node.toSource()); + doclet.defaultobject = true; + } } } }) diff --git a/templates/default/static/styles/jsdoc-default.css b/templates/default/static/styles/jsdoc-default.css index ea49f607..327b17ad 100644 --- a/templates/default/static/styles/jsdoc-default.css +++ b/templates/default/static/styles/jsdoc-default.css @@ -195,12 +195,13 @@ h6 font-family: Consolas, "Lucida Console", Monaco, monospace; } -.details { margin-top: 14px; } -.details dt { width:100px; float:left; border-left: 2px solid #DDD; padding-left: 10px; padding-top: 6px; } +.details { margin-top: 14px; border-left: 2px solid #DDD; } +.details dt { width:100px; float:left; padding-left: 10px; padding-top: 6px; } .details dd { margin-left: 50px; } .details ul { margin: 0; } .details ul { list-style-type: none; } .details li { margin-left: 30px; padding-top: 6px; } +.details pre.prettyprint { margin: 0 } .description { margin-bottom: 1em; diff --git a/templates/default/tmpl/details.tmpl b/templates/default/tmpl/details.tmpl index d3b35522..141bd58a 100644 --- a/templates/default/tmpl/details.tmpl +++ b/templates/default/tmpl/details.tmpl @@ -1,6 +1,13 @@ " + data.defaultvalue + ""; + default_object_css = ' style="padding-top: 0;" '; +} ?>
Default Value:
-
+
    + > +
diff --git a/test/fixtures/defaulttag.js b/test/fixtures/defaulttag.js index bd8461aa..e14d4f74 100644 --- a/test/fixtures/defaulttag.js +++ b/test/fixtures/defaulttag.js @@ -31,4 +31,9 @@ var win = getParentWindow(); /** @default */ -var header = getHeaders(request); \ No newline at end of file +var header = getHeaders(request); + +/** + @default + */ +var obj = { value_a : 'a', value_b : 'b' }; diff --git a/test/specs/tags/defaulttag.js b/test/specs/tags/defaulttag.js index ca4b086b..bd5987d4 100644 --- a/test/specs/tags/defaulttag.js +++ b/test/specs/tags/defaulttag.js @@ -5,8 +5,9 @@ describe("@default tag", function() { rcode = (docSet.getByLongname('rcode') || [])[0], rvalid = (docSet.getByLongname('rvalid') || [])[0], rerrored = (docSet.getByLongname('rerrored') || [])[0], - win = (docSet.getByLongname('win') || [])[0]; - header = (docSet.getByLongname('header') || [])[0]; + win = (docSet.getByLongname('win') || [])[0], + header = (docSet.getByLongname('header') || [])[0], + obj = docSet.getByLongname('obj')[0]; it('When symbol set to null has a @default tag with no text, the doclet\'s defaultValue property should be: null', function() { expect(request.defaultvalue).toBe('null'); @@ -36,4 +37,9 @@ describe("@default tag", function() { expect(header.defaultvalue).toBeUndefined(); }); -}); \ No newline at end of file + it('When symbol has a @default tag with an object.', function(){ + var expected_value = "{value_a: 'a', value_b: 'b'}"; + expect(obj.defaultvalue).toEqual(expected_value); + }) + +}); From a9a2ceff798fc39d011c0a7eeac28ca9a177a985 Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Thu, 9 May 2013 07:33:03 -0600 Subject: [PATCH 02/10] typo --- changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes.md b/changes.md index 1a1d9c78..ce003292 100644 --- a/changes.md +++ b/changes.md @@ -11,7 +11,7 @@ This file describes notable changes in each version of JSDoc 3. To download a sp ### Enhancements + The parser now fires a `parseBegin` event before it starts parsing files, as well as a `parseComplete` event after all files have been parsed. Plugins can define event handlers for these events, and `parseBegin` handlers can modify the list of files to parse. (#299) -+ Event handlers for `jsdocCommentFount` events can now modify the JSDoc comment. (#228) ++ Event handlers for `jsdocCommentFound` events can now modify the JSDoc comment. (#228) + You can now exclude tags from Markdown processing using the new option `markdown.excludeTags` in the configuration file. (#337) + You can now use the [marked](https://github.com/chjj/marked) Markdown parser by setting the configuration property `markdown.parser` to `marked`. In addition, if `markdown.parser` is set to `gfm`, JSDoc will now use the "marked" parser instead. (#385) + The `@typedef` tag no longer requires a name when used with a Closure Compiler-style type definition. For example, the following type definition will automatically get the name `Foo.Bar`: From d4ee1d324e690477f2559af20e3309df1a74976c Mon Sep 17 00:00:00 2001 From: Ernst Haagsman Date: Fri, 10 May 2013 11:29:16 +0200 Subject: [PATCH 03/10] Plugins: Created processingComplete event The processingComplete event fires after all processing has been done. It gets the entire docs as its only parameter. --- jsdoc.js | 2 ++ lib/jsdoc/src/parser.js | 4 ++++ plugins/eventDumper.js | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/jsdoc.js b/jsdoc.js index 0204ff61..405523e1 100644 --- a/jsdoc.js +++ b/jsdoc.js @@ -237,6 +237,8 @@ function main() { jsdoc.augment.addInherited(docs); jsdoc.borrow.resolveBorrows(docs); + app.jsdoc.parser.fireProcessingComplete(docs); + if (env.opts.explain) { dump(docs); process.exit(0); diff --git a/lib/jsdoc/src/parser.js b/lib/jsdoc/src/parser.js index d98b0829..7aa6b95b 100644 --- a/lib/jsdoc/src/parser.js +++ b/lib/jsdoc/src/parser.js @@ -97,6 +97,10 @@ exports.Parser.prototype.parse = function(sourceFiles, encoding) { return this._resultBuffer; }; +exports.Parser.prototype.fireProcessingComplete = function(docs) { + this.emit('processingComplete', docs); +}; + /** * @returns {Array} The accumulated results of any calls to parse. */ diff --git a/plugins/eventDumper.js b/plugins/eventDumper.js index 70eff028..27857455 100644 --- a/plugins/eventDumper.js +++ b/plugins/eventDumper.js @@ -19,7 +19,8 @@ var events = conf.include || [ 'symbolFound', 'newDoclet', 'fileComplete', - 'parseComplete' + 'parseComplete', + 'processingComplete' ]; // Don't dump the excluded parser events if (conf.exclude) { From 8fb1e5318d56933971c73858353ecfbd913bc16e Mon Sep 17 00:00:00 2001 From: Ernst Haagsman Date: Fri, 10 May 2013 14:28:55 +0200 Subject: [PATCH 04/10] @augments tag: Inherited members correctly identify their origin 'inherits' tag is only written if it is empty. Before this change all members inherited from the direct parent, even if it actually came from a grandparent. --- lib/jsdoc/augment.js | 5 ++++- test/specs/tags/augmentstag.js | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/jsdoc/augment.js b/lib/jsdoc/augment.js index eaa00a48..9ac7bbbb 100644 --- a/lib/jsdoc/augment.js +++ b/lib/jsdoc/augment.js @@ -90,7 +90,10 @@ function getAdditions(doclets, docs, longnames) { for (var k = 0, kk = members.length; k < kk; k++) { member = doop(members[k]); - member.inherits = member.longname; + if(!member.inherited) + { + member.inherits = member.longname; + } member.inherited = true; member.memberof = doc.longname; diff --git a/test/specs/tags/augmentstag.js b/test/specs/tags/augmentstag.js index fabc2ee0..98f15a6d 100644 --- a/test/specs/tags/augmentstag.js +++ b/test/specs/tags/augmentstag.js @@ -80,6 +80,15 @@ expect(bazMethod3.memberof).toBe("Baz"); }); + it('(Grand)children correctly identify the original source of inherited members', function(){ + expect(fooProp1.inherits).not.toBeDefined(); + expect(barProp3.inherits).not.toBeDefined(); + expect(barProp1.inherits).toBe("Foo#prop1"); + expect(bazProp2.inherits).toBe("Foo#prop2"); + expect(bazProp3.inherits).toBe("Bar#prop3"); + expect(bazMethod1.inherits).toBe("Foo#method1"); + }); + it('When an object is extended, and it overrides an ancestor property, the child does not include docs for the ancestor property.', function() { expect(bazProp1All.length).toBe(1); }); From 70109a29562e0bdbfd84c511fb952580cba699ff Mon Sep 17 00:00:00 2001 From: Ernst Haagsman Date: Wed, 15 May 2013 10:54:55 +0200 Subject: [PATCH 05/10] @default tag with object literals Changed boolean 'doclet.defaultobject' to 'doclet.defaultvaluetype' field. Improved unit testing and fixed template. --- lib/jsdoc/tag/dictionary/definitions.js | 4 ++-- templates/default/static/styles/jsdoc-default.css | 1 + templates/default/tmpl/details.tmpl | 8 ++++---- test/fixtures/defaulttag.js | 8 ++++++++ test/specs/tags/defaulttag.js | 12 +++++++++--- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/lib/jsdoc/tag/dictionary/definitions.js b/lib/jsdoc/tag/dictionary/definitions.js index 4c9b68f7..0bd66713 100644 --- a/lib/jsdoc/tag/dictionary/definitions.js +++ b/lib/jsdoc/tag/dictionary/definitions.js @@ -251,9 +251,9 @@ exports.defineTags = function(dictionary) { // TODO: handle escaped quotes in values doclet.defaultvalue = 'null'; } - else if (doclet.meta.code.type === 'OBJECTLIT'){ + else if (doclet.meta.code.type === 'OBJECTLIT') { doclet.defaultvalue = String(doclet.meta.code.node.toSource()); - doclet.defaultobject = true; + doclet.defaultvaluetype = 'object'; } } } diff --git a/templates/default/static/styles/jsdoc-default.css b/templates/default/static/styles/jsdoc-default.css index 327b17ad..cbcff70f 100644 --- a/templates/default/static/styles/jsdoc-default.css +++ b/templates/default/static/styles/jsdoc-default.css @@ -202,6 +202,7 @@ h6 .details ul { list-style-type: none; } .details li { margin-left: 30px; padding-top: 6px; } .details pre.prettyprint { margin: 0 } +.details .object-value { padding-top: 0; } .description { margin-bottom: 1em; diff --git a/templates/default/tmpl/details.tmpl b/templates/default/tmpl/details.tmpl index 141bd58a..a18dfdc0 100644 --- a/templates/default/tmpl/details.tmpl +++ b/templates/default/tmpl/details.tmpl @@ -1,12 +1,12 @@ " + data.defaultvalue + ""; - default_object_css = ' style="padding-top: 0;" '; + defaultObjectClass = ' class="object-value"'; } ?>
@@ -67,7 +67,7 @@ if (data.defaultvalue && data.defaultobject){
Default Value:
    - > + >
diff --git a/test/fixtures/defaulttag.js b/test/fixtures/defaulttag.js index e14d4f74..996033a7 100644 --- a/test/fixtures/defaulttag.js +++ b/test/fixtures/defaulttag.js @@ -37,3 +37,11 @@ var header = getHeaders(request); @default */ var obj = { value_a : 'a', value_b : 'b' }; + +/** + * @default + */ +var multilineObject = { + value_a : 'a', + value_b : 'b' +}; diff --git a/test/specs/tags/defaulttag.js b/test/specs/tags/defaulttag.js index bd5987d4..c9a83032 100644 --- a/test/specs/tags/defaulttag.js +++ b/test/specs/tags/defaulttag.js @@ -7,7 +7,8 @@ describe("@default tag", function() { rerrored = (docSet.getByLongname('rerrored') || [])[0], win = (docSet.getByLongname('win') || [])[0], header = (docSet.getByLongname('header') || [])[0], - obj = docSet.getByLongname('obj')[0]; + obj = docSet.getByLongname('obj')[0], + multilineObject = docSet.getByLongname('multilineObject')[0]; it('When symbol set to null has a @default tag with no text, the doclet\'s defaultValue property should be: null', function() { expect(request.defaultvalue).toBe('null'); @@ -37,9 +38,14 @@ describe("@default tag", function() { expect(header.defaultvalue).toBeUndefined(); }); - it('When symbol has a @default tag with an object.', function(){ + it('When symbol has a @default tag with an object, the doclet\'s defaultValue property should contain the stringified object', function() { var expected_value = "{value_a: 'a', value_b: 'b'}"; expect(obj.defaultvalue).toEqual(expected_value); - }) + }); + + it('When symbol has a @default tag with a multiline object, the doclet\'s defaultValue property should contain the properly stringified object', function() { + var expected_value = "{value_a: 'a', value_b: 'b'}"; + expect(obj.defaultvalue).toEqual(expected_value); + }); }); From 93859fe94c5e9d11224c16eec997076cb286cbf1 Mon Sep 17 00:00:00 2001 From: Ernst Haagsman Date: Wed, 15 May 2013 11:18:03 +0200 Subject: [PATCH 06/10] processingComplete event: covered by unit tests The processingComplete event now contains an object with the docs array under the 'doclets' key. The event is now covered by a unit test. --- jsdoc.js | 2 +- lib/jsdoc/src/parser.js | 4 ++-- test/specs/jsdoc/src/parser.js | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/jsdoc.js b/jsdoc.js index 405523e1..28052b6e 100644 --- a/jsdoc.js +++ b/jsdoc.js @@ -237,7 +237,7 @@ function main() { jsdoc.augment.addInherited(docs); jsdoc.borrow.resolveBorrows(docs); - app.jsdoc.parser.fireProcessingComplete(docs); + app.jsdoc.parser.fireProcessingComplete({doclets: docs}); if (env.opts.explain) { dump(docs); diff --git a/lib/jsdoc/src/parser.js b/lib/jsdoc/src/parser.js index 7aa6b95b..c3ef6c42 100644 --- a/lib/jsdoc/src/parser.js +++ b/lib/jsdoc/src/parser.js @@ -97,8 +97,8 @@ exports.Parser.prototype.parse = function(sourceFiles, encoding) { return this._resultBuffer; }; -exports.Parser.prototype.fireProcessingComplete = function(docs) { - this.emit('processingComplete', docs); +exports.Parser.prototype.fireProcessingComplete = function(doclets) { + this.emit('processingComplete', doclets); }; /** diff --git a/test/specs/jsdoc/src/parser.js b/test/specs/jsdoc/src/parser.js index d1794dee..2de67b7e 100644 --- a/test/specs/jsdoc/src/parser.js +++ b/test/specs/jsdoc/src/parser.js @@ -77,6 +77,14 @@ describe("jsdoc/src/parser", function() { expect(spy).toHaveBeenCalled(); expect(spy.mostRecentCall.args[0].sourcefiles).toEqual(["[[string0]]"]); }); + + it("should fire processingComplete when fireProcessingComplete is called", function() { + var spy = jasmine.createSpy(), + doclets = {doclets: ['a','b']}; + parser.on('processingComplete', spy).fireProcessingComplete(doclets); + expect(spy).toHaveBeenCalled(); + expect(spy.mostRecentCall.args[0]).toEqual(doclets); + }); it("should be able to parse its own source file", function() { var fs = require('jsdoc/fs'), From 11be32b3257a86256985042671f3f19e78b4eeee Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Sun, 2 Jun 2013 16:49:49 -0700 Subject: [PATCH 07/10] fireProcessingComplete cleanup --- jsdoc.js | 2 +- lib/jsdoc/src/parser.js | 2 +- test/specs/jsdoc/src/parser.js | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/jsdoc.js b/jsdoc.js index 28052b6e..405523e1 100644 --- a/jsdoc.js +++ b/jsdoc.js @@ -237,7 +237,7 @@ function main() { jsdoc.augment.addInherited(docs); jsdoc.borrow.resolveBorrows(docs); - app.jsdoc.parser.fireProcessingComplete({doclets: docs}); + app.jsdoc.parser.fireProcessingComplete(docs); if (env.opts.explain) { dump(docs); diff --git a/lib/jsdoc/src/parser.js b/lib/jsdoc/src/parser.js index c3ef6c42..5188cfe3 100644 --- a/lib/jsdoc/src/parser.js +++ b/lib/jsdoc/src/parser.js @@ -98,7 +98,7 @@ exports.Parser.prototype.parse = function(sourceFiles, encoding) { }; exports.Parser.prototype.fireProcessingComplete = function(doclets) { - this.emit('processingComplete', doclets); + this.emit('processingComplete', { doclets: doclets }); }; /** diff --git a/test/specs/jsdoc/src/parser.js b/test/specs/jsdoc/src/parser.js index 2de67b7e..d75f554a 100644 --- a/test/specs/jsdoc/src/parser.js +++ b/test/specs/jsdoc/src/parser.js @@ -80,10 +80,12 @@ describe("jsdoc/src/parser", function() { it("should fire processingComplete when fireProcessingComplete is called", function() { var spy = jasmine.createSpy(), - doclets = {doclets: ['a','b']}; + doclets = ['a','b']; parser.on('processingComplete', spy).fireProcessingComplete(doclets); expect(spy).toHaveBeenCalled(); - expect(spy.mostRecentCall.args[0]).toEqual(doclets); + expect(typeof spy.mostRecentCall.args[0]).toBe('object'); + expect(spy.mostRecentCall.args[0].doclets).toBeDefined(); + expect(spy.mostRecentCall.args[0].doclets).toBe(doclets); }); it("should be able to parse its own source file", function() { From 32d00c20ca3f12b471fde012d808c4b863dc143b Mon Sep 17 00:00:00 2001 From: Louis-Dominique Dubeau Date: Fri, 21 Jun 2013 10:03:26 -0400 Subject: [PATCH 08/10] Changes to allow target and text in {@link target text} to be separated by newlines and for text to contain newlines. --- lib/jsdoc/tag/inline.js | 2 +- lib/jsdoc/util/templateHelper.js | 4 +++- test/specs/jsdoc/util/templateHelper.js | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/jsdoc/tag/inline.js b/lib/jsdoc/tag/inline.js index b425ef87..8be46e26 100644 --- a/lib/jsdoc/tag/inline.js +++ b/lib/jsdoc/tag/inline.js @@ -61,7 +61,7 @@ exports.replaceInlineTags = function(string, replacers) { string = string || ''; Object.keys(replacers).forEach(function(replacer) { - var tagRegExp = new RegExp('\\{@' + replacer + '\\s+(.+?)\\}', 'gi'); + var tagRegExp = new RegExp('\\{@' + replacer + '\\s+((?:.|\n)+?)\\}', 'gi'); var matches; // call the replacer once for each match while ( (matches = tagRegExp.exec(string)) !== null ) { diff --git a/lib/jsdoc/util/templateHelper.js b/lib/jsdoc/util/templateHelper.js index 61b1ecc5..739f2cc3 100644 --- a/lib/jsdoc/util/templateHelper.js +++ b/lib/jsdoc/util/templateHelper.js @@ -256,11 +256,13 @@ function splitLinkText(text) { // if a pipe is not present, we split on the first space splitIndex = text.indexOf('|'); if (splitIndex === -1) { - splitIndex = text.indexOf(' '); + splitIndex = text.search(/\s/); } if (splitIndex !== -1) { linkText = text.substr(splitIndex + 1); + // Normalize subsequent newlines to a single space. + linkText = linkText.replace(/\n+/, ' '); target = text.substr(0, splitIndex); } diff --git a/test/specs/jsdoc/util/templateHelper.js b/test/specs/jsdoc/util/templateHelper.js index 3e8e8cdb..9b944248 100644 --- a/test/specs/jsdoc/util/templateHelper.js +++ b/test/specs/jsdoc/util/templateHelper.js @@ -1170,6 +1170,22 @@ describe("jsdoc/util/templateHelper", function() { expect(output).toBe('This is a test.'); }); + it('should allow linebreaks to separate url from link text', function() { + var input = 'This is a {@link\ntest\ntest}.', + output = helper.resolveLinks(input); + + expect(output).toBe('This is a test.'); + }); + + + it('should normalize additional newlines to spaces', function() { + var input = 'This is a {@link\ntest\ntest\n\ntest}.', + output = helper.resolveLinks(input); + + expect(output).toBe('This is a test test.'); + }); + + it('should allow tabs between link tag and content', function() { var input = 'This is a {@link\ttest}.', output = helper.resolveLinks(input); From c16f6dc0ef1d06f923a9b0d0d0487f5b8e635f31 Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Sun, 23 Jun 2013 15:13:36 -0700 Subject: [PATCH 09/10] fix failing tests on windows (#420) --- test/specs/jsdoc/src/filter.js | 2 +- test/specs/tags/exampletag.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/specs/jsdoc/src/filter.js b/test/specs/jsdoc/src/filter.js index c34d0aae..98593378 100644 --- a/test/specs/jsdoc/src/filter.js +++ b/test/specs/jsdoc/src/filter.js @@ -2,7 +2,7 @@ describe("jsdoc/src/filter", function() { var filter = new (require('jsdoc/src/filter').Filter)({ includePattern: new RegExp(".+\\.js(doc)?$"), - excludePattern: new RegExp("(^|\\/)_"), + excludePattern: new RegExp("(^|\\/|\\\\)_"), exclude: ['.ignore', 'scratch/conf.js'] }); diff --git a/test/specs/tags/exampletag.js b/test/specs/tags/exampletag.js index 8d1673c6..6e817177 100644 --- a/test/specs/tags/exampletag.js +++ b/test/specs/tags/exampletag.js @@ -2,21 +2,21 @@ describe("@example tag", function() { var docSet = jasmine.getDocSetFromFile('test/fixtures/exampletag.js'), doc = docSet.getByLongname('x')[0], doc2 = docSet.getByLongname('y')[0], - txt = 'console.log("foo");\nconsole.log("bar");', - txt2 = 'Example 2\n1 + 2;'; + txtRegExp = new RegExp('console\\.log\\("foo"\\);[\\r\\n]{1,2}console\\.log\\("bar"\\);'), + txt2RegExp = new RegExp('Example 2[\\r\\n]{1,2}1 \\+ 2;'); it("creates an 'examples' property on the doclet with the example", function() { expect(doc.examples).toBeDefined(); expect(Array.isArray(doc.examples)).toBe(true); expect(doc.examples.length).toBe(1); - expect(doc.examples).toContain(txt); + expect(doc.examples).toMatch(txtRegExp); }); it("can be specified multiple times on one doclet", function() { expect(doc2.examples).toBeDefined(); expect(Array.isArray(doc2.examples)).toBe(true); expect(doc2.examples.length).toBe(2); - expect(doc2.examples).toContain(txt); - expect(doc2.examples).toContain(txt2); + expect(doc2.examples).toMatch(txtRegExp); + expect(doc2.examples).toMatch(txt2RegExp); }); }); From a507eced37137ee246fcea766121e6963c869eb8 Mon Sep 17 00:00:00 2001 From: Jeff Williams Date: Sun, 23 Jun 2013 15:21:19 -0700 Subject: [PATCH 10/10] fail when a nonexistent config file is specified (#425) --- jsdoc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsdoc.js b/jsdoc.js index 405523e1..b1f27885 100644 --- a/jsdoc.js +++ b/jsdoc.js @@ -170,7 +170,7 @@ function main() { env.opts = jsdoc.opts.args.parse(env.args); confPath = env.opts.configure || path.join(__dirname, 'conf.json'); - if ( !fs.statSync(confPath).isFile() ) { + if ( !fs.statSync(confPath).isFile() && !env.opts.configure ) { confPath = path.join(__dirname, 'conf.json.EXAMPLE'); }