From 85b6d448cebcb305dce4dee4b7fb96e309e5b94e Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 1 Aug 2021 19:04:38 -0700 Subject: hm Former-commit-id: 0dc1c1a74b845d037326f4f2facd786924ca722e --- src/javascript/jsc/bindings/ZigGlobalObject.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/javascript/jsc/bindings/ZigGlobalObject.cpp') 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)); } -- cgit v1.2.3