Skip to content

Commit

Permalink
fix warnings in runner
Browse files Browse the repository at this point in the history
  • Loading branch information
jpolitz committed Sep 20, 2019
1 parent 4d03581 commit 3a9fbcd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/webworker/runner.ts
Expand Up @@ -129,6 +129,7 @@ export const makeRequireAsync = (
fs.writeFileSync(stoppedPath, stopifiedCode);
}
currentRunner.evalCompiled(stopifiedCode, (result: any) => {
cwd = oldWd;
if(result.type !== "normal") {
kontinue(result);
return;
Expand Down Expand Up @@ -176,6 +177,9 @@ export const makeRequire = (basePath: string): ((importPath: string) => any) =>
const contents = fs.readFileSync(nextPath);
// TS 'export' syntax desugars to 'exports.name = value;'
// Adding an 'exports' parameter simulates the global 'exports' variable
// Also, the comment below has meaning to eslint and makes it ignore the
// use of the Function constructor (which we do intend)
// eslint-disable-next-line
const f = new Function("require", "module", "exports", contents);
const module = {
exports: {
Expand Down

0 comments on commit 3a9fbcd

Please sign in to comment.