Suppose i have a behavior for a.b() as
JSC::JSLock lock(false);
WebCore::JSDOMWindow *window = WebCore::toJSDOMWindow(pFrame,
mainThreadNormalWorld());
if (window) {
RootObject *root = pFrame->script()->bindingRootObject();
setJavaVM(vm);
// Add the binding to JS environment
JSC::ExecState* exec = window->globalExec();
JSC::JSObject* addedObject =
WeakJavaInstance::create(javascriptObj,
root)->createRuntimeObject(exec);
const jchar* s = env->GetStringChars(interfaceName, NULL);
if (s) {
// Add the binding name to the window's table of child
objects.
JSC::PutPropertySlot slot;
window->put(exec, JSC::Identifier(exec, (const UChar *)s,
env->GetStringLength(interfaceName)), addedObject,
slot);
env->ReleaseStringChars(interfaceName, s);
checkException(env);
}
}
how do i implement a.b.c() kinda behavior?
can you please help me achieve this
In JSCocoa, letting the user write a.b.c or a.b.c() in runtime was achieved by returning a wrapper object, but this was very fragile as it would miss some cases (don't remember which ones).
-Patrick
> --
> JSCocoa: http://inexdo.com/JSCocoa
> Source: http://github.com/parmanoir/jscocoa/tree/master
> Docs: http://code.google.com/p/jscocoa/
> Group: http://groups.google.com/group/jscocoa
> Unsubscribe: jscocoa+u...@googlegroups.com