]> git.saurik.com Git - cycript.git/blobdiff - Exception.hpp
Instance's toPointer() should return as CFTypeRef.
[cycript.git] / Exception.hpp
index cd4bd08436e9d60326f0aae708e8d83a0d622f33..1efaf3f3762a848bf5b9156a4a9b8a2d0bb786e7 100644 (file)
@@ -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)) \