aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/bindings/ZigGlobalObject.cpp
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-08-01 19:04:38 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-08-01 19:04:38 -0700
commit85b6d448cebcb305dce4dee4b7fb96e309e5b94e (patch)
treebffeca8050173c801ba092d5b65d561b4d03dc1b /src/javascript/jsc/bindings/ZigGlobalObject.cpp
parent7245f90b2dd686acacb9c8ee03f5d8fb05e09aeb (diff)
downloadbun-85b6d448cebcb305dce4dee4b7fb96e309e5b94e.tar.gz
bun-85b6d448cebcb305dce4dee4b7fb96e309e5b94e.tar.zst
bun-85b6d448cebcb305dce4dee4b7fb96e309e5b94e.zip
hm
Former-commit-id: 0dc1c1a74b845d037326f4f2facd786924ca722e
Diffstat (limited to 'src/javascript/jsc/bindings/ZigGlobalObject.cpp')
-rw-r--r--src/javascript/jsc/bindings/ZigGlobalObject.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/javascript/jsc/bindings/ZigGlobalObject.cpp b/src/javascript/jsc/bindings/ZigGlobalObject.cpp
index 8897b8d21..4a4c3ec96 100644
--- a/src/javascript/jsc/bindings/ZigGlobalObject.cpp
+++ b/src/javascript/jsc/bindings/ZigGlobalObject.cpp
@@ -147,7 +147,7 @@ JSC::Identifier GlobalObject::moduleLoaderResolve(JSGlobalObject *globalObject,
return toIdentifier(res.result.value, globalObject);
} else {
auto scope = DECLARE_THROW_SCOPE(globalObject->vm());
- throwException(scope, res.result.err.message, globalObject);
+ throwException(scope, res.result.err, globalObject);
return globalObject->vm().propertyNames->emptyIdentifier;
}
}
@@ -168,7 +168,7 @@ JSC::JSInternalPromise *GlobalObject::moduleLoaderImportModule(JSGlobalObject *g
globalObject, toZigString(moduleNameValue, globalObject),
sourceURL.isEmpty() ? ZigStringCwd : toZigString(sourceURL.fileSystemPath()));
if (!resolved.success) {
- throwException(scope, resolved.result.err.message, globalObject);
+ throwException(scope, resolved.result.err, globalObject);
return promise->rejectWithCaughtException(globalObject, scope);
}
@@ -196,11 +196,15 @@ JSC::JSInternalPromise *GlobalObject::moduleLoaderFetch(JSGlobalObject *globalOb
auto moduleKey = key.toWTFString(globalObject);
RETURN_IF_EXCEPTION(scope, promise->rejectWithCaughtException(globalObject, scope));
auto moduleKeyZig = toZigString(moduleKey);
+ ErrorableResolvedSource res;
+ res.success = false;
+ res.result.err.code = 0;
+ res.result.err.ptr = nullptr;
- auto res = Zig__GlobalObject__fetch(globalObject, moduleKeyZig, ZigStringEmpty);
+ Zig__GlobalObject__fetch(&res, globalObject, moduleKeyZig, ZigStringEmpty);
if (!res.success) {
- throwException(scope, res.result.err.message, globalObject);
+ throwException(scope, res.result.err, globalObject);
RETURN_IF_EXCEPTION(scope, promise->rejectWithCaughtException(globalObject, scope));
}
d>1-1/+1 2023-10-06docs: `file.stream()` is not a promise (#6337)Gravatar Paul Nodet 1-1/+1