Skip to content

Commit

Permalink
damnnnn, curly. back at it again with indented blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
benmosher committed May 11, 2016
1 parent c862b68 commit 464cb47
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
56 changes: 31 additions & 25 deletions src/core/getExports.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,15 @@ export default class ExportMap {
if (this.reexports.has(name)) return true

// default exports must be explicitly re-exported (#328)
if (name !== 'default') for (let dep of this.dependencies.values()) {
let innerMap = dep()
if (name !== 'default') {
for (let dep of this.dependencies.values()) {
let innerMap = dep()

// todo: report as unresolved?
if (!innerMap) continue
// todo: report as unresolved?
if (!innerMap) continue

if (innerMap.has(name)) return true
if (innerMap.has(name)) return true
}
}

return false
Expand Down Expand Up @@ -267,18 +269,20 @@ export default class ExportMap {


// default exports must be explicitly re-exported (#328)
if (name !== 'default') for (let dep of this.dependencies.values()) {
let innerMap = dep()
// todo: report as unresolved?
if (!innerMap) continue

// safeguard against cycles
if (innerMap.path === this.path) continue

let innerValue = innerMap.hasDeep(name)
if (innerValue.found) {
innerValue.path.unshift(this)
return innerValue
if (name !== 'default') {
for (let dep of this.dependencies.values()) {
let innerMap = dep()
// todo: report as unresolved?
if (!innerMap) continue

// safeguard against cycles
if (innerMap.path === this.path) continue

let innerValue = innerMap.hasDeep(name)
if (innerValue.found) {
innerValue.path.unshift(this)
return innerValue
}
}
}

Expand All @@ -302,16 +306,18 @@ export default class ExportMap {
}

// default exports must be explicitly re-exported (#328)
if (name !== 'default') for (let dep of this.dependencies.values()) {
let innerMap = dep()
// todo: report as unresolved?
if (!innerMap) continue
if (name !== 'default') {
for (let dep of this.dependencies.values()) {
let innerMap = dep()
// todo: report as unresolved?
if (!innerMap) continue

// safeguard against cycles
if (innerMap.path === this.path) continue
// safeguard against cycles
if (innerMap.path === this.path) continue

let innerValue = innerMap.get(name)
if (innerValue !== undefined) return innerValue
let innerValue = innerMap.get(name)
if (innerValue !== undefined) return innerValue
}
}

return undefined
Expand Down
5 changes: 4 additions & 1 deletion src/rules/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ module.exports = function (context) {
return
}
let any = false
remoteExports.forEach((v, name) => name !== 'default' && (any = true) && addNamed(name, node))
remoteExports.forEach((v, name) =>
name !== 'default' &&
(any = true) && // poor man's filter
addNamed(name, node))

if (!any) {
context.report(node.source,
Expand Down

0 comments on commit 464cb47

Please sign in to comment.