Use JS_DefineProperty instead of JS_SetProperty for the additional control over the property we're setting. bug 330773, r+sr=jst

This commit is contained in:
mrbkap%gmail.com 2006-03-21 02:16:31 +00:00
Родитель f2238ef436
Коммит 6aba6ed88c
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -5508,7 +5508,8 @@ nsWindowSH::GlobalResolve(nsGlobalWindow *aWin, JSContext *cx,
v = OBJECT_TO_JSVAL(dot_prototype);
if (!::JS_SetProperty(cx, class_obj, "prototype", &v)) {
if (!::JS_DefineProperty(cx, class_obj, "prototype", v, NULL, NULL,
JSPROP_ENUMERATE)) {
return NS_ERROR_UNEXPECTED;
}