aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/bindings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/bindings/bindings.cpp')
-rw-r--r--src/bun.js/bindings/bindings.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp
index d0de85849..3500c32e5 100644
--- a/src/bun.js/bindings/bindings.cpp
+++ b/src/bun.js/bindings/bindings.cpp
@@ -417,6 +417,12 @@ JSC__JSValue SystemError__toErrorInstance(const SystemError* arg0,
JSC::PropertyAttribute::DontDelete | 0);
}
+ if (err.fd != -1) {
+ JSC::JSValue fd = JSC::JSValue(jsNumber(err.fd));
+ result->putDirect(vm, JSC::Identifier::fromString(vm, "fd"_s), fd,
+ JSC::PropertyAttribute::DontDelete | 0);
+ }
+
if (err.syscall.len > 0) {
JSC::JSValue syscall = JSC::JSValue(Zig::toJSString(err.syscall, globalObject));
result->putDirect(vm, clientData->builtinNames().syscallPublicName(), syscall,
@@ -2392,6 +2398,12 @@ static void fromErrorInstance(ZigException* except, JSC::JSGlobalObject* global,
except->path = Zig::toZigString(path, global);
}
+ if (JSC::JSValue fd = obj->getIfPropertyExists(global, Identifier::fromString(global->vm(), "fd"_s))) {
+ if (fd.isAnyInt()) {
+ except->fd = fd.toInt32(global);
+ }
+ }
+
if (JSC::JSValue errno_ = obj->getIfPropertyExists(global, clientData->builtinNames().errnoPublicName())) {
except->errno_ = errno_.toInt32(global);
}