Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #36616

Re: JSLint Unexpected Warning

Path csiph.com!aioe.org!.POSTED.tunI3Zk9LrrWAyIc2N3gXA.user.gioia.aioe.org!not-for-mail
From emf <emfril@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: JSLint Unexpected Warning
Date Thu, 16 May 2019 22:31:09 -0400
Organization Aioe.org NNTP Server
Lines 63
Message-ID <qbl6cs$1lb1$1@gioia.aioe.org> (permalink)
References <3c87329c-6f62-4dc0-a26b-3fb6ed10b04e@googlegroups.com>
NNTP-Posting-Host tunI3Zk9LrrWAyIc2N3gXA.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1
X-Antivirus-Status Clean
X-Antivirus Avast (VPS 190516-6, 05/16/2019), Outbound message
X-Notice Filtered by postfilter v. 0.9.2
Content-Language en-US
Xref csiph.com comp.lang.javascript:36616

Show key headers only | View raw


On 2019-04-25 4:28, emfril@gmail.com wrote:
> JSLint says:
> 
> Unexpected '==='.
>          if (((a > b) === (bc > ca)) && ((b > c) === (ca > ab))
> 0.48
> Unexpected '==='.
> in this (and others):
> 
> if (((a > b) === (bc > ca)) && ((b > c) === (ca > ab))
>    && ((c > a) === (ab > bc)) && ((a === b) === (bc === ca))
>    && ((b === c) === (ca === ab)) && ((c === a) !== (ab === bc))) {
>      return false;
> } else {
>      return true;
> }
> 
> Why?

Thanks for all the replies. When, however, I submit to JSLint just this

function isValid() {
     if ((a > b) === (bc > ca)) {
         return false;
     } else {
         return true;
     }
}

it still says:

Unexpected '==='.
     if ((a > b) === (bc > ca)) {

It accepts, however, as correct this:

function isValid() {
     var agb = (a > b);
     var bcgca = (bc > ca);
     if (agb === bcgca) {
         return false;
     } else {
         return true;
     }
}

It seems JSLint does not like to perform (boolean) operations within the 
condition except for the main one.

I feel like JSLint is a moving target. Every time I consult it, there is 
always something new it doesn't like. So far I've been following its 
directions, but I do wish I were sure it's heading in the right direction...

Eustace

-- 
Spherical Triangle Calculator
http://emf.neocities.org/tr/spherical.html

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

JSLint Unexpected Warning emfril@gmail.com - 2019-04-25 01:28 -0700
  Re: JSLint Unexpected Warning "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-04-25 04:33 -0700
    Re: JSLint Unexpected Warning Julio Di Egidio <julio@diegidio.name> - 2019-05-16 20:13 -0700
      Re: JSLint Unexpected Warning "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-05-18 10:59 -0700
  Re: JSLint Unexpected Warning "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-04-25 17:43 +0200
    Re: JSLint Unexpected Warning Gene Wirchenko <genew@telus.net> - 2019-04-25 16:43 -0700
      Re: JSLint Unexpected Warning "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-04-26 13:30 +0200
        Re: JSLint Unexpected Warning Gene Wirchenko <genew@telus.net> - 2019-04-29 11:04 -0700
          Re: JSLint Unexpected Warning "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-04-30 00:06 +0200
            Re: JSLint Unexpected Warning Gene Wirchenko <genew@telus.net> - 2019-04-30 21:15 -0700
  Re: JSLint Unexpected Warning emf <emfril@gmail.com> - 2019-05-16 22:31 -0400
    Re: JSLint Unexpected Warning Julio Di Egidio <julio@diegidio.name> - 2019-05-16 20:08 -0700
    Re: JSLint Unexpected Warning Julio Di Egidio <julio@diegidio.name> - 2019-05-16 20:38 -0700
    Re: JSLint Unexpected Warning Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-05-17 12:17 +0000

csiph-web