Revert "fs: add a temporary fix for re-evaluation support"
As planned, This reverts commit 1d79787e2e792fb0b5088958fe2cca703e4ea508. Fixes: https://github.com/nodejs/node/issues/5213 PR-URL: https://github.com/nodejs/node/pull/6413 Reviewed-By: Ben Noordhuis <info@noordhuis.nl> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: JungMinu - Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
1657f12f75
commit
49ef3ae90a
37
lib/fs.js
37
lib/fs.js
@ -40,42 +40,7 @@ const isWindows = process.platform === 'win32';
|
|||||||
|
|
||||||
const DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
const DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
|
||||||
const errnoException = util._errnoException;
|
const errnoException = util._errnoException;
|
||||||
|
const printDeprecation = require('internal/util').printDeprecationMessage;
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
function throwOptionsError(options) {
|
function throwOptionsError(options) {
|
||||||
throw new TypeError('Expected options to be either an object or a string, ' +
|
throw new TypeError('Expected options to be either an object or a string, ' +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user