Skip to content

Commit db5a879

Browse files
committed
Merge branch 'main' into process/get-sourcemaps-enabled
2 parents 47842aa + 9cc7327 commit db5a879

File tree

806 files changed

+8538
-2307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

806 files changed

+8538
-2307
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ test/fixtures
55
test/message/esm_display_syntax_error.mjs
66
tools/icu
77
tools/lint-md/lint-md.mjs
8+
tools/github_reporter
89
benchmark/tmp
910
benchmark/fixtures
1011
doc/**/*.js

.github/workflows/build-tarball.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ jobs:
9494
- name: Test
9595
run: |
9696
cd $TAR_DIR
97-
make run-ci -j2 V=1 TEST_CI_ARGS="-p dots --measure-flakiness 9"
97+
make run-ci -j2 V=1 TEST_CI_ARGS="-p dots --node-args='--test-reporter=spec' --measure-flakiness 9"

.github/workflows/coverage-linux-without-intl.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
# TODO(bcoe): fix the couple tests that fail with the inspector enabled.
5454
# The cause is most likely coverage's use of the inspector.
5555
- name: Test
56-
run: NODE_V8_COVERAGE=coverage/tmp make test-cov -j2 V=1 TEST_CI_ARGS="-p dots --measure-flakiness 9" || exit 0
56+
run: NODE_V8_COVERAGE=coverage/tmp make test-cov -j2 V=1 TEST_CI_ARGS="-p dots --node-args='--test-reporter=spec' --measure-flakiness 9" || exit 0
5757
- name: Report JS
5858
run: npx c8 report --check-coverage
5959
env:

.github/workflows/coverage-linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
# TODO(bcoe): fix the couple tests that fail with the inspector enabled.
5454
# The cause is most likely coverage's use of the inspector.
5555
- name: Test
56-
run: NODE_V8_COVERAGE=coverage/tmp make test-cov -j2 V=1 TEST_CI_ARGS="-p dots --measure-flakiness 9" || exit 0
56+
run: NODE_V8_COVERAGE=coverage/tmp make test-cov -j2 V=1 TEST_CI_ARGS="-p dots --node-args='--test-reporter=spec' --measure-flakiness 9" || exit 0
5757
- name: Report JS
5858
run: npx c8 report --check-coverage
5959
env:

.github/workflows/doc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ jobs:
4040
name: docs
4141
path: out/doc
4242
- name: Test
43-
run: NODE=$(command -v node) make test-doc-ci TEST_CI_ARGS="-p actions --measure-flakiness 9"
43+
run: NODE=$(command -v node) make test-doc-ci TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' --measure-flakiness 9"

.github/workflows/test-asan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
- name: Build
6060
run: make build-ci -j2 V=1
6161
- name: Test
62-
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions -t 300 --measure-flakiness 9"
62+
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' -t 300 --measure-flakiness 9"

.github/workflows/test-linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ jobs:
4646
- name: Build
4747
run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn"
4848
- name: Test
49-
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9"
49+
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' --measure-flakiness 9"

.github/workflows/test-macos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ jobs:
6060
- name: Build
6161
run: make build-ci -j$(getconf _NPROCESSORS_ONLN) V=1 CONFIG_FLAGS="--error-on-warn"
6262
- name: Test
63-
run: make run-ci -j$(getconf _NPROCESSORS_ONLN) V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9"
63+
run: make run-ci -j$(getconf _NPROCESSORS_ONLN) V=1 TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' --measure-flakiness 9"

.github/workflows/tools.yml

+8
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ jobs:
140140
cat temp-output
141141
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
142142
rm temp-output
143+
- id: github_reporter
144+
subsystem: tools
145+
label: tools
146+
run: |
147+
./tools/dep_updaters/update-github-reporter.sh > temp-output
148+
cat temp-output
149+
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
150+
rm temp-output
143151
- id: googletest
144152
subsystem: deps
145153
label: dependencies, test

deps/googletest/include/gtest/gtest-message.h

+34-2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@
5656

5757
#include "gtest/internal/gtest-port.h"
5858

59+
#ifdef GTEST_HAS_ABSL
60+
#include <type_traits>
61+
62+
#include "absl/strings/internal/has_absl_stringify.h"
63+
#include "absl/strings/str_cat.h"
64+
#endif // GTEST_HAS_ABSL
65+
5966
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
6067
/* class A needs to have dll-interface to be used by clients of class B */)
6168

