-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
guides: fix nits in buffer-constructor-deprecation #1679
guides: fix nits in buffer-constructor-deprecation #1679
Conversation
$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' | ||
```bash | ||
$ export NODE_OPTIONS=--trace-warnings | ||
$ export NODE_PENDING_DEPRECATION=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.
It seems we have not --pending-deprecation
in NODE_OPTIONS
.
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.
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.
Yes, we have it as a separate cli key, but not as a NODE_OPTIONS
env variable part option.
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.
I'm not sure I follow, --pending-deprecation
is a CLI option right? If so it should work when used via NODE_OPTIONS
which allows to specify CLI options in the environment via a space-separated list.
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.
It seems we have a whitelist of cli keys that are allowed in NODE_OPTIONS
:
Node options that are allowed are: ...
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.
I think it is simply not listed there.
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.
Node.js 10 doc has not it as well:
https://nodejs.org/dist/latest-v10.x/docs/api/cli.html#cli_node_options_options
If it does work, maybe the API docs need updating.
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.
Yes it seems outdated, see https://github.com/nodejs/node/blob/master/src/node.cc#L3156-L3198
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.
Thank you. I will revert this change.
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.
PR to update the API doc: nodejs/node#21229
|
||
```console | ||
$ export NODE_OPTIONS='--trace-warnings --pending-deprecation' | ||
```bash |
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.
console
tag seems to produce weird rendering:
I am a bit confused by this fragment in the example code. Are the condition check and error message in some contradiction? |
cc @nodejs/documentation @nodejs/buffer |
Yes, I think so the message should be 'The "size" argument must not be of type number.' |
@fhinkel Is this an appropriate fix? |
@vsemozhetbyt Thanks! |
This PR unify some formatting differences across the doc and fix some other nits.