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/helpers.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/javascript/jsc/bindings/helpers.h') diff --git a/src/javascript/jsc/bindings/helpers.h b/src/javascript/jsc/bindings/helpers.h index a24ecefcb..e35dd34f4 100644 --- a/src/javascript/jsc/bindings/helpers.h +++ b/src/javascript/jsc/bindings/helpers.h @@ -124,9 +124,9 @@ static ZigString toZigString(JSC::Identifier *str, JSC::JSGlobalObject *global) static WTF::StringView toStringView(ZigString str) { return WTF::StringView(str.ptr, str.len); } -static void throwException(JSC::ThrowScope &scope, ZigString msg, JSC::JSGlobalObject *global) { - auto str = toJSString(msg, global); - scope.throwException(global, JSC::Exception::create(global->vm(), JSC::JSValue(str))); +static void throwException(JSC::ThrowScope &scope, ZigErrorType err, JSC::JSGlobalObject *global) { + scope.throwException( + global, JSC::Exception::create(global->vm(), JSC::JSValue((JSC::EncodedJSValue)err.ptr))); } static ZigString toZigString(JSC::JSValue val, JSC::JSGlobalObject *global) { @@ -144,6 +144,4 @@ static ZigString toZigString(JSC::JSValue val, JSC::JSGlobalObject *global) { return toZigString(str); } -static ZigException ZigExceptionNone = ZigException{ - 0, 0, ZigStringEmpty, ZigStringEmpty, ZigStringEmpty, -1, -1, ZigStringEmpty, nullptr}; -} // namespace Zig +}; // namespace Zig -- cgit v1.2.3