Skip to content

Commit

Permalink
Merge pull request #944 from alexgorbatchev/alexgorbatchev/issue-842
Browse files Browse the repository at this point in the history
Fixes `Cannot read property 'some' of undefined`
  • Loading branch information
ljharb committed Oct 13, 2017
2 parents 1958e0b + c246b9e commit cef88f2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/ExportMap.js
Expand Up @@ -330,17 +330,19 @@ ExportMap.parse = function (path, content, context) {
})

// attempt to collect module doc
ast.comments.some(c => {
if (c.type !== 'Block') return false
try {
const doc = doctrine.parse(c.value, { unwrap: true })
if (doc.tags.some(t => t.title === 'module')) {
m.doc = doc
return true
}
} catch (err) { /* ignore */ }
return false
})
if (ast.comments) {
ast.comments.some(c => {
if (c.type !== 'Block') return false
try {
const doc = doctrine.parse(c.value, { unwrap: true })
if (doc.tags.some(t => t.title === 'module')) {
m.doc = doc
return true
}
} catch (err) { /* ignore */ }
return false
})
}

const namespaces = new Map()

Expand Down

0 comments on commit cef88f2

Please sign in to comment.