зеркало из https://github.com/mozilla/pjs.git
Don't lose getter/setter attribute in default proxy set handler (bug 631488, r=brendan).
This commit is contained in:
Родитель
17f23f9738
Коммит
bf90b96544
|
@ -178,16 +178,14 @@ JSProxyHandler::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id,
|
||||||
desc.getter = PropertyStub;
|
desc.getter = PropertyStub;
|
||||||
if (!desc.setter)
|
if (!desc.setter)
|
||||||
desc.setter = PropertyStub;
|
desc.setter = PropertyStub;
|
||||||
/* fall through */
|
return defineProperty(cx, receiver, id, &desc);
|
||||||
} else {
|
|
||||||
/* Pick up the class getter/setter. */
|
|
||||||
desc.getter = desc.setter = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
desc.obj = receiver;
|
desc.obj = receiver;
|
||||||
desc.value = *vp;
|
desc.value = *vp;
|
||||||
desc.attrs = JSPROP_ENUMERATE;
|
desc.attrs = JSPROP_ENUMERATE;
|
||||||
desc.shortid = 0;
|
desc.shortid = 0;
|
||||||
|
desc.getter = desc.setter = NULL; // Pick up the class getter/setter.
|
||||||
return defineProperty(cx, receiver, id, &desc);
|
return defineProperty(cx, receiver, id, &desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче