X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/e0625f37947994a0b96c15cc3b56c5a6b13642e2..5a2ae41928193b489e490abb580abc2fa53181ea:/Library.cpp diff --git a/Library.cpp b/Library.cpp index d80978e..cccd69b 100644 --- a/Library.cpp +++ b/Library.cpp @@ -145,7 +145,7 @@ _finline size_t iconv_(size_t (*iconv)(iconv_t, Type_, size_t *, char **, size_t return iconv(cd, const_cast(inbuf), inbytesleft, outbuf, outbytesleft); } -static CYUTF8String CYPoolUTF8String(apr_pool_t *pool, JSContextRef context, JSStringRef value) { +CYUTF8String CYPoolUTF8String(apr_pool_t *pool, JSContextRef context, JSStringRef value) { _assert(pool != NULL); CYUTF16String utf16(CYCastUTF16String(value)); @@ -1449,8 +1449,6 @@ CYJSError::CYJSError(JSContextRef context, const char *format, ...) { CYThrow(context, exception); } -void CYObjectiveC(JSContextRef context, JSObjectRef global); - JSGlobalContextRef CYGetJSContext() { CYInitialize(); @@ -1569,10 +1567,8 @@ JSGlobalContextRef CYGetJSContext() { Result_ = JSStringCreateWithUTF8CString("_"); -// XXX: this is very wrong and sad -#ifdef __APPLE__ - CYObjectiveC(context, global); -#endif + if (hooks_ != NULL && hooks_->SetupContext != NULL) + (*hooks_->SetupContext)(context); } return Context_;