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 585609 - dbus.js: Undefined variable expectedNumberArgs
dbus.js: Undefined variable expectedNumberArgs
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2009-06-12 22:30 UTC by Siegfried Gevatter (RainCT)
Modified: 2009-08-01 03:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Siegfried Gevatter (RainCT) 2009-06-12 22:30:19 UTC
In source/gjs/modules/dbus.js the variable expectedNumberArgs is used in an error message at lines 77 and 80. However, this variable does not exist; minNumberArgs should be used instead.

This is the affected code:

===============================
let signatureLength = this.signatureLength(inSignature);
    let minNumberArgs = signatureLength;
    let maxNumberArgs = signatureLength + 2;

    if (arg_array.length < minNumberArgs) {
        throw new Error("Not enough arguments passed for method: " + methodName +
                       ". Expected " + expectedNumberArgs + ", got " + arg_array.length);
    } else if (arg_array.length > maxNumberArgs) {
        throw new Error("Too many arguments passed for method: " + methodName +
                       ". Maximum is " + expectedNumberArgs +
                        " + one callback and/or flags");
    }
===============================

When it gets invoked, the error «JS ERROR: !!! Exception was: ReferenceError: expectedNumberArgs is not defined» is printed. Changing expdectedNumberArgs to minNumberArgs the code works as expected.