Conversation
|
|
||
| const eol = common.isWindows ? '\r\n' : '\n'; | ||
|
|
||
| assert.strictEqual(eol, os.EOL); |
There was a problem hiding this comment.
Assertion parameters should be actual, expected so I think these should be the other way around.
tniessen
left a comment
There was a problem hiding this comment.
LGTM with @richardlau's comment addressed.
|
|
||
| assert.strictEqual(eol, os.EOL); | ||
|
|
||
| common.expectsError(function() { |
There was a problem hiding this comment.
I know that we didn't reach consensus on this, but I personally prefer arrow functions in our tests to make them a little more readable.
There was a problem hiding this comment.
IMHO I'd like to use anonymous function.
Refs: #14496 (comment)
Even though there was no result about that discussion.
Optional@XadillaX we could take this one step further. Move |
|
@ChALkeR ... any way we can get an estimate on any breakage this may cause? (if any) |
|
@refack Those constants are all numbers, used as flags to be passed between C++ and JS. I don't see a reason to introduce an inconsistency here. |
| }, | ||
|
|
||
| EOL: { | ||
| configurable: false, |
There was a problem hiding this comment.
On a second thought, maybe making it configurable would be better? This way people who really need to change it for testing can do so, but requiring them to explicitly state their intentions. I'm okay either way though.
addaleax
left a comment
There was a problem hiding this comment.
I think @TimothyGu’s comment is a blocker.
(Also, I’m kind of missing the motivation here… people don’t accidentally override os.EOL, do they?)
From #14619:
So an alternative is to update the docs. |
@addaleax In my opinion, this should throw when in strict mode: if(os.EOL = 'foo') {
console.log('Nope');
}I am ±0 about making it configurable, but it should be a constant by default. |
TimothyGu
left a comment
There was a problem hiding this comment.
Still LGTM, just even more so!
|
@addaleax How's the code now? |
|
I’ve removed my Changes Requested label, but as I mentioned I don’t quite see the point here. Maybe it’s a miscommunication about what “constant” means in this context; if documentation for JS code says that |
commented
Aug 7, 2017
commented
Aug 7, 2017
commented
Aug 8, 2017
|
Marking this one ctc-review. @nodejs/ctc ... please weigh in |
commented
Aug 11, 2017
|
@jasnell, @joyeecheung just reviewed |
|
-0. In general I'm not sure it's a good idea to make properties like this non-configurable, because it removes an escape hatch. I can imagine a hypothetical test helper to verify an that application works on multiple platforms, which could rely on mutating If we're convinced that we want to make the property non-writable to avoid accidental mutation, could we keep the property configurable? That way it would still be possible to overwrite the property as an escape hatch, but users would be unlikely to mutate it by mistake. edit: I just saw that it is configurable the current version of the PR. The title of the PR still says it's non-configurable. |
commented
Aug 14, 2017
|
CitGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/951/ I count 4 ✔️s from CTC members, so IMHO this is ready to land (pending CitGM) |
commented
Aug 16, 2017
|
before landing, can this get a rebase? We are getting some failures for body-parser that are already fixed on master. |
3e31ac4 to
042c259
Compare
commented
Aug 17, 2017
|
@mcollina rebased. |
commented
Aug 17, 2017
commented
Aug 17, 2017
|
Reminder to whoever lands this: the commit message should be updated to correct "non-configurable" to "configurable". |
042c259 to
6f5087d
Compare
commented
Aug 17, 2017
|
@not-an-aardvark Thanks and I've rebased the message. |
commented
Aug 17, 2017
|
I think CITGM is green, this can be landed. |
commented
Aug 17, 2017
|
@XadillaX regarding the commit message, I think the patch "Fixes:", not just "Refs:" the issue, doesn't it? |
commented
Aug 21, 2017
|
@aqrln Right, I think who to land this may help me to modify the commit message. |
commented
Aug 21, 2017
|
Pre-land CI: https://ci.nodejs.org/job/node-test-commit/11929/ |
commented
Aug 21, 2017
|
Landed in f6caeb9 |
Refs: #14619
Checklist
make -j4 test(UNIX)Affected core subsystem(s)
os