| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
|
||
| 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.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with @richardlau's comment addressed.
Sorry, something went wrong.
|
|
||
| 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.
Sorry, something went wrong.
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.
Sorry, something went wrong.
Optional@XadillaX we could take this one step further. Move EOL to node_contants.c defined with NODE_DEFINE_CONSTANT. Then the os.EOL property would be just a getter {get: () => constants.EOL} (maybe even deprecate it, now or later). |
Sorry, something went wrong.
|
@ChALkeR ... any way we can get an estimate on any breakage this may cause? (if any) |
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
| }, | ||
|
|
||
| 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.
Sorry, something went wrong.
There was a problem hiding this comment.
Okay.
Sorry, something went wrong.
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?)
Sorry, something went wrong.
From #14619:
So an alternative is to update the docs. |
Sorry, something went wrong.
@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. |
Sorry, something went wrong.
There was a problem hiding this comment.
Still LGTM, just even more so!
Sorry, something went wrong.
|
@addaleax How's the code now? |
Sorry, something went wrong.
|
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 foo.bar is a constant, I personally would expect that to mean that the value is not changed by whatever code provides that value, i.e. in this specific case that Node doesn’t change that value while a process is running. |
Sorry, something went wrong.
Sorry, something went wrong.
|
Marking this one ctc-review. @nodejs/ctc ... please weigh in |
Sorry, something went wrong.
|
@jasnell, @joyeecheung just reviewed |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with good CI and CITGM run.
Sorry, something went wrong.
There was a problem hiding this comment.
¯\_(ツ)_/¯
Sorry, something went wrong.
|
-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 os.EOL. We don't have any evidence that the current behavior has caused problems in practice, so changing it seems like it's a solution without a problem. 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. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM with { configurable: true }
Sorry, something went wrong.
|
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) |
Sorry, something went wrong.
|
before landing, can this get a rebase? We are getting some failures for body-parser that are already fixed on master. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM if CITGM is ok
Sorry, something went wrong.
Sorry, something went wrong.
|
Reminder to whoever lands this: the commit message should be updated to correct "non-configurable" to "configurable". |
Sorry, something went wrong.
|
@not-an-aardvark Thanks and I've rebased the message. |
Sorry, something went wrong.
|
I think CITGM is green, this can be landed. |
Sorry, something went wrong.
|
@XadillaX regarding the commit message, I think the patch "Fixes:", not just "Refs:" the issue, doesn't it? |
Sorry, something went wrong.
|
@aqrln Right, I think who to land this may help me to modify the commit message. |
Sorry, something went wrong.
|
Pre-land CI: https://ci.nodejs.org/job/node-test-commit/11929/ |
Sorry, something went wrong.
PR-URL: #14622 Fixes: #14619 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
* **async_hooks**
* Older experimental `async_hooks` APIs have been removed
[[`d731369b1d`](d731369b1d)]
**(SEMVER-MAJOR)** [#14414](#14414)
* **Errors**
* Multiple built in modules have been migrated to use static error codes
* **Domains**
* The long deprecated `.dispose()` method has been removed
[[`602fd36d95`](602fd36d95)]
**(SEMVER-MAJOR)** [#15412](#15412)
* **File system**
* `fs.ReadStream` and `fs.WriteStream` now make use of `.destroy()`
[[`e5c290bed9`](e5c290bed9)]
**(SEMVER-MAJOR)** [#15407](#15407)
* `fs` callbacks are now invoked with an undefined `this` context
[[`2249234fee`](2249234fee)]
**(SEMVER-MAJOR)** [#14645](#14645)
* **HTTP**
* Socket timeout is set when the socket connects
[[`10be20a0e8`](10be20a0e8)]
**(SEMVER-MAJOR)** [#8895](#8895)
* A bug causing the request `error` event to fire twice has been fixed
[[`620ba41694`](620ba41694)]
**(SEMVER-MAJOR)** [#14659](#14659)
* The `pipe` method on `OutgoingMessage` has been disabled
[[`156549d8ff`](156549d8ff)]
**(SEMVER-MAJOR)** [#14358](#14358)
* **HTTP/2**
* The `--expose-http2` command-line argument is no longer required
[[`f55ee6e24a`](f55ee6e24a)]
**(SEMVER-MAJOR)** [#15535](#15535)
* **Internationalization**
* The `Intl.v8BreakIterator` class has been removed
[[`668ad44922`](668ad44922)]
**(SEMVER-MAJOR)** [#15238](#15238)
* **OS**
* `os.EOL` is now read-only
[[`f6caeb9526`](f6caeb9526)]
**(SEMVER-MAJOR)** [#14622](#14622)
* **Process**
* It is now possible to pass additional flags to `dlopen`
[[`5f22375922`](5f22375922)]
**(SEMVER-MAJOR)** [#12794](#12794)
* **Timers**
* Using a timeout duration larger than 32-bits will now emit a warning
[[`ce3586da31`](ce3586da31)]
**(SEMVER-MAJOR)** [#15627](#15627)
* **TLS**
* `parseCertString` has been deprecated
[[`468110b327`](468110b327)]
**(SEMVER-MAJOR)** [#14249](#14249)
* Type-checking for `key`, `cert`, and `ca` options has been added
[[`a7dccd040d`](a7dccd040d)]
**(SEMVER-MAJOR)** [#14807](#14807)
* **async_hooks**
* Older experimental `async_hooks` APIs have been removed
[[`d731369b1d`](d731369b1d)]
**(SEMVER-MAJOR)** [#14414](#14414)
* **Errors**
* Multiple built in modules have been migrated to use static error codes
* **Domains**
* The long deprecated `.dispose()` method has been removed
[[`602fd36d95`](602fd36d95)]
**(SEMVER-MAJOR)** [#15412](#15412)
* **File system**
* `fs.ReadStream` and `fs.WriteStream` now make use of `.destroy()`
[[`e5c290bed9`](e5c290bed9)]
**(SEMVER-MAJOR)** [#15407](#15407)
* `fs` callbacks are now invoked with an undefined `this` context
[[`2249234fee`](2249234fee)]
**(SEMVER-MAJOR)** [#14645](#14645)
* **HTTP**
* Socket timeout is set when the socket connects
[[`10be20a0e8`](10be20a0e8)]
**(SEMVER-MAJOR)** [#8895](#8895)
* A bug causing the request `error` event to fire twice has been fixed
[[`620ba41694`](620ba41694)]
**(SEMVER-MAJOR)** [#14659](#14659)
* The `pipe` method on `OutgoingMessage` has been disabled
[[`156549d8ff`](156549d8ff)]
**(SEMVER-MAJOR)** [#14358](#14358)
* **HTTP/2**
* The `--expose-http2` command-line argument is no longer required
[[`f55ee6e24a`](f55ee6e24a)]
**(SEMVER-MAJOR)** [#15535](#15535)
* **Internationalization**
* The `Intl.v8BreakIterator` class has been removed
[[`668ad44922`](668ad44922)]
**(SEMVER-MAJOR)** [#15238](#15238)
* **OS**
* `os.EOL` is now read-only
[[`f6caeb9526`](f6caeb9526)]
**(SEMVER-MAJOR)** [#14622](#14622)
* **Process**
* It is now possible to pass additional flags to `dlopen`
[[`5f22375922`](5f22375922)]
**(SEMVER-MAJOR)** [#12794](#12794)
* **Timers**
* Using a timeout duration larger than 32-bits will now emit a warning
[[`ce3586da31`](ce3586da31)]
**(SEMVER-MAJOR)** [#15627](#15627)
* **TLS**
* `parseCertString` has been deprecated
[[`468110b327`](468110b327)]
**(SEMVER-MAJOR)** [#14249](#14249)
* Type-checking for `key`, `cert`, and `ca` options has been added
[[`a7dccd040d`](a7dccd040d)]
**(SEMVER-MAJOR)** [#14807](#14807)
* **async_hooks**
* Older experimental `async_hooks` APIs have been removed
[[`d731369b1d`](d731369b1d)]
**(SEMVER-MAJOR)** [#14414](#14414)
* **Errors**
* Multiple built in modules have been migrated to use static error codes
* **Domains**
* The long deprecated `.dispose()` method has been removed
[[`602fd36d95`](602fd36d95)]
**(SEMVER-MAJOR)** [#15412](#15412)
* **File system**
* `fs.ReadStream` and `fs.WriteStream` now make use of `.destroy()`
[[`e5c290bed9`](e5c290bed9)]
**(SEMVER-MAJOR)** [#15407](#15407)
* `fs` callbacks are now invoked with an undefined `this` context
[[`2249234fee`](2249234fee)]
**(SEMVER-MAJOR)** [#14645](#14645)
* **HTTP**
* Socket timeout is set when the socket connects
[[`10be20a0e8`](10be20a0e8)]
**(SEMVER-MAJOR)** [#8895](#8895)
* A bug causing the request `error` event to fire twice has been fixed
[[`620ba41694`](620ba41694)]
**(SEMVER-MAJOR)** [#14659](#14659)
* The `pipe` method on `OutgoingMessage` has been disabled
[[`156549d8ff`](156549d8ff)]
**(SEMVER-MAJOR)** [#14358](#14358)
* **HTTP/2**
* The `--expose-http2` command-line argument is no longer required
[[`f55ee6e24a`](f55ee6e24a)]
**(SEMVER-MAJOR)** [#15535](#15535)
* **Internationalization**
* The `Intl.v8BreakIterator` class has been removed
[[`668ad44922`](668ad44922)]
**(SEMVER-MAJOR)** [#15238](#15238)
* **OS**
* `os.EOL` is now read-only
[[`f6caeb9526`](f6caeb9526)]
**(SEMVER-MAJOR)** [#14622](#14622)
* **Process**
* It is now possible to pass additional flags to `dlopen`
[[`5f22375922`](5f22375922)]
**(SEMVER-MAJOR)** [#12794](#12794)
* **Timers**
* Using a timeout duration larger than 32-bits will now emit a warning
[[`ce3586da31`](ce3586da31)]
**(SEMVER-MAJOR)** [#15627](#15627)
* **TLS**
* `parseCertString` has been deprecated
[[`468110b327`](468110b327)]
**(SEMVER-MAJOR)** [#14249](#14249)
* Type-checking for `key`, `cert`, and `ca` options has been added
[[`a7dccd040d`](a7dccd040d)]
**(SEMVER-MAJOR)** [#14807](#14807)
* **async_hooks**
* Older experimental `async_hooks` APIs have been removed
[[`d731369b1d`](d731369b1d)]
**(SEMVER-MAJOR)** [#14414](#14414)
* **Errors**
* Multiple built in modules have been migrated to use static error codes
* **Domains**
* The long deprecated `.dispose()` method has been removed
[[`602fd36d95`](602fd36d95)]
**(SEMVER-MAJOR)** [#15412](#15412)
* **File system**
* `fs.ReadStream` and `fs.WriteStream` now make use of `.destroy()`
[[`e5c290bed9`](e5c290bed9)]
**(SEMVER-MAJOR)** [#15407](#15407)
* `fs` callbacks are now invoked with an undefined `this` context
[[`2249234fee`](2249234fee)]
**(SEMVER-MAJOR)** [#14645](#14645)
* **HTTP**
* Socket timeout is set when the socket connects
[[`10be20a0e8`](10be20a0e8)]
**(SEMVER-MAJOR)** [#8895](#8895)
* A bug causing the request `error` event to fire twice has been fixed
[[`620ba41694`](620ba41694)]
**(SEMVER-MAJOR)** [#14659](#14659)
* The `pipe` method on `OutgoingMessage` has been disabled
[[`156549d8ff`](156549d8ff)]
**(SEMVER-MAJOR)** [#14358](#14358)
* **HTTP/2**
* The `--expose-http2` command-line argument is no longer required
[[`f55ee6e24a`](f55ee6e24a)]
**(SEMVER-MAJOR)** [#15535](#15535)
* **Internationalization**
* The `Intl.v8BreakIterator` class has been removed
[[`668ad44922`](668ad44922)]
**(SEMVER-MAJOR)** [#15238](#15238)
* **OS**
* `os.EOL` is now read-only
[[`f6caeb9526`](f6caeb9526)]
**(SEMVER-MAJOR)** [#14622](#14622)
* **Process**
* It is now possible to pass additional flags to `dlopen`
[[`5f22375922`](5f22375922)]
**(SEMVER-MAJOR)** [#12794](#12794)
* **Timers**
* Using a timeout duration larger than 32-bits will now emit a warning
[[`ce3586da31`](ce3586da31)]
**(SEMVER-MAJOR)** [#15627](#15627)
* **TLS**
* `parseCertString` has been deprecated
[[`468110b327`](468110b327)]
**(SEMVER-MAJOR)** [#14249](#14249)
* Type-checking for `key`, `cert`, and `ca` options has been added
[[`a7dccd040d`](a7dccd040d)]
**(SEMVER-MAJOR)** [#14807](#14807)
| Back | FazBrowse Home | New Git URL |
Refs: #14619
Checklist
Affected core subsystem(s)
os