Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
build: runtime-deprecate requiring deps
PR-URL: #16392 Fixes: #15566 (comment) Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
- Loading branch information
Showing
with
117 additions
and 13 deletions.
- +31 −0 doc/api/deprecations.md
- +15 −2 lib/internal/bootstrap_node.js
- +10 −10 lib/internal/v8_prof_processor.js
- +32 −0 test/parallel/test-require-deps-deprecation.js
- +29 −1 tools/js2c.py
@@ -0,0 +1,32 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
// The v8 modules when imported leak globals. Disable global check. | ||
common.globalCheck = false; | ||
|
||
const deprecatedModules = [ | ||
'node-inspect/lib/_inspect', | ||
'node-inspect/lib/internal/inspect_client', | ||
'node-inspect/lib/internal/inspect_repl', | ||
'v8/tools/SourceMap', | ||
'v8/tools/codemap', | ||
'v8/tools/consarray', | ||
'v8/tools/csvparser', | ||
'v8/tools/logreader', | ||
'v8/tools/profile', | ||
'v8/tools/profile_view', | ||
'v8/tools/splaytree', | ||
'v8/tools/tickprocessor', | ||
'v8/tools/tickprocessor-driver' | ||
]; | ||
|
||
common.expectWarning('DeprecationWarning', deprecatedModules.map((m) => { | ||
return `Requiring Node.js-bundled '${m}' module is deprecated. ` + | ||
'Please install the necessary module locally.'; | ||
})); | ||
|
||
for (const m of deprecatedModules) { | ||
try { | ||
require(m); | ||
} catch (err) {} | ||
} |