aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/JSReadableState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/JSReadableState.cpp')
-rw-r--r--src/bun.js/bindings/JSReadableState.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bun.js/bindings/JSReadableState.cpp b/src/bun.js/bindings/JSReadableState.cpp
index 8a4ee746b..1f3a36def 100644
--- a/src/bun.js/bindings/JSReadableState.cpp
+++ b/src/bun.js/bindings/JSReadableState.cpp
@@ -29,7 +29,7 @@ int64_t getHighWaterMark(JSC::VM& vm, JSC::JSGlobalObject* globalObject, bool is
highWaterMarkVal = options->getIfPropertyExists(globalObject, JSC::Identifier::fromString(vm, "readableObjectMode"_s));
}
- if (highWaterMarkVal && !highWaterMarkVal.isUndefinedOrNull()) {
+ if (highWaterMarkVal && highWaterMarkVal.isNumber()) {
return highWaterMarkVal.toInt32(globalObject);
}
}
@@ -72,6 +72,9 @@ void JSReadableState::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObj
JSC::JSValue autoDestroyVal = options->getIfPropertyExists(globalObject, JSC::Identifier::fromString(vm, "autoDestroy"_s));
if (!autoDestroyVal || autoDestroyVal.toBoolean(globalObject))
setBool(JSReadableState::Mask::autoDestroy, true);
+ } else {
+ setBool(JSReadableState::Mask::emitClose, true);
+ setBool(JSReadableState::Mask::autoDestroy, true);
}
// Indicates whether the stream has finished destroying.