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 619710 - [patch] log a warning if addSignalMethods() replaces existing methods
[patch] log a warning if addSignalMethods() replaces existing methods
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2010-05-26 12:55 UTC by Joe Shaw
Modified: 2017-01-03 14:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch which logs a warning if addSignalMethods() replaces existing methods (1.38 KB, patch)
2010-05-26 12:55 UTC, Joe Shaw
committed Details | Review

Description Joe Shaw 2010-05-26 12:55:48 UTC
Created attachment 162015 [details] [review]
patch which logs a warning if addSignalMethods() replaces existing methods

I found it helpful to log a warning when addSignalMethods() ends up replacing existing methods on objects.

Attaching a patch for this.
Comment 1 André Klapper 2012-02-03 13:57:48 UTC
Comment on attachment 162015 [details] [review]
patch which logs a warning if addSignalMethods() replaces existing methods

[Setting "patch" flag and correcting mime type so this can actually be queried for.]
Comment 2 Philip Chimento 2017-01-03 05:21:41 UTC
Review of attachment 162015 [details] [review]:

Looks fine. Since this patch is 7 and a half years old and you're probably not monitoring the bug anymore, I will push it with the change that I suggested, plus a test.

::: modules/signals.js
@@ +142,3 @@
+        log("WARNING: addSignalMethods is replacing existing " +
+            proto + " " + functionName + " method");
+        log("WARNING: old " + functionName + ": " + proto[functionName]);

I'd drop these two "old" and "new" lines, since on modern SpiderMonkey they will most likely print 'function something() { [sourceless code] }'
Comment 3 Joe Shaw 2017-01-03 14:24:21 UTC
Indeed I am not, but thank you for landing it anyway. Better late than never!