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

2051Re: [jslint] Re: JSLint Bug?

Expand Messages
  • Lindsay John Lawrence
    Mar 10, 2011
    • 0 Attachment
      Thanks! Why the change though? Is 'continue' being deprecated in the language?

      --Lindsay


      --- On Thu, 3/10/11, spence.randall@... <randall@...> wrote:

      From: spence.randall@... <randall@...>
      Subject: [jslint] Re: JSLint Bug?
      To: jslint_com@yahoogroups.com
      Date: Thursday, March 10, 2011, 11:00 AM







       













      It's not a bug, JSLint has a new(ish) "Tolerate continue" option. You can check that box in options, or add /*jslint continue:true*/ to your code.



      Or you could refactor your code to avoid the use of continue. In your example, you could just set i = 5 in the loop and drop the if check, or check if i > 5 then run nop().



      -Randall



      --- In jslint_com@yahoogroups.com, Lindsay John Lawrence <thinknlive@...> wrote:

      >

      > Hello,

      >

      >       Problem at line 9 character 7: Unexpected 'continue'.

      >

      >

      > I now get an error like the above with loops that have a 'continue' of the form shown in the sample code below.

      >

      > Is this a bug in jslint or is it now enforcing some form I am not aware of?

      >

      > // --- start sample code ---

      > var nop = function () {

      >   return;

      > };

      >

      > var test = function () {

      >   var i;

      >   for (i=0; i<10; i+=1) {

      >     if (i<5) {

      >       continue;

      >     }

      >     nop();

      >   }

      > };

      > // --- end sample code ---

      >

      > Thanks in advancet,

      >

      > Lindsay

      >

      >

      >

      >

      >

      > [Non-text portions of this message have been removed]

      >

























      [Non-text portions of this message have been removed]
    • Show all 24 messages in this topic