Skip to content

Commit

Permalink
eval-addons: relative modules should not be exposed to global
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Aug 26, 2020
1 parent 3bfc694 commit 8cd0ff8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/plugin-eval-addons/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,12 @@ async function createModule(path: string) {
module = modules[identifier] = new SourceTextModule(outputText, { context, identifier })
}

logger.debug('creating module %c', module.identifier)
const type = module instanceof SyntheticModule ? 'synthetic' : 'source text'
logger.debug('creating %s module %c', type, module.identifier)
await module.link(linker)
await module.evaluate()

if (module instanceof SourceTextModule) {
if (!path.includes('/')) {
internal.setGlobal(path, module.namespace)
}
return module
Expand Down

0 comments on commit 8cd0ff8

Please sign in to comment.