GNOME Bugzilla – Bug 777205
Misc fixes
Last modified: 2017-01-28 06:05:01 UTC
Some fixes I noticed while working on other things.
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().
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.
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.
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 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.
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.
Review of attachment 343411 [details] [review]: Looks good
Review of attachment 343412 [details] [review]: Sure
Review of attachment 343413 [details] [review]: OK
Review of attachment 344096 [details] [review]: OK
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
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.
Created attachment 344446 [details] [review] gi: Cleanup gjs_define_gi_stuff() This function was identical to gjs_define_repo(), so we can remove it.
Review of attachment 344445 [details] [review]: OK
Review of attachment 344446 [details] [review]: Nice!
Attachment 344445 [details] pushed as d4d83e9 - importer: Remove unused variable Attachment 344446 [details] pushed as 0b9ad76 - gi: Cleanup gjs_define_gi_stuff()