Fix a crash in IndexedDB.

This commit is contained in:
wolfbeast 2019-09-04 21:04:07 +02:00 committed by Roy Tam
commit cfc50f18c4
10 changed files with 102 additions and 39 deletions

View file

@ -2010,6 +2010,28 @@ JS_GetOwnUCPropertyDescriptor(JSContext* cx, HandleObject obj, const char16_t* n
return JS_GetOwnPropertyDescriptorById(cx, obj, id, desc);
}
JS_PUBLIC_API(bool)
JS_GetOwnElement(JSContext* cx, JS::HandleObject obj, uint32_t index, JS::MutableHandleValue vp)
{
RootedId id(cx);
if (!IndexToId(cx, index, &id)) {
return false;
}
Rooted<PropertyDescriptor> desc(cx);
if (!JS_GetOwnPropertyDescriptorById(cx, obj, id, &desc)) {
return false;
}
if (desc.object() && desc.isDataDescriptor()) {
vp.set(desc.value());
} else {
vp.setUndefined();
}
return true;
}
JS_PUBLIC_API(bool)
JS_GetPropertyDescriptorById(JSContext* cx, HandleObject obj, HandleId id,
MutableHandle<PropertyDescriptor> desc)