Skip to content

Commit 0f70c35

Browse files
deps: update undici to 6.6.2
1 parent ec80ece commit 0f70c35

File tree

7 files changed

+815
-142
lines changed

7 files changed

+815
-142
lines changed

deps/undici/src/index-fetch.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ module.exports.FormData = require('./lib/fetch/formdata').FormData
1414
module.exports.Headers = require('./lib/fetch/headers').Headers
1515
module.exports.Response = require('./lib/fetch/response').Response
1616
module.exports.Request = require('./lib/fetch/request').Request
17+
1718
module.exports.WebSocket = require('./lib/websocket/websocket').WebSocket
19+
20+
module.exports.EventSource = require('./lib/eventsource/eventsource').EventSource

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,11 +1099,12 @@ function fetchFinale (fetchParams, response) {
10991099

11001100
const byteStream = new ReadableStream({
11011101
readableStream: transformStream.readable,
1102+
async start () {
1103+
this._bodyReader = this.readableStream.getReader()
1104+
},
11021105
async pull (controller) {
1103-
const reader = this.readableStream.getReader()
1104-
11051106
while (controller.desiredSize >= 0) {
1106-
const { done, value } = await reader.read()
1107+
const { done, value } = await this._bodyReader.read()
11071108

11081109
if (done) {
11091110
queueMicrotask(() => readableStreamClose(controller))
@@ -1905,8 +1906,8 @@ async function httpNetworkFetch (
19051906

19061907
// 11. Let pullAlgorithm be an action that resumes the ongoing fetch
19071908
// if it is suspended.
1908-
const pullAlgorithm = () => {
1909-
fetchParams.controller.resume()
1909+
const pullAlgorithm = async () => {
1910+
await fetchParams.controller.resume()
19101911
}
19111912

19121913
// 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s
@@ -2032,7 +2033,7 @@ async function httpNetworkFetch (
20322033

20332034
// 9. If stream doesn’t need more data ask the user agent to suspend
20342035
// the ongoing fetch.
2035-
if (!fetchParams.controller.controller.desiredSize) {
2036+
if (fetchParams.controller.controller.desiredSize <= 0) {
20362037
return
20372038
}
20382039
}

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@ webidl.errors.invalidArgument = function (context) {
3434

3535
// https://webidl.spec.whatwg.org/#implements
3636
webidl.brandCheck = function (V, I, opts = undefined) {
37-
if (opts?.strict !== false && !(V instanceof I)) {
38-
throw new TypeError('Illegal invocation')
37+
if (opts?.strict !== false) {
38+
if (!(V instanceof I)) {
39+
throw new TypeError('Illegal invocation')
40+
}
3941
} else {
40-
return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]
42+
if (V?.[Symbol.toStringTag] !== I.prototype[Symbol.toStringTag]) {
43+
throw new TypeError('Illegal invocation')
44+
}
4145
}
4246
}
4347

0 commit comments

Comments
 (0)