-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
adds deprication warning to errname() #23597
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2230,6 +2230,13 @@ like `dns.lookup(false)` due to backward compatibility. | |
This behavior is undocumented and is thought to be unused in real world apps. | ||
It will become an error in future versions of Node.js. | ||
|
||
<a id="DEP0XXX"></a> | ||
### DEP0XXX: process.binding('uv').errname() private API | ||
|
||
Type: Documentation-only (supports [`--pending-deprecation`][]) | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possible nit for a lander: extra empty line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vsemozhetbyt I’d count that under @jasnell’s comment. We want a description here rather than removing empty lines :) |
||
|
||
[`--pending-deprecation`]: cli.html#cli_pending_deprecation | ||
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size | ||
[`Buffer.from(array)`]: buffer.html#buffer_class_method_buffer_from_array | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -842,6 +842,11 @@ class Environment { | |
emit_env_nonstring_warning_ = false; | ||
return current_value; | ||
} | ||
inline bool EmitErrNameWarning() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: One empty line above this would be more readable. |
||
bool current_value = emit_err_name_warning_; | ||
emit_err_name_warning_ = false; | ||
return current_value; | ||
} | ||
|
||
typedef void (*native_immediate_callback)(Environment* env, void* data); | ||
// cb will be called as cb(env, data) on the next event loop iteration. | ||
|
@@ -929,6 +934,7 @@ class Environment { | |
bool printed_error_; | ||
bool abort_on_uncaught_exception_; | ||
bool emit_env_nonstring_warning_; | ||
bool emit_err_name_warning_; | ||
size_t makecallback_cntr_; | ||
std::vector<double> destroy_async_id_list_; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
|
||
// Flags: --pending-deprecation | ||
|
||
common.expectWarning( | ||
'DeprecationWarning', | ||
'Directly calling process.binding(\'uv\').errname(<val>) is being ' + | ||
'deprecated. Please make sure to use util.getSystemErrorName() instead.', | ||
'DEP0XXX' | ||
); | ||
|
||
process.binding('uv').errname(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to whomever lands this: should add a bit more detail here on landing