diff --git a/rhino_modules/jsdoc/opts/parser.js b/rhino_modules/jsdoc/opts/parser.js index 03839914..c1cbefc4 100644 --- a/rhino_modules/jsdoc/opts/parser.js +++ b/rhino_modules/jsdoc/opts/parser.js @@ -12,8 +12,7 @@ var common = { var argParser = new common.args.ArgParser(), ourOptions, defaults = { - destination: './out/', - strict: true + destination: './out/' }; argParser.addOption('t', 'template', true, 'The name of the template to use. Default: the "default" template'); @@ -23,7 +22,7 @@ argParser.addOption('T', 'test', false, 'Run all tests and quit.'); argParser.addOption('d', 'destination', true, 'The path to the output folder. Use "console" to dump data to the console. Default: console'); argParser.addOption('p', 'private', false, 'Display symbols marked with the @private tag. Default: false.'); argParser.addOption('r', 'recurse', false, 'Recurse into subdirectories when scanning for source code files.'); -argParser.addOption('s', 'strict', false, 'Exit immediately if a doclet is incomplete or contains errors. Default: true'); +argParser.addOption('l', 'lenient', false, 'Continue to generate output if a doclet is incomplete or contains errors. Default: false.'); argParser.addOption('h', 'help', false, 'Print this message and quit.'); argParser.addOption('X', 'explain', false, 'Dump all found doclet internals to console and quit.'); argParser.addOption('q', 'query', true, 'Provide a querystring to define custom variable names/values to add to the options hash.'); diff --git a/rhino_modules/jsdoc/tag.js b/rhino_modules/jsdoc/tag.js index db02bcc3..2368c5ef 100644 --- a/rhino_modules/jsdoc/tag.js +++ b/rhino_modules/jsdoc/tag.js @@ -86,15 +86,15 @@ exports.Tag = function(tagTitle, tagBody, meta) { } } - // validate the tag. for strict validation, throw an exception; otherwise, log a warning. + // validate the tag. in lenient mode, log a warning; otherwise, throw an exception. try { jsdoc.tag.validator.validate(this, meta); } catch (e) { - if (env.opts.strict) { - throw e; - } else { + if (env.opts.lenient) { console.log(e); + } else { + throw e; } } } diff --git a/test/specs/jsdoc/tag.js b/test/specs/jsdoc/tag.js index e2624338..eb701fab 100644 --- a/test/specs/jsdoc/tag.js +++ b/test/specs/jsdoc/tag.js @@ -8,31 +8,29 @@ describe("jsdoc/tag", function() { return tag; } - it("has strict validation enabled by default", function() { + it("is strict, not lenient, by default", function() { expect(badTag).toThrow(); }); - it("throws an exception for bad tags if strict validation is enabled", function() { - var strict = !!env.opts.strict; - - env.opts.strict = true; + it("throws an exception for bad tags if the lenient option is not enabled", function() { + var lenient = !!env.opts.lenient; + env.opts.lenient = false; expect(badTag).toThrow(); - env.opts.strict = strict; + env.opts.lenient = lenient; }); - it("doesn't throw an exception for bad tags if strict validation is disabled", function() { + it("doesn't throw an exception for bad tags if the lenient option is enabled", function() { /*jshint evil: true */ - var strict = !!env.opts.strict, - log = new Function(console.log); - + var lenient = !!env.opts.lenient, + log = eval(console.log); console.log = function() {}; - env.opts.strict = false; + env.opts.lenient = true; expect(badTag).not.toThrow(); - env.opts.strict = strict; + env.opts.lenient = lenient; console.log = log; }); }); \ No newline at end of file