writeable stream: group all properties #31187
writeable stream: group all properties #31187antsmartian wants to merge 1 commit intonodejs:masterfrom
Conversation
52819a8 to
88f20ec
Compare
lib/_stream_writable.js
Outdated
There was a problem hiding this comment.
I think ObjectDefineProperties defaults enumerable to false, so I don't think these are needed? I'm not sure I understand the above comment about making it explicit? @BridgeAR any idea who is the original author of this comment?
There was a problem hiding this comment.
@ronag: That's a good point. I guess we no need to add these properties. For example, I tested the below code and by default the enumerable property is false:
const a = {}
Object.defineProperties(a, { test: { get() { return 'test'} } })
a.test // test
a.propertyIsEnumerable('test') // false
Edit: Guess you have wrongly pinged instead of me :)
There was a problem hiding this comment.
Seems like that was Calvin. Some people prefer explicit descriptor properties. Probably because not everyone is handling descriptors frequently and knows that their defaults are all false. It should be fine either way.
There was a problem hiding this comment.
As this also came up in #31287 (comment):
I think it’s better to be explicit here, regardless of what people may know about the default values; partly because it removes cognitive overhead of figuring out what the behaviour is, partly because making it explicit forces code authors to be deliberate about the values they choose.
88f20ec to
ad4b942
Compare
|
@ronag Done. @lpinca: Removed enumerable definition as mentioned here: #31187 (comment) Could you PTAL again? |
lib/_stream_writable.js
Outdated
lpinca
left a comment
There was a problem hiding this comment.
Still LGTM with nits addressed.
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM with the comments addressed.
Trott
left a comment
There was a problem hiding this comment.
Pile-on "LGTM with nits addressed"
|
Ping @antsmartian |
|
Sorry for delay, taken care the comments.. cc @BridgeAR @nodejs/streams |
|
@antsmartian Can you sqaush the commits here together? CI detects a merge conflict in one of the earlier ones that is then resolved later, but it still fails to rebase because of that. (Also happy to do that for you if you prefer.) |
|
Another property |
2f226c8 to
5494213
Compare
5494213 to
36c6219
Compare
|
@addaleax PTAL.. This should be fine now. |
|
Landed in 0ac04ec 🙂 |
PR-URL: #31187 Refs: #31144 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
Hey All, this doesn't land cleanly on v13.x should there be a backport? |
|
A backport will be good to have to avoid future conflicts. |
PR-URL: nodejs#31187 Refs: nodejs#31144 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Backport-PR-URL: nodejs#32164
Backport-PR-URL: #32164 PR-URL: #31187 Refs: #31144 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Backport-PR-URL: #32164 PR-URL: #31187 Refs: #31144 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Refs: #31144 for writable streams.
cc @nodejs/streams
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes