Bug 653888 - Clean up the Walk internal spec function, make the reviver delete properties from arrays if it returns undefined. r=pbiggar (relanding after a first try that appears to have triggered a random orange without methodjit on Linux debug, that went away on two rebuilds)

This commit is contained in:
Jeff Walden
2011-05-05 00:24:15 -04:00
parent fef827451d
commit b0af0ddd54
5 changed files with 176 additions and 36 deletions

View File

@@ -873,7 +873,9 @@ js_PrototypeHasIndexedProperties(JSContext *cx, JSObject *obj)
return JS_FALSE;
}
static JSBool
namespace js {
JSBool
array_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
PropertyOp getter, StrictPropertyOp setter, uintN attrs)
{
@@ -908,6 +910,8 @@ array_defineProperty(JSContext *cx, JSObject *obj, jsid id, const Value *value,
return js_DefineProperty(cx, obj, id, value, getter, setter, attrs);
}
} // namespace js
static JSBool
array_getAttributes(JSContext *cx, JSObject *obj, jsid id, uintN *attrsp)
{
@@ -924,7 +928,9 @@ array_setAttributes(JSContext *cx, JSObject *obj, jsid id, uintN *attrsp)
return JS_FALSE;
}
static JSBool
namespace js {
JSBool
array_deleteProperty(JSContext *cx, JSObject *obj, jsid id, Value *rval, JSBool strict)
{
uint32 i;
@@ -947,6 +953,8 @@ array_deleteProperty(JSContext *cx, JSObject *obj, jsid id, Value *rval, JSBool
return JS_TRUE;
}
} // namespace js
static void
array_trace(JSTracer *trc, JSObject *obj)
{