X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/aabea98c2f0415ea5882dad2b9ff9fc3b1d5c97c..5a2ae41928193b489e490abb580abc2fa53181ea:/Library.cpp diff --git a/Library.cpp b/Library.cpp index dbb86f2..cccd69b 100644 --- a/Library.cpp +++ b/Library.cpp @@ -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_;