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

Re: Closure with outer parameters question

Expand Messages
  • douglascrockford
    ... Thanks. Please try it now.
    Message 1 of 3 , Mar 12, 2013
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "quintic" <nick_hobson@...> wrote:

      > Given...
      >
      > function f(x, y) {
      > 'use strict';
      > var t = x;
      > return function (z) {
      > console.log(x + y + t + z);
      > };
      > }
      >
      > ... JSLint reports:
      >
      > f(x, y)
      > closure
      > t, x
      > Should y also be reported as a closure variable?

      Thanks. Please try it now.
    • quintic
      ... That was fast -- thanks! It now reports t, x, y as closure variables.
      Message 2 of 3 , Mar 12, 2013
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "douglascrockford" <douglas@...> wrote:
        >
        > --- In jslint_com@yahoogroups.com, "quintic" <nick_hobson@> wrote:
        >
        > > Given...
        > >
        > > function f(x, y) {
        > > 'use strict';
        > > var t = x;
        > > return function (z) {
        > > console.log(x + y + t + z);
        > > };
        > > }
        > >
        > > ... JSLint reports:
        > >
        > > f(x, y)
        > > closure
        > > t, x
        > > Should y also be reported as a closure variable?
        >
        > Thanks. Please try it now.
        >

        That was fast -- thanks! It now reports t, x, y as closure variables.
      Your message has been successfully submitted and would be delivered to recipients shortly.