summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chimento <philip@endlessm.com>2016-10-21 17:50:38 -0700
committerPhilip Chimento <philip@endlessm.com>2016-12-09 19:04:49 -0800
commitcefe2ad4bdd2be5fd846518686142c8c4ca0acaf (patch)
treec9dca60d74590fa2d72d9e6fe42811d207f33b5b
parentcd355eaa081676c102fe4b369a3d8e92c78413d3 (diff)
downloadgjs-cefe2ad4bdd2be5fd846518686142c8c4ca0acaf.tar.gz
importer: Use new JS_GetOwnPropertyDescriptor()
Technically it was incorrect to use JS_GetPropertyDescriptorById() here although it was unlikely to cause any problems. https://bugzilla.gnome.org/show_bug.cgi?id=751252
-rw-r--r--gjs/importer.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 71dd3f64..bd883f32 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -152,13 +152,8 @@ seal_import(JSContext *cx,
const char *name)
{
JS::Rooted<JSPropertyDescriptor> descr(cx);
- JS::RootedId prop_id(cx, gjs_intern_string_to_id(cx, name));
- /* COMPAT: To be replaced with JS_GetOwnPropertyDescriptor() in mozjs31.
- * This also looks for properties higher up the prototype chain, but in
- * practice this will always be an own property because we defined it in
- * define_import(). */
- if (!JS_GetPropertyDescriptorById(cx, obj, prop_id, &descr) ||
+ if (!JS_GetOwnPropertyDescriptor(cx, obj, name, &descr) ||
descr.object() == NULL) {
gjs_debug(GJS_DEBUG_IMPORTER,
"Failed to get attributes to seal '%s' in importer",