Bug 1090537, part 12 - Change SetNonexistentProperty to use only receiver, not obj. No change in behavior. r=efaust.
(The behavior doesn't change because Unqualified is only passed from two call sites, and in both places, the same object is passed for both receiver and obj.)
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -2002,31 +2002,30 @@ SetPropertyByDefining(typename Execution
JSPROP_ENUMERATE, v, true, strict);
}
/*
* Implement "the rest of" assignment to a property when no property receiver[id]
* was found anywhere on the prototype chain.
*
* FIXME: This should be updated to follow ES6 draft rev 28, section 9.1.9,
- * steps 4.d.i and 5. Right now it doesn't exactly follow any standard, and in
- * particular receiver should be used instead of obj throughout.
+ * steps 4.d.i and 5.
*
* Note that receiver is not necessarily native.
*/
template <ExecutionMode mode>
static bool
SetNonexistentProperty(typename ExecutionModeTraits<mode>::ContextType cxArg,
- HandleObject obj, HandleObject receiver, HandleId id,
- baseops::QualifiedBool qualified, HandleValue v, bool strict)
+ HandleObject receiver, HandleId id, baseops::QualifiedBool qualified,
+ HandleValue v, bool strict)
{
// We should never add properties to lexical blocks.
- MOZ_ASSERT(!obj->is<BlockObject>());
+ MOZ_ASSERT(!receiver->is<BlockObject>());
- if (obj->isUnqualifiedVarObj() && !qualified) {
+ if (receiver->isUnqualifiedVarObj() && !qualified) {
if (mode == ParallelExecution)
return false;
if (!MaybeReportUndeclaredVarAssignment(cxArg->asJSContext(), JSID_TO_STRING(id)))
return false;
}
return SetPropertyByDefining<mode>(cxArg, receiver, id, v, strict);
@@ -2060,17 +2059,17 @@ baseops::SetPropertyHelper(typename Exec
pobj = npobj;
} else {
JSContext *cx = cxArg->asJSContext();
if (!LookupNativeProperty(cx, obj, id, &pobj, &shape))
return false;
}
if (!shape)
- return SetNonexistentProperty<mode>(cxArg, obj, receiver, id, qualified, vp, strict);
+ return SetNonexistentProperty<mode>(cxArg, receiver, id, qualified, vp, strict);
if (!pobj->isNative()) {
if (pobj->is<ProxyObject>()) {
if (mode == ParallelExecution)
return false;
JSContext *cx = cxArg->asJSContext();
Rooted<PropertyDescriptor> pd(cx);