[gjs] importer: Use new JS_GetOwnPropertyDescriptor()
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] importer: Use new JS_GetOwnPropertyDescriptor()
- Date: Sat, 10 Dec 2016 03:48:36 +0000 (UTC)
commit cefe2ad4bdd2be5fd846518686142c8c4ca0acaf
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]