[gjs/wip/ptomato/mozjs31: 22/22] importer: Use new JS_GetOwnPropertyDescriptor()



commit 20415ed833643e0a4e4700748175f06107ed107a
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.

 gjs/importer.cpp |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 361a75f..1aa6c97 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]