Loading ...
Sorry, an error occurred while loading the content.

a small problem is found

Expand Messages
  • kipenzam
    Hello, I coded like this: (function () { Kip.shell2 = function (stream, reg, prefix, suffix) { return stream ? stream.replace(reg, function ($1) { return
    Message 1 of 2 , Dec 29, 2010
    • 0 Attachment
      Hello,

      I coded like this:

      (function () {
      Kip.shell2 = function (stream, reg, prefix, suffix) {
      return stream ? stream.replace(reg, function ($1) {
      return prefix + $1 + suffix;
      }): false;
      };
      (more lines, of course)
      }());

      and got this:

      Unused variable: reg 34 "anonymous"

      the variable reg has scope on shell2, not the anonymous function.
    • Douglas Crockford
      ... That s not the result I see. What aren t you telling us?
      Message 2 of 2 , Dec 29, 2010
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "kipenzam" <kipenzam@...> wrote:
        > I coded like this:
        >
        > (function () {
        > Kip.shell2 = function (stream, reg, prefix, suffix) {
        > return stream ? stream.replace(reg, function ($1) {
        > return prefix + $1 + suffix;
        > }): false;
        > };
        > (more lines, of course)
        > }());
        >
        > and got this:
        >
        > Unused variable: reg 34 "anonymous"
        >
        > the variable reg has scope on shell2, not the anonymous function.

        That's not the result I see. What aren't you telling us?
      Your message has been successfully submitted and would be delivered to recipients shortly.