Don't lose getter/setter attribute in default proxy set handler (bug 631488, r=brendan).

This commit is contained in:
Andreas Gal 2011-02-07 16:06:24 -08:00
Родитель 17f23f9738
Коммит bf90b96544
1 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -178,16 +178,14 @@ JSProxyHandler::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id,
desc.getter = PropertyStub;
if (!desc.setter)
desc.setter = PropertyStub;
/* fall through */
} else {
/* Pick up the class getter/setter. */
desc.getter = desc.setter = NULL;
return defineProperty(cx, receiver, id, &desc);
}
desc.obj = receiver;
desc.value = *vp;
desc.attrs = JSPROP_ENUMERATE;
desc.shortid = 0;
desc.getter = desc.setter = NULL; // Pick up the class getter/setter.
return defineProperty(cx, receiver, id, &desc);
}