0
我正在查看SpiderMonkey的源代碼並試圖瞭解如何自定義函數'getProperty'。但很難追蹤到'getProperty'真正將財產設置爲返回值的適當位置。所以任何人都可以在代碼中顯示'適當的地方'?getProperty如何在SpiderMonkey中工作?
目前,我在NativeObject.h是:
inline bool
js::GetProperty(JSContext* cx, HandleObject obj, HandleObject receiver, HandleId id, MutableHandleValue vp)
{
if (GetPropertyOp op = obj->getOps()->getProperty)
return op(cx, obj, receiver, id, vp);
return NativeGetProperty(cx, obj.as<NativeObject>(), receiver, id, vp);
}
會有什麼OP(CX,OBJ,接收器,ID,VP)嗎?
謝謝。