Skip to content
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

Closed
wants to merge 6 commits into from
Closed

Conversation

rubys
Copy link
Member

@rubys rubys commented Jul 12, 2018

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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Jul 12, 2018
doc/api/http.md Outdated
@@ -1788,7 +1788,7 @@ changes:
`ServerResponse`.
- `requestListener` {Function}

* Returns: {http.Server}
- Returns: {http.Server}
Copy link
Contributor

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.

Copy link
Member

@jasnell jasnell left a 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}
Copy link
Contributor

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.)

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt left a 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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`utf8` -> `'utf8'`?

@@ -1691,6 +1691,7 @@ This feature is not available in [`Worker`][] threads.
<!-- YAML
added: v0.1.28
-->
* `id` {integer[]}
Copy link
Contributor

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}
Copy link
Contributor

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}
Copy link
Contributor

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}
Copy link
Contributor

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).

Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BridgeAR: please explain?

Copy link
Member

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.

Copy link
Member

@BridgeAR BridgeAR left a 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()`].
Copy link
Member

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}
Copy link
Member

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?

@BridgeAR
Copy link
Member

This is great work! Thanks a lot :-)

@@ -1691,6 +1691,7 @@ This feature is not available in [`Worker`][] threads.
<!-- YAML
added: v0.1.28
-->
* `id` {integer}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{integer | string} ?

@vsemozhetbyt
Copy link
Contributor

This needs rebasing and addressing the nit)

@vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt
Copy link
Contributor

Node.js Collaborators, please, add 👍 here if you approve fast-tracking.

@vsemozhetbyt vsemozhetbyt added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 14, 2018
vsemozhetbyt pushed a commit that referenced this pull request Jul 15, 2018
PR-URL: #21782
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
@vsemozhetbyt
Copy link
Contributor

Landed in 40c85ff
Thank you!

@targos
Copy link
Member

targos commented Jul 16, 2018

Depends on #21616 to land on v10.x-staging.

@targos targos removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jul 24, 2018
targos pushed a commit that referenced this pull request Aug 7, 2018
PR-URL: #21782
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
rvagg pushed a commit that referenced this pull request Aug 13, 2018
PR-URL: #21782
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
tniessen added a commit to tniessen/node that referenced this pull request Dec 28, 2019
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
Trott pushed a commit that referenced this pull request Dec 30, 2019
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 <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
BridgeAR pushed a commit that referenced this pull request Jan 3, 2020
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 <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
targos pushed a commit that referenced this pull request Jan 14, 2020
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 <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
BethGriggs pushed a commit that referenced this pull request Feb 6, 2020
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 <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants