* js_RemoveScopeProperty must allocate scope->table, so it may fail. * Let's hope this doesn't happen too often for small scopes, due e.g. * to getter/setter definitions interleaved for several properties.
* Let js_AddScopeProperty handle this |overwriting| case, including * the conservation of sprop->slot (if it's valid).  We must not call * js_RemoveScopeProperty here, it will free a valid sprop->slot and * js_AddScopeProperty won't re-allocate it.
js_ChangeScopePropertyAttrs(JSContext *cx, JSScope *scope,                            JSScopeProperty *sprop, uintN attrs, uintN mask,                            JSPropertyOp getter, JSPropertyOp setter){    JSScopeProperty child, *newsprop, **spp;    CHECK_ANCESTOR_LINE(scope, JS_TRUE);    attrs |= sprop->attrs & mask;    if (getter == JS_PropertyStub)        getter = NULL;    if (setter == JS_PropertyStub)        setter = NULL;    if (sprop->attrs == attrs &&        sprop->getter == getter &&        sprop->setter == setter) {        return sprop;    }    child.id = sprop->id;    child.getter = getter;    child.setter = setter;    child.slot = sprop->slot;    child.attrs = attrs;    child.flags = sprop->flags;    child.shortid = sprop->shortid;    if (SCOPE_LAST_PROP(scope) == sprop) {        newsprop = GetPropertyTreeChild(cx, sprop->parent, &child);        if (newsprop) {            spp = js_SearchScope(scope, sprop->id, JS_FALSE);            JS_ASSERT(SPROP_FETCH(spp) == sprop);            if (scope->table)                SPROP_STORE_PRESERVING_COLLISION(spp, newsprop);            SCOPE_SET_LAST_PROP(scope, newsprop);            CHECK_ANCESTOR_LINE(scope, JS_TRUE);        }    } else {        /*         * js_RemoveScopeProperty must allocate scope->table, so it may fail.         * Let's hope this doesn't happen too often for small scopes, due e.g.         * to getter/setter definitions interleaved for several properties.         */        if (!js_RemoveScopeProperty(cx, scope, sprop->id)) {            newsprop = NULL;        } else {            newsprop = js_AddScopeProperty(cx, scope, child.id, child.getter,                                           child.setter, child.slot,                                           child.attrs, child.flags,                                           child.shortid);        }    }#ifdef DEBUG_brendan    if (!newsprop)        METER(changeFailures);#endif    return newsprop;}