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 777205 - Misc fixes
Misc fixes
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
1.47.x
Other All
: Normal minor
: ---
Assigned To: Philip Chimento
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2017-01-13 08:09 UTC by Philip Chimento
Modified: 2017-01-28 06:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
minijasmine: Unref context on error (2.27 KB, patch)
2017-01-13 08:10 UTC, Philip Chimento
committed Details | Review
function: Fix Function.length for GI functions (2.34 KB, patch)
2017-01-13 08:10 UTC, Philip Chimento
committed Details | Review
gi: Remove _gi.add_interface() (1.32 KB, patch)
2017-01-13 08:10 UTC, Philip Chimento
committed Details | Review
object: Don't search more interfaces after resolving (962 bytes, patch)
2017-01-13 08:10 UTC, Philip Chimento
committed Details | Review
importer: Clean up extra roots (3.12 KB, patch)
2017-01-24 08:19 UTC, Philip Chimento
committed Details | Review
importer: Remove unused variable (833 bytes, patch)
2017-01-28 01:58 UTC, Philip Chimento
committed Details | Review
gi: Cleanup gjs_define_gi_stuff() (6.92 KB, patch)
2017-01-28 01:58 UTC, Philip Chimento
committed Details | Review

Description Philip Chimento 2017-01-13 08:09:34 UTC
Some fixes I noticed while working on other things.
Comment 1 Philip Chimento 2017-01-13 08:10:05 UTC
Created attachment 343410 [details] [review]
minijasmine: Unref context on error

We have to unref the GjsContext before exiting or JS_ShutDown() will
segfault. For convenience, stick the unref in bail_out().
Comment 2 Philip Chimento 2017-01-13 08:10:10 UTC
Created attachment 343411 [details] [review]
function: Fix Function.length for GI functions

The "length" property of a function is supposed to contain the number of
arguments in its signature. This was implemented for GI functions, but
due to a missing ++ it always returned 0.
Comment 3 Philip Chimento 2017-01-13 08:10:14 UTC
Created attachment 343412 [details] [review]
gi: Remove _gi.add_interface()

This used to be a function in the imports._gi module, but it was
rewritten at some point to be called only from C++. The JS function
definition was mistakenly left in. If you tried to call this function
from JS, it would almost certainly crash, so we may as well remove it.
Comment 4 Philip Chimento 2017-01-13 08:10:19 UTC
Created attachment 343413 [details] [review]
object: Don't search more interfaces after resolving

Once a method name is resolved on an object and the method defined,
there's no need to search through any more interfaces. We can break out
of the loop here.
Comment 5 Philip Chimento 2017-01-18 03:00:06 UTC
Comment on attachment 343410 [details] [review]
minijasmine: Unref context on error

Attachment 343410 [details] pushed as 340dfa8 - minijasmine: Unref context on error

Giovanni reviewed this on bug 776966.
Comment 6 Philip Chimento 2017-01-24 08:19:21 UTC
Created attachment 344096 [details] [review]
importer: Clean up extra roots

This function added extra roots where they weren't needed; we can clean
it up by taking a JS::HandleObject.
Comment 7 Cosimo Cecchi 2017-01-27 17:42:51 UTC
Review of attachment 343411 [details] [review]:

Looks good
Comment 8 Cosimo Cecchi 2017-01-27 17:43:10 UTC
Review of attachment 343412 [details] [review]:

Sure
Comment 9 Cosimo Cecchi 2017-01-27 17:43:32 UTC
Review of attachment 343413 [details] [review]:

OK
Comment 10 Cosimo Cecchi 2017-01-27 17:44:09 UTC
Review of attachment 344096 [details] [review]:

OK
Comment 11 Philip Chimento 2017-01-27 18:52:46 UTC
Attachment 343411 [details] pushed as d59dad5 - function: Fix Function.length for GI functions
Attachment 343412 [details] pushed as e2c89e8 - gi: Remove _gi.add_interface()
Attachment 343413 [details] pushed as 5e56722 - object: Don't search more interfaces after resolving
Attachment 344096 [details] pushed as 397251e - importer: Clean up extra roots
Comment 12 Philip Chimento 2017-01-28 01:58:27 UTC
Created attachment 344445 [details] [review]
importer: Remove unused variable

The compiler didn't warn about this because it calls a constructor, so it
might have had side effects.
Comment 13 Philip Chimento 2017-01-28 01:58:31 UTC
Created attachment 344446 [details] [review]
gi: Cleanup gjs_define_gi_stuff()

This function was identical to gjs_define_repo(), so we can remove it.
Comment 14 Cosimo Cecchi 2017-01-28 02:12:24 UTC
Review of attachment 344445 [details] [review]:

OK
Comment 15 Cosimo Cecchi 2017-01-28 02:12:51 UTC
Review of attachment 344446 [details] [review]:

Nice!
Comment 16 Philip Chimento 2017-01-28 06:04:54 UTC
Attachment 344445 [details] pushed as d4d83e9 - importer: Remove unused variable
Attachment 344446 [details] pushed as 0b9ad76 - gi: Cleanup gjs_define_gi_stuff()