fix duplicate comments being output, breaking code

This commit is contained in:
Sebastian McKenzie 2014-12-29 11:13:50 +11:00
parent 52ffc65a06
commit 74a84e2473
2 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ Gaps between patch versions are faulty/broken releases.
## 2.2.0
* Make `system` module formatter modules anonymous by default.
* Fix duplicate comments being output, breaking code.
## 2.1.0

View File

@ -293,8 +293,9 @@ t.removeComments = function (child) {
};
t.inheritsComments = function (child, parent) {
child.leadingComments = _.compact([].concat(child.leadingComments, parent.leadingComments));
child.trailingComments = _.compact([].concat(child.trailingComments, parent.trailingComments));
_.each(["leadingComments", "trailingComments"], function (key) {
child[key] = _.uniq(_.compact([].concat(child[key], parent[key])));
});
return child;
};