mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 832014 part 7. Fix Xray support for unforgeable methods. r=peterv
This commit is contained in:
parent
12589bea78
commit
90de70e4f5
@ -1061,39 +1061,14 @@ XrayResolveAttribute(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
XrayResolveUnforgeableProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JSPropertyDescriptor> desc,
|
||||
const NativeProperties* nativeProperties)
|
||||
{
|
||||
return !nativeProperties || !nativeProperties->unforgeableAttributes ||
|
||||
XrayResolveAttribute(cx, wrapper, obj, id,
|
||||
nativeProperties->unforgeableAttributes,
|
||||
nativeProperties->unforgeableAttributeIds,
|
||||
nativeProperties->unforgeableAttributeSpecs,
|
||||
desc);
|
||||
}
|
||||
|
||||
static bool
|
||||
XrayResolveProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
XrayResolveMethod(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JSPropertyDescriptor> desc, DOMObjectType type,
|
||||
const NativeProperties* nativeProperties)
|
||||
const Prefable<const JSFunctionSpec>* methods,
|
||||
jsid* methodIds,
|
||||
const JSFunctionSpec* methodsSpecs,
|
||||
JS::MutableHandle<JSPropertyDescriptor> desc)
|
||||
{
|
||||
const Prefable<const JSFunctionSpec>* methods;
|
||||
jsid* methodIds;
|
||||
const JSFunctionSpec* methodsSpecs;
|
||||
if (type == eInterface) {
|
||||
methods = nativeProperties->staticMethods;
|
||||
methodIds = nativeProperties->staticMethodIds;
|
||||
methodsSpecs = nativeProperties->staticMethodsSpecs;
|
||||
} else {
|
||||
methods = nativeProperties->methods;
|
||||
methodIds = nativeProperties->methodIds;
|
||||
methodsSpecs = nativeProperties->methodsSpecs;
|
||||
}
|
||||
if (methods) {
|
||||
const Prefable<const JSFunctionSpec>* method;
|
||||
for (method = methods; method->specs; ++method) {
|
||||
if (method->isEnabled(cx, obj)) {
|
||||
@ -1129,6 +1104,76 @@ XrayResolveProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
XrayResolveUnforgeableProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JSPropertyDescriptor> desc,
|
||||
const NativeProperties* nativeProperties)
|
||||
{
|
||||
if (!nativeProperties) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nativeProperties->unforgeableAttributes) {
|
||||
if (!XrayResolveAttribute(cx, wrapper, obj, id,
|
||||
nativeProperties->unforgeableAttributes,
|
||||
nativeProperties->unforgeableAttributeIds,
|
||||
nativeProperties->unforgeableAttributeSpecs,
|
||||
desc)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (desc.object()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (nativeProperties->unforgeableMethods) {
|
||||
if (!XrayResolveMethod(cx, wrapper, obj, id,
|
||||
nativeProperties->unforgeableMethods,
|
||||
nativeProperties->unforgeableMethodIds,
|
||||
nativeProperties->unforgeableMethodSpecs,
|
||||
desc)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (desc.object()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
XrayResolveProperty(JSContext* cx, JS::Handle<JSObject*> wrapper,
|
||||
JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
|
||||
JS::MutableHandle<JSPropertyDescriptor> desc, DOMObjectType type,
|
||||
const NativeProperties* nativeProperties)
|
||||
{
|
||||
const Prefable<const JSFunctionSpec>* methods;
|
||||
jsid* methodIds;
|
||||
const JSFunctionSpec* methodsSpecs;
|
||||
if (type == eInterface) {
|
||||
methods = nativeProperties->staticMethods;
|
||||
methodIds = nativeProperties->staticMethodIds;
|
||||
methodsSpecs = nativeProperties->staticMethodsSpecs;
|
||||
} else {
|
||||
methods = nativeProperties->methods;
|
||||
methodIds = nativeProperties->methodIds;
|
||||
methodsSpecs = nativeProperties->methodsSpecs;
|
||||
}
|
||||
if (methods) {
|
||||
if (!XrayResolveMethod(cx, wrapper, obj, id, methods, methodIds,
|
||||
methodsSpecs, desc)) {
|
||||
return false;
|
||||
}
|
||||
if (desc.object()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == eInterface) {
|
||||
|
Loading…
Reference in New Issue
Block a user