diff --git a/rhino_modules/jsdoc/src/parser.js b/rhino_modules/jsdoc/src/parser.js index b2fa3710..0bca33a9 100644 --- a/rhino_modules/jsdoc/src/parser.js +++ b/rhino_modules/jsdoc/src/parser.js @@ -122,7 +122,7 @@ function pretreat(code) { // make lent objectliterals documentable by giving them a dummy name .replace(/(\/\*\*[\s\S]*?@lends\b[\s\S]*?\*\/\s*)\{/g, '$1____ = {') // make starbangstar comments look like real jsdoc comments - .replace(/\/\*\!\*/g, '/***'); + .replace(/\/\*\!\*/g, '/**'); } /** diff --git a/test/cases/starbangstar.js b/test/cases/starbangstar.js index a0456352..262da969 100644 --- a/test/cases/starbangstar.js +++ b/test/cases/starbangstar.js @@ -1,7 +1,12 @@ -/** +/*!* * Script that does something awesome * * @copyright (c) 2011 Rotorz Limited. All rights reserved. * @author Lea Hayes * @module myscript/core -*/ \ No newline at end of file +*/ + +/*!********************************* + * This should be ignored by JSDoc + * @var x + */ \ No newline at end of file diff --git a/test/t/cases/starbangstar.js b/test/t/cases/starbangstar.js index 0f040ff5..811aa370 100644 --- a/test/t/cases/starbangstar.js +++ b/test/t/cases/starbangstar.js @@ -1,9 +1,14 @@ (function() { var docSet = testhelpers.getDocSetFromFile('test/cases/starbangstar.js'), - mod = docSet.getByLongname('module:myscript/core')[0]; - + mod = docSet.getByLongname('module:myscript/core')[0], + x = docSet.getByLongname('module:myscript/core.x')[0]; + test('When doclet starts wuth /*!* it, it is treated as a JSDoc comment.', function() { assert.equal(mod.description, 'Script that does something awesome'); }); + + test('When doclet starts wuth /*!** it, it is not treated as a JSDoc comment.', function() { + assert.equal(typeof x, 'undefined'); + }); })(); \ No newline at end of file