add existence check for child and parent when inheriting comments

This commit is contained in:
Sebastian McKenzie 2015-03-28 04:00:02 +11:00
parent 06a58f228c
commit de42a6f796

View File

@ -267,9 +267,11 @@ export function removeComments(child: Object): Object {
*/
export function inheritsComments(child: Object, parent: Object): Object {
each(COMMENT_KEYS, function (key) {
child[key] = uniq(compact([].concat(child[key], parent[key])));
});
if (child && parent) {
each(COMMENT_KEYS, function (key) {
child[key] = uniq(compact([].concat(child[key], parent[key])));
});
}
return child;
}