-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: declare all parameter types #21782
Conversation
doc/api/http.md
Outdated
@@ -1788,7 +1788,7 @@ changes: | |||
`ServerResponse`. | |||
- `requestListener` {Function} | |||
|
|||
* Returns: {http.Server} | |||
- Returns: {http.Server} |
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 we should be using asterisks instead for consistency. This might mean the options
and requestListener
lines should be changed instead.
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.
LGTM with @mscdex's nit addressed
doc/api/net.md
Outdated
@@ -668,6 +671,7 @@ callback. | |||
added: v0.1.90 | |||
--> | |||
|
|||
* `exception` {object} |
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.
Should be {Object}
in all places, only primitive values are lowercased. See tools/doc/type-parser.js if in doubt. (The build failure in CI is due to this check.)
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.
Some nits.
doc/api/net.md
Outdated
@@ -686,6 +690,8 @@ listeners for that event will receive `exception` as an argument. | |||
added: v0.1.90 | |||
--> | |||
|
|||
* `data` {string|Buffer|Uint8Array} | |||
* `encoding` {string} Only used when data is `string`. **Default:** `utf8`. |
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.
`utf8`
-> `'utf8'`
?
doc/api/process.md
Outdated
@@ -1691,6 +1691,7 @@ This feature is not available in [`Worker`][] threads. | |||
<!-- YAML | |||
added: v0.1.28 | |||
--> | |||
* `id` {integer[]} |
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.
This means an array of integers, but the description below states this can be a number or a string?
doc/api/util.md
Outdated
@@ -939,6 +939,7 @@ useful for addon developers who prefer to do type checking in JavaScript. | |||
added: v10.0.0 | |||
--> | |||
|
|||
* `value` {Object} |
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.
A tricky one. It seems this should be {any}
, as formally the function accepts any types including even undefined
, and returns a valid answer in all cases.
The same seems true for other similar cases below.
doc/api/v8.md
Outdated
@@ -175,6 +175,7 @@ changes to the API or wire format) may occur until this warning is removed. | |||
added: v8.0.0 | |||
--> | |||
|
|||
* `value` {Object} |
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 this function also accepts {any}
.
doc/api/v8.md
Outdated
@@ -203,6 +204,8 @@ Writes out a header, which includes the serialization format version. | |||
|
|||
#### serializer.writeValue(value) | |||
|
|||
* `value` {Object} |
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.
Ditto (not full {any}
(no symbols, for example), but a comment below warns about this, so we can state {any}
to include primitives).
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.
Maybe we should also add a comment right here?
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.
@BridgeAR: please explain?
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 was just wondering about adding the same warning that describes the details here as well when changing it to {any}
. Or we could just move that part.
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.
LGTM with the comments addressed.
doc/api/net.md
Outdated
@@ -64,10 +64,11 @@ This class is used to create a TCP or [IPC][] server. | |||
|
|||
### new net.Server([options][, connectionListener]) | |||
|
|||
* `options` {Object} See [`net.createServer([options][, connectionListener])`][`net.createServer()`]. |
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.
This likely has to be shortened to below 80 characters.
doc/api/v8.md
Outdated
@@ -203,6 +204,8 @@ Writes out a header, which includes the serialization format version. | |||
|
|||
#### serializer.writeValue(value) | |||
|
|||
* `value` {Object} |
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.
Maybe we should also add a comment right here?
This is great work! Thanks a lot :-) |
doc/api/process.md
Outdated
@@ -1691,6 +1691,7 @@ This feature is not available in [`Worker`][] threads. | |||
<!-- YAML | |||
added: v0.1.28 | |||
--> | |||
* `id` {integer} |
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.
{integer | string}
?
This needs rebasing and addressing the nit) |
Node.js Collaborators, please, add 👍 here if you approve fast-tracking. |
PR-URL: #21782 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
Landed in 40c85ff |
Depends on #21616 to land on v10.x-staging. |
PR-URL: #21782 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
PR-URL: #21782 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]>
OpenSSL does not provide a straight-forward way to implement a non-integer generator, so createDiffieHellman never supported anything other than a number as the generator. (This only applies to the signature where the first argument is the size of the prime, and therefore a number.) Refs: nodejs/node-v0.x-archive#7086 Refs: nodejs#21782
OpenSSL does not provide a straight-forward way to implement a non-integer generator, so createDiffieHellman never supported anything other than a number as the generator. (This only applies to the signature where the first argument is the size of the prime, and therefore a number.) Refs: nodejs/node-v0.x-archive#7086 Refs: #21782 PR-URL: #31121 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
OpenSSL does not provide a straight-forward way to implement a non-integer generator, so createDiffieHellman never supported anything other than a number as the generator. (This only applies to the signature where the first argument is the size of the prime, and therefore a number.) Refs: nodejs/node-v0.x-archive#7086 Refs: #21782 PR-URL: #31121 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
OpenSSL does not provide a straight-forward way to implement a non-integer generator, so createDiffieHellman never supported anything other than a number as the generator. (This only applies to the signature where the first argument is the size of the prime, and therefore a number.) Refs: nodejs/node-v0.x-archive#7086 Refs: #21782 PR-URL: #31121 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
OpenSSL does not provide a straight-forward way to implement a non-integer generator, so createDiffieHellman never supported anything other than a number as the generator. (This only applies to the signature where the first argument is the size of the prime, and therefore a number.) Refs: nodejs/node-v0.x-archive#7086 Refs: #21782 PR-URL: #31121 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
The current marked based implementation of json generation has code in place to flag invalid parameters; unfortunately that code is regularly defeated by a statement that immediately precedes it that will create an empty definition. The only use case I could find for such was for a single occurrence of a
...rest
parameter. In my remark implementation, I've tightened up the check, and this commit will provide the necessary definitions. If that is not desired, I will withdraw this pull request and loosen up the check.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes