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; 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);
} }