Bug 987111 - Add an assign() method to MutablePropertyDescriptorOperations. r=terrence

It's unfortunate the we need to operate on the raw JSPropertyDescriptor for
|other|, but the specialization that makes Handle<JSPropertyDescriptor> work is
declared later in the file, which isn't kosher.
This commit is contained in:
Bobby Holley 2014-06-04 15:12:25 -07:00
parent f5f076c2ef
commit ba47e0abf3

View File

@ -2935,6 +2935,14 @@ class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations<
value().setUndefined(); value().setUndefined();
} }
void assign(JSPropertyDescriptor &other) {
object().set(other.obj);
setAttributes(other.attrs);
setGetter(other.getter);
setSetter(other.setter);
value().set(other.value);
}
JS::MutableHandleObject object() { JS::MutableHandleObject object() {
return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj); return JS::MutableHandleObject::fromMarkedLocation(&desc()->obj);
} }