mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Give the JS engine some knowledge of wrappers so that they can compare equal and be noticed when they take part in __proto__ cycles; this was supposed to land before. bug 397855, r=brendan sr=dveditz
This commit is contained in:
parent
c39fb98cef
commit
7c7e1261bf
@ -1212,7 +1212,9 @@ struct JSExtendedClass {
|
||||
JSObjectOp outerObject;
|
||||
JSObjectOp innerObject;
|
||||
JSIteratorOp iteratorObject;
|
||||
JSObjectOp wrappedObject;
|
||||
JSObjectOp wrappedObject; /* NB: infallible, null
|
||||
returns are treated as
|
||||
the original object */
|
||||
void (*reserved0)(void);
|
||||
void (*reserved1)(void);
|
||||
void (*reserved2)(void);
|
||||
|
@ -1522,13 +1522,19 @@ js_StrictlyEqual(JSContext *cx, jsval lval, jsval rval)
|
||||
robj = JSVAL_TO_OBJECT(rval);
|
||||
lclasp = OBJ_GET_CLASS(cx, lobj);
|
||||
rclasp = OBJ_GET_CLASS(cx, robj);
|
||||
if (lclasp->flags & rclasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *lxclasp = (JSExtendedClass *) lclasp,
|
||||
*rxclasp = (JSExtendedClass *) rclasp;
|
||||
return (lxclasp->wrappedObject && rxclasp->wrappedObject)
|
||||
? lxclasp->wrappedObject(cx, lval) ==
|
||||
rxclasp->wrappedObject(cx, rval)
|
||||
: lval == rval;
|
||||
if (lclasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *xclasp = (JSExtendedClass *) lclasp;
|
||||
if (xclasp->wrappedObject &&
|
||||
(lobj = xclasp->wrappedObject(cx, lobj))) {
|
||||
lval = OBJECT_TO_JSVAL(lobj);
|
||||
}
|
||||
}
|
||||
if (rclasp->flags & JSCLASS_IS_EXTENDED) {
|
||||
JSExtendedClass *xclasp = (JSExtendedClass *) rclasp;
|
||||
if (xclasp->wrappedObject &&
|
||||
(robj = xclasp->wrappedObject(cx, robj))) {
|
||||
rval = OBJECT_TO_JSVAL(robj);
|
||||
}
|
||||
}
|
||||
}
|
||||
return lval == rval;
|
||||
|
@ -201,6 +201,8 @@ JSExtendedClass sXPC_SJOW_JSClass = {
|
||||
},
|
||||
// JSExtendedClass initialization
|
||||
XPC_SJOW_Equality,
|
||||
nsnull, // outerObject
|
||||
nsnull, // innerObject
|
||||
nsnull, // iteratorObject
|
||||
XPC_SJOW_WrappedObject,
|
||||
JSCLASS_NO_RESERVED_MEMBERS
|
||||
|
Loading…
Reference in New Issue
Block a user