mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
let it roll, let it crash down low
This commit is contained in:
@@ -29,8 +29,7 @@ function getGetter(cls, getter) {
|
||||
}
|
||||
|
||||
function uncurryThis(func) {
|
||||
// Intrinsics do not have `call` as a valid identifier, so this cannot be `Function.prototype.call.bind`.
|
||||
return FunctionPrototypeCall.bind(func);
|
||||
return (...args) => func.$call(...args);
|
||||
}
|
||||
|
||||
const copyProps = (src, dest) => {
|
||||
|
||||
@@ -127,10 +127,10 @@ function eos(stream, options, callback) {
|
||||
}
|
||||
|
||||
if (readable && !readableFinished && isReadableNodeStream(stream, true)) {
|
||||
if (!isReadableFinished(stream, false)) return callback.$call(stream, $ERR_STREAM_PREMATURE_CLOSE());
|
||||
if (!isReadableFinished(stream, false)) return callback.$call(stream, $ERR_STREAM_PREMATURE_CLOSE("readable"));
|
||||
}
|
||||
if (writable && !writableFinished) {
|
||||
if (!isWritableFinished(stream, false)) return callback.$call(stream, $ERR_STREAM_PREMATURE_CLOSE());
|
||||
if (!isWritableFinished(stream, false)) return callback.$call(stream, $ERR_STREAM_PREMATURE_CLOSE("writable"));
|
||||
}
|
||||
|
||||
callback.$call(stream);
|
||||
|
||||
@@ -219,7 +219,6 @@ function pipelineImpl(streams, callback, opts) {
|
||||
}
|
||||
|
||||
function finishImpl(err, final) {
|
||||
console.trace("finishImpl", err, final);
|
||||
if (err && (!error || error.code === "ERR_STREAM_PREMATURE_CLOSE")) {
|
||||
error = err;
|
||||
}
|
||||
@@ -296,6 +295,7 @@ function pipelineImpl(streams, callback, opts) {
|
||||
if (isTransformStream(ret)) {
|
||||
ret = makeAsyncIterable(ret?.readable);
|
||||
} else {
|
||||
// AAAA FUCK AAAAAAA
|
||||
ret = makeAsyncIterable(ret);
|
||||
}
|
||||
ret = stream(ret, { signal });
|
||||
|
||||
@@ -568,8 +568,12 @@ Readable.prototype.setEncoding = function (enc) {
|
||||
|
||||
const decoder = new StringDecoder(enc);
|
||||
state.decoder = decoder;
|
||||
// If setEncoding(null), decoder.encoding equals utf8.
|
||||
state.encoding = state.decoder.encoding;
|
||||
|
||||
if (enc == null) {
|
||||
state.encoding = "utf8";
|
||||
} else {
|
||||
state.encoding = state.decoder.encoding;
|
||||
}
|
||||
|
||||
// Iterate over current buffer to convert already stored Buffers:
|
||||
let content = "";
|
||||
|
||||
@@ -30,6 +30,7 @@ const Duplex = require("../streams/duplex");
|
||||
|
||||
const kEmptyObject = Object.freeze({ __proto__: null });
|
||||
|
||||
const { destroy } = require("../streams/destroy");
|
||||
|
||||
function handleKnownInternalErrors(cause) {
|
||||
switch (true) {
|
||||
|
||||
Reference in New Issue
Block a user