Bug 1133081, part 5 - Remove non-asserting PropertyDescriptor accessors in favor of the new PropDesc-inspired asserting accessors. r=efaust.

value() can't assert hasValue() because too many places have plausible reasons for calling it on a PropertyDescriptor they basically know nothing about. One such place is CompartmentChecker::check(Handle<JSPropertyDescriptor>). Another is DefinePropertyByDescriptor. Maybe this will change with time.

In some cases we do things like `desc.hasWritable() && desc.writable() != existing_desc.writable()`. It is OK to write it this way, even though we have not checked existing_desc.hasWritable(), because in these cases we already know existingDesc is a complete property descriptor.
This commit is contained in:
Jason Orendorff
2015-02-15 06:18:30 -06:00
parent e079c2024a
commit 495d3b16a3
17 changed files with 95 additions and 85 deletions

View File

@@ -327,7 +327,7 @@ Snapshot(JSContext *cx, HandleObject pobj_, unsigned flags, AutoIdVector *props)
if (!(flags & JSITER_HIDDEN)) {
if (!Proxy::getOwnPropertyDescriptor(cx, pobj, proxyProps[n], &desc))
return false;
enumerable = desc.isEnumerable();
enumerable = desc.enumerable();
}
if (!Enumerate(cx, pobj, proxyProps[n], enumerable, flags, ht, props))
@@ -1175,7 +1175,7 @@ SuppressDeletedPropertyHelper(JSContext *cx, HandleObject obj, StringPredicate p
return false;
if (desc.object()) {
if (desc.isEnumerable())
if (desc.enumerable())
continue;
}
}