-
- Notifications
You must be signed in to change notification settings - Fork 33.7k
doc, test: add note to response.getHeaders #12887
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
Conversation
doc/api/querystring.md Outdated
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.
typo: space after typical
doc/api/querystring.md Outdated
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.
Can you try to use complete sentences in the documentation? Also, this isn’t that simple anyway. Other Contexts can have different Object objects anyway – the better advice is to avoid instanceof for builtins in JS code (i.e. please drop the last sentence 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.
Reasonable 👍
doc/api/http.md Outdated
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.
Can you put this note at the end of the documentation section?
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.
Only difference is that there there is no explicit * Returns: {Object}
doc/api/http.md Outdated
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.
What's going on with this hunk?
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 don't know, reverting
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's a weird space at line 559 that made my editor decide it's a UTF-8 file, and added the BOM.
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.
You mean UTF-16?
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.
doc/api/http.md Outdated
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.
Can you put the note in the prose like querystring.parse()?
doc/api/http.md Outdated
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.
Missing space between "typical" and "Object"
doc/api/http.md Outdated
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.
Either make the last bit a complete sentence, or fold it into the previous sentence.
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.
Removing.
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.
deepStrictEqual while at it?
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.
Need to remove prototype from {}, but why not...
178a714 to 1bc296e Compare | Addressed. PTAL. |
doc/api/http.md Outdated
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.
still a missing space after “typical”
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.
Ack
doc/api/http.md Outdated
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.
Still missing a space.
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.
Why not just compare it to Object.create(null)?
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.
Fails on 7.10 🤷♂️
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.
Changed.
(Well the test fails anyway in other places on 7.10)
1677823 to f13cde2 Compare
addaleax left a comment
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.
Looks good, but the old querystring.md wording sounded a bit clearer to me.
| /cc @nodejs/documentation comments about the wording? |
doc/api/http.md Outdated
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.
s/extend the/inherit from the/
doc/api/http.md Outdated
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.
Just to be sure, the extra whitespace at the end of this line has been removed, right?
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's a Unicode white space there, that I converted to \u0020. I'll make sure that it's right
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 \0x00A0 at position 5 I replaced with \u0020. I verified with a hex compare.
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.
Nit: This is an object, not object like :D
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 had this discussion with @addaleax. How can it be an Object if objLike instaceof Object === false ?
According to OOP definitions "not" objLike is an Object. It's actually a null with properies 😉
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 could call it sonOfNull...
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 agree with @thefourtheye, it's still an object according to the spec.
f13cde2 to b303aef Compare doc/api/http.md Outdated
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.
replaced a \u00A0 with a \u0020, so now the document is ANSI and not UTF-8
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.
@refack Just to be clear, our docs are UTF-8 and don’t need to be restricted to ASCII. This change is obviously fine, but it might be a good idea to tell your editor to not use BOMs for UTF-8.
doc/api/querystring.md Outdated
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.
s/extend the/inherit from the/
b303aef to f16669a Compare | // eslint-disable-next-line no-restricted-properties | ||
| assert.deepEqual(res.getHeaders(), {}); | ||
| const headers = res.getHeaders(); | ||
| const exoticObj = Object.create(null); |
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.
Nit: I am being extremely pedantic here. So please ignore this comment, if you don't agree. Quoting 9.1 Ordinary Object Internal Methods and Internal Slots,
All ordinary objects have an internal slot called [[Prototype]]. The value of this internal slot is either null or an object and is used for implementing inheritance.
This object doesn't do or posses anything exotic. So this is still a normal object I believe.
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 agree with @thefourtheye. Probably better to call it something like simpleObj or bareObj or something similar without getting too wordy...
f16669a to e1cabf6 Compare * also correct language for the same note for querystring.parse * add assertions for said note PR-URL: nodejs#12887 Fixes: nodejs#12885 Refs: nodejs#12883 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
| landed in e1cabf6 |
| Post land CI:https://ci.nodejs.org/job/node-test-commit/9785/ |
| @refack I think you left that CI comment on the wrong PR? That CI run is for this commit: "test: use assert regexp in tls no cert test" |
Since the CI is on |
* also correct language for the same note for querystring.parse * add assertions for said note PR-URL: nodejs#12887 Fixes: nodejs#12885 Refs: nodejs#12883 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
| Should this be backported to |
Fixes: #12885
Ref: #12883
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test,doc