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

Commit

Permalink
fixup! Pass all globals through "require"
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykuzmin authored and codebytere committed Aug 29, 2018
1 parent 761652c commit eed3eed
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ const {
CHAR_9,
} = require('internal/constants');

// Store the global context into a local variable, so we can refrence them in
// this scope even after we deleted them from global context.
const localGlobal = global;

function stat(filename) {
const internalModuleStat = process.binding('fs').internalModuleStat;
filename = path.toNamespacedPath(filename);
Expand Down Expand Up @@ -691,11 +687,10 @@ Module.prototype._compile = function(content, filename) {
if (inspectorWrapper) {
result = inspectorWrapper(compiledWrapper, this.exports, this.exports,
require, this, filename, dirname, process,
localGlobal, localGlobal.Buffer);
global, Buffer);
} else {
result = compiledWrapper.call(this.exports, this.exports, require, this,
filename, dirname, process, localGlobal,
localGlobal.Buffer);
filename, dirname, process, global, Buffer);
}
if (depth === 0) stat.cache = null;
return result;
Expand Down

0 comments on commit eed3eed

Please sign in to comment.