-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: use emitWarning instead of printDeprecationMessage
The process.emitWarning() API should be used for printing deprecation warning messages rather than directly using the internal/util#printDeprecationMessage PR-URL: #8166 Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Myles Borins <[email protected]>
- Loading branch information
Showing
4 changed files
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict'; | ||
|
||
const msg = require('internal/util').printDeprecationMessage; | ||
|
||
module.exports = require('internal/linkedlist'); | ||
msg('_linklist module is deprecated. Please use a userland alternative.'); | ||
process.emitWarning( | ||
'_linklist module is deprecated. Please use a userland alternative.', | ||
'DeprecationWarning'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
'use strict'; | ||
|
||
const util = require('internal/util'); | ||
|
||
// the sys module was renamed to 'util'. | ||
// this shim remains to keep old programs working. | ||
// sys is deprecated and shouldn't be used | ||
|
||
module.exports = require('util'); | ||
util.printDeprecationMessage('sys is deprecated. Use util instead.'); | ||
process.emitWarning('sys is deprecated. Use util instead.', | ||
'DeprecationWarning'); |