Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Verify that the named export is not resolved before throwing a ERR_EX…
Browse files Browse the repository at this point in the history
…PORT_MISSING. [closes #544]
  • Loading branch information
jdalton committed Aug 6, 2018
1 parent 9a3f1e5 commit 0ce89d1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/module/esm/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,15 @@ function validateExportedName(entry, exportedName, seen) {

if (seen &&
Reflect.has(seen, name)) {
if (exportedStars.indexOf(exportedSpecifiers[exportedName].specifier) === -1) {
const { specifier } = exportedSpecifiers[exportedName]
const childEntry = dependencySpecifiers[specifier].entry

if (exportedStars.indexOf(specifier) === -1) {
throw new ERR_EXPORT_CYCLE(mod, exportedName)
} else {
} else if (childEntry.compileData.exportedSpecifiers[exportedName] !== true) {
throw new ERR_EXPORT_MISSING(mod, exportedName)
}
}

if (Reflect.has(exportedSpecifiers, exportedName)) {
} else if (Reflect.has(exportedSpecifiers, exportedName)) {
const exportedSpecifier = exportedSpecifiers[exportedName]

if (exportedSpecifier) {
Expand Down

0 comments on commit 0ce89d1

Please sign in to comment.