Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fs: add a temporary fix for re-evaluation support" #6413

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 1 addition & 36 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,42 +40,7 @@ const isWindows = process.platform === 'win32';

const DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
const errnoException = util._errnoException;

var printDeprecation;
try {
printDeprecation = require('internal/util').printDeprecationMessage;
} catch (e) {
if (e.code !== 'MODULE_NOT_FOUND') throw e;

// TODO(ChALkeR): remove this in master after 6.x
// This code was based upon internal/util and is required to give users
// a grace period before actually breaking modules that re-evaluate fs
// sources from context where internal modules are not allowed, e.g.
// older versions of graceful-fs module.

const prefix = `(${process.release.name}:${process.pid}) `;

printDeprecation = function(msg, warned) {
if (process.noDeprecation)
return true;

if (warned)
return warned;

if (process.throwDeprecation)
throw new Error(`${prefix}${msg}`);
else if (process.traceDeprecation)
console.trace(msg);
else
console.error(`${prefix}${msg}`);

return true;
};
printDeprecation('fs: re-evaluating native module sources is not ' +
'supported. If you are using the graceful-fs module, ' +
'please update it to a more recent version.',
false);
}
const printDeprecation = require('internal/util').printDeprecationMessage;

function throwOptionsError(options) {
throw new TypeError('Expected options to be either an object or a string, ' +
Expand Down