mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Make sure to call XML methods properly in property ICs, no bug. r=dvander
This commit is contained in:
parent
8fddf285b4
commit
ec406a6cd9
@ -199,6 +199,21 @@ AssertValidPropertyCacheHit(JSContext *cx, JSObject *start, JSObject *found,
|
||||
{}
|
||||
#endif
|
||||
|
||||
inline bool
|
||||
GetPropertyGenericMaybeCallXML(JSContext *cx, JSOp op, JSObject *obj, jsid id, Value *vp)
|
||||
{
|
||||
/*
|
||||
* Various XML properties behave differently when accessed in a
|
||||
* call vs. normal context, and getGeneric will not work right.
|
||||
*/
|
||||
#if JS_HAS_XML_SUPPORT
|
||||
if (op == JSOP_CALLPROP && obj->isXML())
|
||||
return js_GetXMLMethod(cx, obj, id, vp);
|
||||
#endif
|
||||
|
||||
return obj->getGeneric(cx, id, vp);
|
||||
}
|
||||
|
||||
inline bool
|
||||
GetPropertyOperation(JSContext *cx, jsbytecode *pc, const Value &lval, Value *vp)
|
||||
{
|
||||
@ -264,20 +279,8 @@ GetPropertyOperation(JSContext *cx, jsbytecode *pc, const Value &lval, Value *vp
|
||||
jsid id = ATOM_TO_JSID(name);
|
||||
|
||||
if (obj->getOps()->getProperty) {
|
||||
#if JS_HAS_XML_SUPPORT
|
||||
if (op == JSOP_CALLPROP && obj->isXML()) {
|
||||
/*
|
||||
* Various XML properties behave differently when accessed in a
|
||||
* call vs. normal context, and getGeneric will not work right.
|
||||
*/
|
||||
if (!js_GetXMLMethod(cx, obj, id, vp))
|
||||
if (!GetPropertyGenericMaybeCallXML(cx, op, obj, id, vp))
|
||||
return false;
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (!obj->getGeneric(cx, id, vp))
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!GetPropertyHelper(cx, obj, id, flags, vp))
|
||||
return false;
|
||||
|
@ -1907,7 +1907,7 @@ GetPropWithStub(VMFrame &f, ic::PICInfo *pic, VoidStubPIC stub)
|
||||
}
|
||||
|
||||
Value v;
|
||||
if (!obj->getProperty(f.cx, name, &v))
|
||||
if (!GetPropertyGenericMaybeCallXML(f.cx, JSOp(*f.pc()), obj, ATOM_TO_JSID(name), &v))
|
||||
THROW();
|
||||
|
||||
f.regs.sp[-1] = v;
|
||||
|
Loading…
Reference in New Issue
Block a user