Skip to content

Commit

Permalink
Merge pull request #396 from btd/master
Browse files Browse the repository at this point in the history
Fix when you want to document Object.prototype's methods
  • Loading branch information
tmcw committed Mar 26, 2016
2 parents b66478d + 5b51891 commit 3883cb4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/hierarchy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

var hasOwnProperty = Object.prototype.hasOwnProperty;

/**
* @param {Array<Object>} comments an array of parsed comments
* @returns {Array<Object>} nested comments, with only root comments
Expand All @@ -9,8 +11,8 @@ module.exports = function (comments) {
var id = 0,
root = {
members: {
instance: {},
static: {}
instance: Object.create(null),
static: Object.create(null)
}
};

Expand Down Expand Up @@ -44,12 +46,12 @@ module.exports = function (comments) {
scope = segment[0],
name = segment[1];

if (!node.members[scope].hasOwnProperty(name)) {
if (!hasOwnProperty.call(node.members[scope], name)) {
node.members[scope][name] = {
comments: [],
members: {
instance: {},
static: {}
instance: Object.create(null),
static: Object.create(null)
}
};
}
Expand Down

0 comments on commit 3883cb4

Please sign in to comment.