Count both the getter and setter for a given property. bug 381303, r=crowder

This commit is contained in:
mrbkap@gmail.com 2007-05-21 11:02:33 -07:00
parent 9c08aa4311
commit fae1dec6be

View File

@ -882,6 +882,8 @@ js_obj_toSource(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
ATOM_TO_STRING(cx->runtime->atomState.getterAtom);
gsop[valcnt] =
ATOM_TO_STRING(cx->runtime->atomState.getAtom);
valcnt++;
}
if (attrs & JSPROP_SETTER) {
val[valcnt] = (jsval) ((JSScopeProperty *)prop)->setter;
@ -889,8 +891,9 @@ js_obj_toSource(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
ATOM_TO_STRING(cx->runtime->atomState.setterAtom);
gsop[valcnt] =
ATOM_TO_STRING(cx->runtime->atomState.setAtom);
valcnt++;
}
valcnt++;
} else {
valcnt = 1;
gsop[0] = NULL;