Bug 1128648 - Remove fretting about DynamicWithObject in Shape::set. r=efaust.

--HG--
extra : rebase_source : fc663cf11ee408207a25003db973364ad104c8df
This commit is contained in:
Jason Orendorff 2015-02-02 13:59:55 -06:00
parent e5521cbf56
commit 49e80e2c34
2 changed files with 4 additions and 12 deletions

View File

@ -41,10 +41,11 @@ Shape::search(ExclusiveContext *cx, jsid id)
}
inline bool
Shape::set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict,
Shape::set(JSContext* cx, HandleNativeObject obj, HandleObject receiver, bool strict,
MutableHandleValue vp)
{
MOZ_ASSERT_IF(hasDefaultSetter(), hasGetterValue());
MOZ_ASSERT(!obj->is<DynamicWithObject>()); // See bug 1128681.
if (attrs & JSPROP_SETTER) {
Value fval = setterValue();
@ -58,16 +59,6 @@ Shape::set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict,
return true;
RootedId id(cx, propid());
/*
* |with (it) color='red';| ends up here.
* Avoid exposing the With object to native setters.
*/
if (obj->is<DynamicWithObject>()) {
RootedObject nobj(cx, &obj->as<DynamicWithObject>().object());
return CallJSPropertyOpSetter(cx, setterOp(), nobj, id, strict, vp);
}
return CallJSPropertyOpSetter(cx, setterOp(), obj, id, strict, vp);
}

View File

@ -962,7 +962,8 @@ class Shape : public gc::TenuredCell
setter() == rawSetter;
}
bool set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict, MutableHandleValue vp);
bool set(JSContext* cx, HandleNativeObject obj, HandleObject receiver, bool strict,
MutableHandleValue vp);
BaseShape *base() const { return base_.get(); }