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

Commit

Permalink
fixup: fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MylesBorins committed Mar 10, 2019
1 parent 73641ad commit 02bcd09
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/internal/main/check_syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ const {

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

const CJSModule = require('internal/modules/cjs/loader');
const vm = require('vm');
const {
stripShebang, stripBOM
} = require('internal/modules/cjs/helpers');

let CJSModule;
function CJSModuleInit() {
if (!CJSModule)
CJSModule = require('internal/modules/cjs/loader');
}

if (process.argv[1] && process.argv[1] !== '-') {
// Expand process.argv[1] into a full path.
Expand All @@ -27,7 +31,7 @@ if (process.argv[1] && process.argv[1] !== '-') {

// TODO(joyeecheung): not every one of these are necessary
prepareMainThreadExecution();

CJSModuleInit();
// Read the source.
const filename = CJSModule._resolveFilename(process.argv[1]);

Expand All @@ -40,6 +44,7 @@ if (process.argv[1] && process.argv[1] !== '-') {
} else {
// TODO(joyeecheung): not every one of these are necessary
prepareMainThreadExecution();
CJSModuleInit();
markBootstrapComplete();

readStdin((code) => {
Expand Down

0 comments on commit 02bcd09

Please sign in to comment.