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

Re: Strict white space inconsistency

Expand Messages
  • Douglas Crockford
    ... Got it, thanks. Having a conversation about whitespace is really difficult when the conversation is conducted in HTML.
    Message 1 of 4 , Sep 21, 2009
    • 0 Attachment
      --- In jslint_com@yahoogroups.com, "Chris" <Nielsen.Chris@...> wrote:
      >
      > --- In jslint_com@yahoogroups.com, "Douglas Crockford" <douglas@> wrote:
      > >
      > > When I lint this code with strict white space checking:
      > >
      > > var c, chars, n, r, s;
      > > r +=
      > > chars[n[0]] +
      > > chars[n[1]] +
      > > chars[n[2]] +
      > > chars[n[3]];
      > > n =
      > > (s.charCodeAt(c) << 16) +
      > > (s.charCodeAt(c + 1) << 8) +
      > > s.charCodeAt(c + 2);
      > >
      > > I see no warnings.
      > >
      >
      > The warning message can be generated when ONLY "Strict white space" is checked. Unchecking "Strict white space" will prevent the warning message. Other options do not appear to have an effect.
      >
      > The warning message is not generated if spaces are used as indentation.
      >
      > The warning message is not generated if `chars[n[0]] +` is indented to the same level as `r +=`
      >
      > The warning message is not generated if `chars[n[0]] +` is indented two tabs beyond the level of `r +=`
      >
      > The warning message is generated in your example code if the following sequence is present:
      >
      > var c, chars, n, r, s;[line break]
      > [line break]
      > r +=[line break]
      > [tab]chars[n[0]] +[line break]
      > [tab]chars[n[1]] +[line break]
      > [tab]chars[n[2]] +[line break]
      > [tab]chars[n[3]];[line break]
      > [line break]
      > n =[line break]
      > [tab](s.charCodeAt(c) << 16) +[line break]
      > [tab](s.charCodeAt(c + 1) << 8) +[line break]
      > [tab]s.charCodeAt(c + 2);[line break]

      Got it, thanks. Having a conversation about whitespace is really difficult when the conversation is conducted in HTML.
    Your message has been successfully submitted and would be delivered to recipients shortly.