概述: 这些语法让你编写JavaScriptCore相关的绑定代码,本来这些绑定代码默认会被自动生成.
用法:
[
JSCustomToNativeObject,
JSCustomFinalize,
CustomIsReachable,
JSCustomMarkFunction,
JSCustomNamedGetterOnPrototype,
JSCustomPushEventHandlerScope,
JSCustomDefineOwnProperty,
JSCustomDefineOwnPropertyOnPrototype,
JSCustomGetOwnPropertySlotAndDescriptor
] interface XXX {
};
你可以在这个文件里编写如下系列函数: WebCore/bindings/js/JSXXXCustom.cpp. 更多例子,请参考文件WebCore/bindings/js/JSXXXCustom.cpp
PassRefPtr<DOMWindow> toDOMWindow(JSGlobalData& globalData, JSValue value)
{
...;
}
void JSXXXOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
...;
}
bool JSXXXOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void* context, SlotVisitor& visitor)
{
...;
}
void JSXXX::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
...;
}
bool JSXXXPrototype::putDelegate(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
...;
}
ScopeChainNode* JSXXX::pushEventHandlerScope(ExecState* exec, ScopeChainNode* node) const
{
...;
}
bool JSXXX::defineOwnProperty(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, bool throwException)
{
...;
}
bool JSXXXPrototype::defineOwnProperty(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, bool throwException)
{
...;
}
bool JSXXX::getOwnPropertySlotDelegate(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
...;
}
bool JSXXX::getOwnPropertyDescriptorDelegate(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
{
...;
}
原文:http://blog.csdn.net/lichwei1983/article/details/43893089