summaryrefslogtreecommitdiffstats
path: root/js/src/jsapi.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-09-06 10:29:38 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-09-06 10:29:38 +0200
commit9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7 (patch)
tree0f3678a1ed688c2f430b1cae5859916790908ac6 /js/src/jsapi.cpp
parentab6242a93b849b0a3c7525b16bc01dd3172fc167 (diff)
parent6db06749e2037029adc96660aafa5339ed609e60 (diff)
downloadUXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.tar
UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.tar.gz
UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.tar.lz
UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.tar.xz
UXP-9fdff854ebf1fe1a118061d57fd0a2d6c5c7dfd7.zip
Merge branch 'master' into release
Diffstat (limited to 'js/src/jsapi.cpp')
-rw-r--r--js/src/jsapi.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index 84a315587..cad0840e0 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -2011,6 +2011,28 @@ JS_GetOwnUCPropertyDescriptor(JSContext* cx, HandleObject obj, const char16_t* n
}
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)
{