X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/2e43a0b0c288f70981ab2715c8135ac7b9cd0f1b..9e7cf36beb748d738fc51d2d8e3e4fe2e2a6ea72:/Exception.hpp diff --git a/Exception.hpp b/Exception.hpp index 4b97f83..1efaf3f 100644 --- a/Exception.hpp +++ b/Exception.hpp @@ -1,5 +1,5 @@ -/* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2015 Jay Freeman (saurik) +/* Cycript - The Truly Universal Scripting Language + * Copyright (C) 2009-2016 Jay Freeman (saurik) */ /* GNU Affero General Public License, Version 3 {{{ */ @@ -56,13 +56,17 @@ void CYThrow(JSContextRef context, JSValueRef value); #define CYCatch_(value, name) \ catch (const CYException &error) { \ *exception = error.CastJSValue(context, name); \ + _assert(*exception != NULL); \ return value; \ } catch (...) { \ *exception = CYCastJSValue(context, "catch(...)"); \ + _assert(*exception != NULL); \ return value; \ } #define CYCatch(value) \ CYCatch_(value, "Error") +#define CYCatchObject() \ + CYCatch(JSObjectMake(context, NULL, NULL)) #define _assert_(mode, test, code, format, ...) do \ if (!(test)) \