Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
fixup: fix call to CJSModule
Browse files Browse the repository at this point in the history
  • Loading branch information
MylesBorins committed Mar 9, 2019
1 parent 7d97619 commit 3be2e38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/internal/main/check_syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const {

const { pathToFileURL } = require('url');

const CJSModule = require('internal/modules/cjs/loader');
let CJSModule;
const vm = require('vm');
const {
stripShebang, stripBOM
Expand All @@ -27,6 +27,7 @@ if (process.argv[1] && process.argv[1] !== '-') {

// TODO(joyeecheung): not every one of these are necessary
prepareMainThreadExecution();
CJSModule = require('internal/modules/cjs/loader');

// Read the source.
const filename = CJSModule._resolveFilename(process.argv[1]);
Expand All @@ -40,6 +41,7 @@ if (process.argv[1] && process.argv[1] !== '-') {
} else {
// TODO(joyeecheung): not every one of these are necessary
prepareMainThreadExecution();
CJSModule = require('internal/modules/cjs/loader');
markBootstrapComplete();

readStdin((code) => {
Expand Down

0 comments on commit 3be2e38

Please sign in to comment.