GNOME Bugzilla – Bug 685413
Information patches
Last modified: 2015-10-28 00:24:18 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.
Created attachment 225692 [details] [review] importer: Allow a module to see its full path
Created attachment 225693 [details] [review] ns: Allow getting the name of a repository
Review of attachment 225692 [details] [review]: Makes sense. API frozen, though, so 3.7.1 unless necessary.
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?
(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.
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.
(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 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
Rebased this on master and pushed it. Attachment 225693 [details] pushed as 4a74c95 - ns: Allow getting the name of a repository