From e384a06b455ae1a165bb9b8c22763aae376d2905 Mon Sep 17 00:00:00 2001 From: mathematicalcoffee Date: Fri, 8 Feb 2013 10:03:47 +1000 Subject: [PATCH] FIX: dictionary.isNamespace should do the lookup under the normalised name --- lib/jsdoc/tag/dictionary.js | 7 +++++-- test/specs/jsdoc/tag/dictionary.js | 5 ++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/jsdoc/tag/dictionary.js b/lib/jsdoc/tag/dictionary.js index c10f8f22..18190502 100644 --- a/lib/jsdoc/tag/dictionary.js +++ b/lib/jsdoc/tag/dictionary.js @@ -57,8 +57,11 @@ dictionary = { /** @function */ isNamespace: function(kind) { - if ( _namespaces.indexOf(kind) !== -1) { - return true; + if (kind) { + kind = dictionary.normalise(kind); + if ( _namespaces.indexOf(kind) !== -1) { + return true; + } } return false; diff --git a/test/specs/jsdoc/tag/dictionary.js b/test/specs/jsdoc/tag/dictionary.js index dfa37525..6c0768b9 100644 --- a/test/specs/jsdoc/tag/dictionary.js +++ b/test/specs/jsdoc/tag/dictionary.js @@ -71,12 +71,11 @@ describe('jsdoc/tag/dictionary', function() { }); describe("isNamespace", function() { - // TODO: BUG: isNamespace should use a normalised title. - xit("returns whether a tag is a namespace when using its canonical name", function() { + it("returns whether a tag is a namespace when using its canonical name", function() { expect(dictionary.isNamespace(tagTitle)).toEqual(true); }); - xit("returns whether a tag is a namespace when using its synonym", function() { + it("returns whether a tag is a namespace when using its synonym", function() { expect(dictionary.isNamespace(tagSynonym)).toEqual(true); });