@@ -111,8 +118,17 @@ class GTEST_API_ Message {
111118
*ss_ << str;
112119
}
113120

114-
// Streams a non-pointer value to this object.
115-
template <typename T>
121+
// Streams a non-pointer value to this object. If building a version of
122+
// GoogleTest with ABSL, this overload is only enabled if the value does not
123+
// have an AbslStringify definition.
124+
template <typename T
125+
#ifdef GTEST_HAS_ABSL
126+
,
127+
typename std::enable_if<
128+
!absl::strings_internal::HasAbslStringify<T>::value, // NOLINT
129+
int>::type = 0
130+
#endif // GTEST_HAS_ABSL
131+
>
116132
inline Message& operator<<(const T& val) {
117133
// Some libraries overload << for STL containers. These
118134
// overloads are defined in the global namespace instead of ::std.
@@ -133,6 +149,22 @@ class GTEST_API_ Message {
133149
return *this;
134150
}
135151

152+
#ifdef GTEST_HAS_ABSL
153+
// Streams a non-pointer value with an AbslStringify definition to this
154+
// object.
155+
template <typename T,
156+
typename std::enable_if<
157+
absl::strings_internal::HasAbslStringify<T>::value, // NOLINT
158+
int>::type = 0>
159+
inline Message& operator<<(const T& val) {
160+
// ::operator<< is needed here for a similar reason as with the non-Abseil
161+
// version above
162+
using ::operator<<;
163+
*ss_ << absl::StrCat(val);
164+
return *this;
165+
}
166+
#endif // GTEST_HAS_ABSL
167+
136168
// Streams a pointer value to this object.
137169
//
138170
// This function is an overload of the previous one. When you

deps/googletest/include/gtest/gtest.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151

5252
#include <cstddef>
5353
#include <cstdint>
54-
#include <iomanip>
5554
#include <limits>
5655
#include <memory>
5756
#include <ostream>
@@ -1574,12 +1573,12 @@ AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
15741573
}
15751574

15761575
::std::stringstream lhs_ss;
1577-
lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1578-
<< lhs_value;
1576+
lhs_ss.precision(std::numeric_limits<RawType>::digits10 + 2);
1577+
lhs_ss << lhs_value;
15791578

15801579
::std::stringstream rhs_ss;
1581-
rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1582-
<< rhs_value;
1580+
rhs_ss.precision(std::numeric_limits<RawType>::digits10 + 2);
1581+
rhs_ss << rhs_value;
15831582

