diff --git a/lib/jsdoc/name.js b/lib/jsdoc/name.js index d7a88bc8..b122b442 100644 --- a/lib/jsdoc/name.js +++ b/lib/jsdoc/name.js @@ -74,6 +74,11 @@ function nameIsLongname(name, memberof) { } function prototypeToPunc(name) { + // don't mangle symbols named "prototype" + if (name === 'prototype') { + return name; + } + return name.replace(/(?:^|\.)prototype\.?/g, SCOPE.PUNC.INSTANCE); } diff --git a/test/specs/documentation/specialnames.js b/test/specs/documentation/specialnames.js index bd5dab68..f14e05e1 100644 --- a/test/specs/documentation/specialnames.js +++ b/test/specs/documentation/specialnames.js @@ -20,13 +20,11 @@ describe('documenting symbols with special names', function() { expect(hasOwnProp).toBeDefined(); }); - // currently broken: https://github.com/jsdoc3/jsdoc/issues/891 - xit('When a symbol is named "prototype", the symbol should appear in the docs.', function() { + it('When a symbol is named "prototype", the symbol should appear in the docs.', function() { expect(proto).toBeDefined(); }); - // currently broken: https://github.com/jsdoc3/jsdoc/issues/891 - xit('When a symbol is named "prototype", its members are resolved correctly.', function() { + it('When a symbol is named "prototype", its members are resolved correctly.', function() { expect(protoValueOf).toBeDefined(); }); });