[gjs/mozjs31: 6/7] importer: Use new JS_GetOwnPropertyDescriptor()



commit 35ed3812fc4284a9b257d68f152f4256a26e73f8
Author: Philip Chimento <philip endlessm com>
Date:   Fri Oct 21 17:50:38 2016 -0700

    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

 gjs/importer.cpp |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 71dd3f6..bd883f3 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",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]