15841583
return EqFailure(lhs_expression, rhs_expression,
15851584
StringStreamToString(&lhs_ss), StringStreamToString(&rhs_ss),

deps/googletest/include/gtest/internal/gtest-internal.h

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858

5959
#include <cstdint>
6060
#include <functional>
61-
#include <iomanip>
6261
#include <limits>
6362
#include <map>
6463
#include <set>

deps/googletest/include/gtest/internal/gtest-port.h

+4-14
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@
220220
// GTEST_HAS_ALT_PATH_SEP_ - Always defined to 0 or 1.
221221
// GTEST_WIDE_STRING_USES_UTF16_ - Always defined to 0 or 1.
222222
// GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Always defined to 0 or 1.
223-
// GTEST_HAS_DOWNCAST_ - Always defined to 0 or 1.
224223
// GTEST_HAS_NOTIFICATION_- Always defined to 0 or 1.
225224
//
226225
// Synchronization:
@@ -313,10 +312,6 @@
313312
#include "gtest/internal/custom/gtest-port.h"
314313
#include "gtest/internal/gtest-port-arch.h"
315314

316-
#ifndef GTEST_HAS_DOWNCAST_
317-
#define GTEST_HAS_DOWNCAST_ 0
318-
#endif
319-
320315
#ifndef GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
321316
#define GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ 0
322317
#endif
@@ -1153,17 +1148,12 @@ inline To ImplicitCast_(To x) {
11531148
// check to enforce this.
11541149
template <class Derived, class Base>
11551150
Derived* CheckedDowncastToActualType(Base* base) {
1151+
static_assert(std::is_base_of<Base, Derived>::value,
1152+
"target type not derived from source type");
11561153
#if GTEST_HAS_RTTI
1157-
GTEST_CHECK_(typeid(*base) == typeid(Derived));
1158-
#endif
1159-
1160-
#if GTEST_HAS_DOWNCAST_
1161-
return ::down_cast<Derived*>(base);
1162-
#elif GTEST_HAS_RTTI
1163-
return dynamic_cast<Derived*>(base); // NOLINT
1164-
#else
1165-
return static_cast<Derived*>(base); // Poor man's downcast.
1154+
GTEST_CHECK_(base == nullptr || dynamic_cast<Derived*>(base) != nullptr);
11661155
#endif
1156+
return static_cast<Derived*>(base);
11671157
}
11681158

11691159
#if GTEST_HAS_STREAM_REDIRECTION

deps/googletest/src/gtest-internal-inl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ class GTEST_API_ UnitTestImpl {
672672
void AddTestInfo(internal::SetUpTestSuiteFunc set_up_tc,
673673
internal::TearDownTestSuiteFunc tear_down_tc,
674674
TestInfo* test_info) {
675-
#ifdef GTEST_HAS_FILE_SYSTEM
675+
#if GTEST_HAS_FILE_SYSTEM
676676
// In order to support thread-safe death tests, we need to
677677
// remember the original working directory when the test program
678678
// was first invoked. We cannot do this in RUN_ALL_TESTS(), as

deps/undici/src/docs/api/ProxyAgent.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ Extends: [`AgentOptions`](Agent.md#parameter-agentoptions)
1919
* **uri** `string` (required) - It can be passed either by a string or a object containing `uri` as string.
2020
* **token** `string` (optional) - It can be passed by a string of token for authentication.
2121
* **auth** `string` (**deprecated**) - Use token.
22-
* **clientFactory** `(origin: URL, opts: Object) => Dispatcher` - Default: `(origin, opts) => new Pool(origin, opts)`
22+
* **clientFactory** `(origin: URL, opts: Object) => Dispatcher` (optional) - Default: `(origin, opts) => new Pool(origin, opts)`
23+
* **requestTls** `BuildOptions` (optional) - Options object passed when creating the underlying socket via the connector builder for the request. See [TLS](https://nodejs.org/api/tls.html#tlsconnectoptions-callback).
24+
* **proxyTls** `BuildOptions` (optional) - Options object passed when creating the underlying socket via the connector builder for the proxy server. See [TLS](https://nodejs.org/api/tls.html#tlsconnectoptions-callback).
2325

2426
Examples:
2527

deps/undici/src/lib/api/abort-signal.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const { addAbortListener } = require('../core/util')
12
const { RequestAbortedError } = require('../core/errors')
23

34
const kListener = Symbol('kListener')
@@ -29,11 +30,7 @@ function addSignal (self, signal) {
2930
abort(self)
3031
}
3132

32-
if ('addEventListener' in self[kSignal]) {
33-
self[kSignal].addEventListener('abort', self[kListener])
34-
} else {
35-
self[kSignal].addListener('abort', self[kListener])
36-
}
33+
addAbortListener(self[kSignal], self[kListener])
3734
}
3835

3936
function removeSignal (self) {

deps/undici/src/lib/api/readable.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,13 @@ module.exports = class BodyReadable extends Readable {
155155
const abortFn = () => {
156156
this.destroy()
157157
}
158+
let signalListenerCleanup
158159
if (signal) {
159160
if (typeof signal !== 'object' || !('aborted' in signal)) {
160161
throw new InvalidArgumentError('signal must be an AbortSignal')
161162
}
162163
util.throwIfAborted(signal)
163-
signal.addEventListener('abort', abortFn, { once: true })
164+
signalListenerCleanup = util.addAbortListener(signal, abortFn)
164165
}
165166
try {
166167
for await (const chunk of this) {
@@ -173,8 +174,10 @@ module.exports = class BodyReadable extends Readable {
173174
} catch {
174175
util.throwIfAborted(signal)
175176
} finally {
176-
if (signal) {
177-
signal.removeEventListener('abort', abortFn)
177+
if (typeof signalListenerCleanup === 'function') {
178+
signalListenerCleanup()
179+
} else if (signalListenerCleanup) {
180+
signalListenerCleanup[Symbol.dispose]()
178181
}
179182
}
180183
}

deps/undici/src/lib/core/util.js

+19
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,24 @@ function throwIfAborted (signal) {
422422
}
423423
}
424424

425+
let events
426+
function addAbortListener (signal, listener) {
427+
if (typeof Symbol.dispose === 'symbol') {
428+
if (!events) {
429+
events = require('events')
430+
}
431+
if (typeof events.addAbortListener === 'function' && 'aborted' in signal) {
432+
return events.addAbortListener(signal, listener)
433+
}
434+
}
435+
if ('addEventListener' in signal) {
436+
signal.addEventListener('abort', listener, { once: true })
437+
return () => signal.removeEventListener('abort', listener)
438+
}
439+
signal.addListener('abort', listener)
440+
return () => signal.removeListener('abort', listener)
441+
}
442+
425443
const hasToWellFormed = !!String.prototype.toWellFormed
426444

427445
/**
@@ -469,6 +487,7 @@ module.exports = {
469487
isFormDataLike,
470488
buildURL,
471489
throwIfAborted,
490+
addAbortListener,
472491
nodeMajor,
473492
nodeMinor,
474493
nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13)

deps/undici/src/lib/fetch/body.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function extractBody (object, keepalive = false) {
105105
// Set source to a copy of the bytes held by object.
106106
source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
107107
} else if (util.isFormDataLike(object)) {
108-
const boundary = `----formdata-undici-${Math.random()}`.replace('.', '').slice(0, 32)
108+
const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
109109
const prefix = `--${boundary}\r\nContent-Disposition: form-data`
110110

111111
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */

deps/undici/src/lib/fetch/index.js

+21-14
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const {
5656
const { kHeadersList } = require('../core/symbols')
5757
const EE = require('events')
5858
const { Readable, pipeline } = require('stream')
59-
const { isErrored, isReadable, nodeMajor, nodeMinor } = require('../core/util')
59+
const { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = require('../core/util')
6060
const { dataURLProcessor, serializeAMimeType } = require('./dataURL')
6161
const { TransformStream } = require('stream/web')
6262
const { getGlobalDispatcher } = require('../global')
@@ -174,22 +174,22 @@ async function fetch (input, init = {}) {
174174
let controller = null
175175

176176
// 11. Add the following abort steps to requestObject’s signal:
177-
requestObject.signal.addEventListener(
178-
'abort',
177+
addAbortListener(
178+
requestObject.signal,
179179
() => {
180180
// 1. Set locallyAborted to true.
181181
locallyAborted = true
182182

183-
// 2. Abort the fetch() call with p, request, responseObject,
183+
// 2. Assert: controller is non-null.
184+
assert(controller != null)
185+
186+
// 3. Abort controller with requestObject’s signal’s abort reason.
187+
controller.abort(requestObject.signal.reason)
188+
189+
// 4. Abort the fetch() call with p, request, responseObject,
184190
// and requestObject’s signal’s abort reason.
185191
abortFetch(p, request, responseObject, requestObject.signal.reason)
186-
187-
// 3. If controller is not null, then abort controller.
188-
if (controller != null) {
189-
controller.abort()
190-
}
191-
},
192-
{ once: true }
192+
}
193193
)
194194

195195
// 12. Let handleFetchDone given response response be to finalize and
@@ -319,7 +319,7 @@ function finalizeAndReportTiming (response, initiatorType = 'other') {
319319
// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing
320320
function markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {
321321
if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {
322-
performance.markResourceTiming(timingInfo, originalURL, initiatorType, globalThis, cacheState)
322+
performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)
323323
}
324324
}
325325

@@ -1986,7 +1986,7 @@ async function httpNetworkFetch (
19861986
if (key.toLowerCase() === 'content-encoding') {
19871987
// https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1
19881988
// "All content-coding values are case-insensitive..."
1989-
codings = val.toLowerCase().split(',').map((x) => x.trim())
1989+
codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()
19901990
} else if (key.toLowerCase() === 'location') {
19911991
location = val
19921992
}
@@ -2007,7 +2007,14 @@ async function httpNetworkFetch (
20072007
for (const coding of codings) {
20082008
// https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2
20092009
if (coding === 'x-gzip' || coding === 'gzip') {
2010-
decoders.push(zlib.createGunzip())
2010+
decoders.push(zlib.createGunzip({
2011+
// Be less strict when decoding compressed responses, since sometimes
2012+
// servers send slightly invalid responses that are still accepted
2013+
// by common browsers.
2014+
// Always using Z_SYNC_FLUSH is what cURL does.
2015+
flush: zlib.constants.Z_SYNC_FLUSH,
2016+
finishFlush: zlib.constants.Z_SYNC_FLUSH
2017+
}))
20112018
} else if (coding === 'deflate') {
20122019
decoders.push(zlib.createInflate())
20132020
} else if (coding === 'br') {

0 commit comments

Comments
 (0)