Skip to content

Commit

Permalink
#842 Fixes Cannot read property 'some' of undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgorbatchev committed Oct 13, 2017
1 parent 1958e0b commit c246b9e
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 c246b9e

Please sign in to comment.