Skip to content

Commit

Permalink
import-js#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 68f63f5 commit f89152b
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/ExportMap.js
Original file line number Diff line number Diff line change
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 f89152b

Please sign in to comment.