fix performance regression caused by 2eb3c46 (#784)

This commit is contained in:
Jeff Williams 2014-10-15 09:38:19 -07:00
parent 2b34c5167a
commit c510b336d2

View File

@ -455,7 +455,7 @@ Parser.prototype.resolvePropertyParents = function(node) {
doclets.push(doclet);
}
// if the next ancestor's parent is an assignment expression (for example, `exports.FOO` in
// if the next ancestor is an assignment expression (for example, `exports.FOO` in
// `var foo = exports.FOO = { x: 1 }`, keep walking upwards
if (nextAncestor && nextAncestor.type === Syntax.AssignmentExpression) {
nextAncestor = nextAncestor.parent;
@ -512,14 +512,15 @@ Parser.prototype.resolveEnum = function(e) {
// members of an enum inherit the enum's type
if (doclet.type && !e.doclet.type) {
e.doclet.type = doclet.type;
// clone the type to prevent circular refs
e.doclet.type = jsdoc.util.doop(doclet.type);
}
delete e.doclet.undocumented;
e.doclet.defaultvalue = e.doclet.meta.code.value;
// add a copy of the doclet to the parent's properties
doclet.properties.push( jsdoc.util.doop(e.doclet) );
// add the doclet to the parent's properties
doclet.properties.push(e.doclet);
}
});
};