Bug 1148750, part 5 - CompletePropertyDescriptor upgrade. r=efaust.

This commit is contained in:
Jason Orendorff 2015-04-09 14:13:15 -05:00
parent 3dfe729a4a
commit 23ec0fc12f

View File

@ -809,9 +809,9 @@ js::CheckPropertyDescriptorAccessors(JSContext* cx, Handle<PropertyDescriptor> d
void
js::CompletePropertyDescriptor(MutableHandle<PropertyDescriptor> desc)
{
desc.assertValid();
if (desc.isGenericDescriptor() || desc.isDataDescriptor()) {
if (!desc.hasValue())
desc.value().setUndefined();
if (!desc.hasWritable())
desc.attributesRef() |= JSPROP_READONLY;
desc.attributesRef() &= ~(JSPROP_IGNORE_READONLY | JSPROP_IGNORE_VALUE);
@ -822,11 +822,11 @@ js::CompletePropertyDescriptor(MutableHandle<PropertyDescriptor> desc)
desc.setSetterObject(nullptr);
desc.attributesRef() |= JSPROP_GETTER | JSPROP_SETTER | JSPROP_SHARED;
}
if (!desc.hasEnumerable())
desc.attributesRef() &= ~JSPROP_ENUMERATE;
if (!desc.hasConfigurable())
desc.attributesRef() |= JSPROP_PERMANENT;
desc.attributesRef() &= ~(JSPROP_IGNORE_PERMANENT | JSPROP_IGNORE_ENUMERATE);
desc.assertComplete();
}
bool