When inspecting errors, node_modules are highlighted with an
underscore. So far namespaced modules only highlighted the namespace
but not the rest of the module name. This is fixed by matching the
full name.
As drive-by it improves the performance slightly by removing the
regular expression in favor of indexOf to identify the right spot.
PR-URL: https://github.com/nodejs/node/pull/59446
Reviewed-By: Jordan Harband <ljharb@gmail.com>
The test `test/parallel/test-debug-process.js` fails on non-English
Windows systems due to a locale-dependent error message string.
The test asserts that a call to `process._debugProcess()` on a
terminated process throws an error with the message
`'The system cannot find the file specified.'`.
While this holds true on an English Windows system,
the test fails on systems with a different display language.
The underlying `WinapiErrnoException` function correctly retrieves the
localized error message from the OS. For example, on a Korean system,
the message is "지정된 파일을 찾을 수 없습니다.". This mismatch causes
an `AssertionError`.
This behavior can be verified directly in PowerShell:
# On Windows with English (US) display language
PS> (New-Object System.ComponentModel.Win32Exception 2).Message
The system cannot find the file specified.
# On Windows with Korean display language
PS> (New-Object System.ComponentModel.Win32Exception 2).Message
지정된 파일을 찾을 수 없습니다.
To make the test robust and environment-agnostic, this commit changes
the assertion to check the language-independent `error.errno` property,
which is consistently `2` for this type of error, instead of the
localized `error.message`.
PR-URL: https://github.com/nodejs/node/pull/59254
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
42be7f6a03 (originally included in 19.8.0
and later backported to 18.16.0) added documentation on how to use
`tls.DEFAULT_CIPHERS`.
However, that commit added the documentation with the version specified
as `REAPLCEME`, causing the published documentation to state that
`tls.DEFAULT_CIPHERS` was added in 19.8.0 and 18.16.0, which is
incorrect - that commit states that `tls.DEFAULT_CIPHERS` already
existed, and the only thing it added was an explanation on how to use
it.
In fact, by examining the git log, it can be seen that
`tls.DEFAULT_CIPHERS` was added by commit
af80e7bc6e, which was included in 0.11.3.
Fixes: https://github.com/nodejs/node/issues/59246
PR-URL: https://github.com/nodejs/node/pull/59247
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This change improves diagnosis by reporting the headers object that is
actually sent rather than the original input headers in the following
diagnostics channels:
- 'http2.client.stream.created'
- 'http2.client.stream.start'
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/59419
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
In certain machine configurations on Windows, fs.readlinkSync() may
return a path with upper case drive letter while the other paths may be
constructed from a base path with a lower case drive letter (e.g.
from process.cwd()). Checking path mismatch in a case-sensitive
manner can lead to failure in some tests, specifically with the
Windows machine configurations in the Jenkins CI. Since paths
are case-insensitive on Windows anyway, compare them in a
case-insensitive manner in the tests.
PR-URL: https://github.com/nodejs/node/pull/59475
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Since copying `shared_ptr` may involve costly atomic operations,
explicitly move both `shared_ptr` objects that are passed to the
private KeyObjectData constructor.
PR-URL: https://github.com/nodejs/node/pull/59472
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
`v8::ConvertableToTraceFormat` is only available in legacy V8 tracing
API and no longer supported in perfetto. This internalize
`node::tracing::TracedValue` and `v8::ConvertableToTraceFormat` by
defining specialized trace argument classes.
The newly defined structured trace argument classes can be easily
converted to `perfetto::TracedValue` by perfetto traced value protocol.
For example, when adding perfetto support, `CastTracedValue` will be a
no-op and these classes can add a new conversion method like:
```cpp
class Foo {
void WriteIntoTrace(TracedValue context) const {
auto dict = std::move(context).WriteDictionary();
dict->Add("key", 42);
dict->Add("foo", "bar");
dict->Add("member", member_);
}
};
```
PR-URL: https://github.com/nodejs/node/pull/57866
Refs: https://github.com/nodejs/diagnostics/issues/654
Refs: https://github.com/google/perfetto/blob/9ddf987d48cdfd9129987a3af1e85052c377756f/include/perfetto/tracing/traced_value.h#L46
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Replace manual `if (err) assert.fail(err)` and `assert.ok(!err)` with
`assert.ifError()` or `common.mustSucceed()` in a few tests to clarify
intent and follow project conventions.
- test/parallel/test-child-process-send-returns-boolean.js
- test/parallel/test-dgram-blocklist.js
- test/parallel/test-fs-watchfile.js
PR-URL: https://github.com/nodejs/node/pull/59424
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This test previously squeezed 70+ test cases into one single file
and has been constantly crashing on Windows with exit code
3221226505 and no stack trace. As it is already marked as flaky
there is no way to understand which test case is failing and
the Windows CI was constantly orange. This patch splits the
test cases into different files so it's easier to find out
which case is exactly failing and to be skipped.
PR-URL: https://github.com/nodejs/node/pull/59408
Refs: https://github.com/nodejs/node/issues/56794
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>