correctly handle symbols named prototype (#891)

This commit is contained in:
Jeff Williams 2015-01-24 09:09:31 -08:00
parent 17c58d76e5
commit 8ad4b49b3f
2 changed files with 7 additions and 4 deletions

View File

@ -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);
}

View File

@ -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();
});
});