зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1114580 - Define getBuiltinClass on Xray. r=peterv
This commit is contained in:
Родитель
de25516000
Коммит
92024846c1
|
@ -2282,6 +2282,13 @@ XrayWrapper<Base, Traits>::construct(JSContext* cx, HandleObject wrapper, const
|
|||
return Traits::construct(cx, wrapper, args, Base::singleton);
|
||||
}
|
||||
|
||||
template <typename Base, typename Traits>
|
||||
bool
|
||||
XrayWrapper<Base, Traits>::getBuiltinClass(JSContext* cx, JS::HandleObject wrapper, js::ESClass* cls) const
|
||||
{
|
||||
return Traits::getBuiltinClass(cx, wrapper, Base::singleton, cls);
|
||||
}
|
||||
|
||||
template <typename Base, typename Traits>
|
||||
const char*
|
||||
XrayWrapper<Base, Traits>::className(JSContext* cx, HandleObject wrapper) const
|
||||
|
|
|
@ -83,6 +83,11 @@ public:
|
|||
return result.succeed();
|
||||
}
|
||||
|
||||
static bool getBuiltinClass(JSContext* cx, JS::HandleObject wrapper, const js::Wrapper& baseInstance,
|
||||
js::ESClass* cls) {
|
||||
return baseInstance.getBuiltinClass(cx, wrapper, cls);
|
||||
}
|
||||
|
||||
static const char* className(JSContext* cx, JS::HandleObject wrapper, const js::Wrapper& baseInstance) {
|
||||
return baseInstance.className(cx, wrapper);
|
||||
}
|
||||
|
@ -390,6 +395,12 @@ public:
|
|||
return JS_WrapObject(cx, protop);
|
||||
}
|
||||
|
||||
static bool getBuiltinClass(JSContext* cx, JS::HandleObject wrapper, const js::Wrapper& baseInstance,
|
||||
js::ESClass* cls) {
|
||||
*cls = js::ESClass::Other;
|
||||
return true;
|
||||
}
|
||||
|
||||
static const char* className(JSContext* cx, JS::HandleObject wrapper, const js::Wrapper& baseInstance) {
|
||||
return "Opaque";
|
||||
}
|
||||
|
@ -458,6 +469,7 @@ class XrayWrapper : public Base {
|
|||
virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
JS::AutoIdVector& props) const override;
|
||||
|
||||
virtual bool getBuiltinClass(JSContext* cx, JS::HandleObject wapper, js::ESClass* cls) const override;
|
||||
virtual const char* className(JSContext* cx, JS::HandleObject proxy) const override;
|
||||
|
||||
static const XrayWrapper singleton;
|
||||
|
|
Загрузка…
Ссылка в новой задаче