Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titleUsing the JSLint tool

The JSLint tool cannot tell that the JavaScript is being run within the environment of the IdP, with the implied inputs and outputs that that infers. This manifests itself in two ways:

  • It dpes JSLint does not like the input object and other customobjects that seem to magically appear from nowhere. From a Shibboleth perspective, this is a feature, not a bug. You can safely ignore this warning issued by the JSLint tool.
  • Equally it does not like the "last value is the implied return" paradigm. Should this grate you can fool JSLint by using a closure as the last line, for instance replacing

    Code Block
    var retVal;
    retVal = false;
    //
    // arbitrary code to set up retVal, consulting input and customref
    //
    retVal;

    with

    Code Block
    var retVal;
    retVal = false;
    //
    // arbitrary code to set up retVal, consulting input and customref
    //
    (function (val) {
        return val;
    }(retVal));

    Only you can decide whether this will help maintainabilty. For clarity and didactic purpose the examples omit this paradigm.

...