After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 685413 - Information patches
Information patches
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2012-10-03 16:38 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2015-10-28 00:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
importer: Allow a module to see its full path (2.79 KB, patch)
2012-10-03 16:38 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
ns: Allow getting the name of a repository (1.28 KB, patch)
2012-10-03 16:38 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-10-03 16:38:27 UTC
These are two patches I wrote for two separate reasons that go
well together. All they do is allow people to get information
about the things that they imported.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-10-03 16:38:30 UTC
Created attachment 225692 [details] [review]
importer: Allow a module to see its full path
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-10-03 16:38:32 UTC
Created attachment 225693 [details] [review]
ns: Allow getting the name of a repository
Comment 3 Giovanni Campagna 2012-10-03 16:43:43 UTC
Review of attachment 225692 [details] [review]:

Makes sense. API frozen, though, so 3.7.1 unless necessary.
Comment 4 Giovanni Campagna 2012-10-03 16:45:17 UTC
Review of attachment 225693 [details] [review]:

The name of the repository is the name of the property you retrieve it from, so what's the point of this?
Are you passing namespace objects around?
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-10-03 16:47:23 UTC
(In reply to comment #4)
> Review of attachment 225693 [details] [review]:
> 
> The name of the repository is the name of the property you retrieve it from, so
> what's the point of this?
> Are you passing namespace objects around?

Mathematical Coffee is, apparently. I wrote it for her.
Comment 6 Giovanni Campagna 2012-10-03 17:08:14 UTC
Review of attachment 225693 [details] [review]:

That's very nice of you :)

But on technical grounds, I'm +0 on this API addition. I'll let someone else decide on it.

::: gi/ns.c
@@ +146,3 @@
+        goto out;
+
+ out:

out: needs to be before the end (but in this particular case, you can just return JS_FALSE, as you're not freeing anything)

@@ +148,3 @@
+ out:
+    if (gjs_string_from_utf8(context, priv->namespace, -1, &retval)) {
+        JS_SET_RVAL(context, vp, retval);

get_name is a JSPropertyOp, not a JSNative, so I think you should set *vp directly instead of using JS_SET_RVAL.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-10-03 19:50:28 UTC
(In reply to comment #6)
> Review of attachment 225693 [details] [review]:
> 
> That's very nice of you :)
> 
> But on technical grounds, I'm +0 on this API addition. I'll let someone else
> decide on it.

For the people who love this sort of introspection (the Python people), it's useful. It would probably be even more useful if we attached __module__ or something to classes and functions.
Comment 8 Colin Walters 2012-11-21 18:31:35 UTC
Comment on attachment 225692 [details] [review]
importer: Allow a module to see its full path

Attachment 225692 [details] pushed as 65f6748 - importer: Allow a module to see its full path
Comment 9 Cosimo Cecchi 2015-10-28 00:24:15 UTC
Rebased this on master and pushed it.

Attachment 225693 [details] pushed as 4a74c95 - ns: Allow getting the name of a repository