iphone - JavaScriptCore Framework / library
#include <dlfcn.h>
@implementation JSCocoaSymbolFetcher
+ (void)populateJavascriptCoreSymbols
{
_JSEvaluateScript = dlsym(RTLD_DEFAULT, "JSEvaluateScript");
_JSGarbageCollect = dlsym(RTLD_DEFAULT, "JSGarbageCollect");
_JSGlobalContextCreate = dlsym(RTLD_DEFAULT, "JSGlobalContextCreate");
_JSGlobalContextRetain = dlsym(RTLD_DEFAULT, "JSGlobalContextRetain");
_JSGlobalContextRelease = dlsym(RTLD_DEFAULT, "JSGlobalContextRelease");
_JSContextGetGlobalObject = dlsym(RTLD_DEFAULT, "JSContextGetGlobalObject");
_JSClassCreate = dlsym(RTLD_DEFAULT, "JSClassCreate");
_JSClassRetain = dlsym(RTLD_DEFAULT, "JSClassRetain");
.
.
.//other similar code
.
}
JSValueRef (*_JSEvaluateScript)(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception);
JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
{
return _JSEvaluateScript(ctx, script, thisObject, sourceURL, startingLineNumber, exception);
}
void (*_JSGarbageCollect)(JSContextRef ctx);
void JSGarbageCollect(JSContextRef ctx)
{
return _JSGarbageCollect(ctx);
}
#include <dlfcn.h>
@implementation JSCocoaSymbolFetcher
+ (void)populateJavascriptCoreSymbols
{
_JSEvaluateScript = dlsym(RTLD_DEFAULT, "JSEvaluateScript");
_JSGarbageCollect = dlsym(RTLD_DEFAULT, "JSGarbageCollect");
_JSGlobalContextCreate = dlsym(RTLD_DEFAULT, "JSGlobalContextCreate");
_JSGlobalContextRetain = dlsym(RTLD_DEFAULT, "JSGlobalContextRetain");
_JSGlobalContextRelease = dlsym(RTLD_DEFAULT, "JSGlobalContextRelease");
_JSContextGetGlobalObject = dlsym(RTLD_DEFAULT, "JSContextGetGlobalObject");
_JSClassCreate = dlsym(RTLD_DEFAULT, "JSClassCreate");
_JSClassRetain = dlsym(RTLD_DEFAULT, "JSClassRetain");
.
.
.//other similar code
.
}
JSValueRef (*_JSEvaluateScript)(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception);
JSValueRef JSEvaluateScript(JSContextRef ctx, JSStringRef script, JSObjectRef thisObject, JSStringRef sourceURL, int startingLineNumber, JSValueRef* exception)
{
return _JSEvaluateScript(ctx, script, thisObject, sourceURL, startingLineNumber, exception);
}
void (*_JSGarbageCollect)(JSContextRef ctx);
void JSGarbageCollect(JSContextRef ctx)
{
return _JSGarbageCollect(ctx);
}
If the answers is incorrect or not given, you can answer the above question in the comment box. If the answers is incorrect or not given, you can answer the above question in the comment box.