module: runtime deprecate createRequireFromPath()
This commit moves DEP0130 to a runtime deprecation. PR-URL: https://github.com/nodejs/node/pull/27951 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
3ba6813daf
commit
14701e539c
@ -2451,12 +2451,15 @@ instead.
|
|||||||
### DEP0130: Module.createRequireFromPath()
|
### DEP0130: Module.createRequireFromPath()
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
changes:
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/27951
|
||||||
|
description: Runtime deprecation.
|
||||||
- version: v12.2.0
|
- version: v12.2.0
|
||||||
pr-url: https://github.com/nodejs/node/pull/27405
|
pr-url: https://github.com/nodejs/node/pull/27405
|
||||||
description: Documentation-only.
|
description: Documentation-only.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
Type: Documentation-only
|
Type: Runtime
|
||||||
|
|
||||||
Module.createRequireFromPath() is deprecated. Please use [`module.createRequire()`][] instead.
|
Module.createRequireFromPath() is deprecated. Please use [`module.createRequire()`][] instead.
|
||||||
|
|
||||||
|
@ -860,7 +860,12 @@ function createRequireFromPath(filename) {
|
|||||||
return makeRequireFunction(m);
|
return makeRequireFunction(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
Module.createRequireFromPath = createRequireFromPath;
|
Module.createRequireFromPath = deprecate(
|
||||||
|
createRequireFromPath,
|
||||||
|
'Module.createRequireFromPath() is deprecated. ' +
|
||||||
|
'Use Module.createRequire() instead.',
|
||||||
|
'DEP0130'
|
||||||
|
);
|
||||||
|
|
||||||
const createRequireError = 'must be a file URL object, file URL string, or ' +
|
const createRequireError = 'must be a file URL object, file URL string, or ' +
|
||||||
'absolute path string';
|
'absolute path string';
|
||||||
|
@ -5,3 +5,4 @@ Error: test
|
|||||||
at async three (*fixtures*async-error.js:20:3)
|
at async three (*fixtures*async-error.js:20:3)
|
||||||
at async four (*fixtures*async-error.js:24:3)
|
at async four (*fixtures*async-error.js:24:3)
|
||||||
at async main (*message*async_error_sync_esm.mjs:7:5)
|
at async main (*message*async_error_sync_esm.mjs:7:5)
|
||||||
|
(node:*) [DEP0130] DeprecationWarning: Module.createRequireFromPath() is deprecated. Use Module.createRequire() instead.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user