From: Jay Freeman (saurik) Date: Fri, 10 Jan 2014 07:01:53 +0000 (-0800) Subject: Support @error when CYONifying JavaScript arrays. X-Git-Tag: v0.9.500~83 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/1eeb7e57bf949a0198dddb0eb734c36eed82f59b Support @error when CYONifying JavaScript arrays. --- diff --git a/Execute.cpp b/Execute.cpp index 139aada..e118146 100644 --- a/Execute.cpp +++ b/Execute.cpp @@ -451,18 +451,21 @@ static JSValueRef Array_callAsFunction_toCYON(JSContextRef context, JSObjectRef bool comma(false); for (size_t index(0), count(CYCastDouble(context, length)); index != count; ++index) { - JSValueRef value(CYGetProperty(context, _this, index)); - if (comma) str << ','; else comma = true; - if (!JSValueIsUndefined(context, value)) - str << CYPoolCCYON(pool, context, value); - else { - str << ','; - comma = false; + try { + JSValueRef value(CYGetProperty(context, _this, index)); + if (!JSValueIsUndefined(context, value)) + str << CYPoolCCYON(pool, context, value); + else { + str << ','; + comma = false; + } + } catch (const CYException &error) { + str << "@error"; } }