W3C home > Mailing lists > Public > www-voice@w3.org > October to December 2015

Re: [SCXML] Incorrect and invalid ecmascript condition in IR test 459

From: David Junger <tffy@free.fr>
Date: Mon, 28 Dec 2015 21:06:20 +0100
Message-Id: <5CC40C5F-BAA0-4A44-9A4A-BF5C6CD92F50@free.fr>
To: www-voice@w3.org
Le 28 déc. 2015 à 17:18, Ate Douma <ate@douma.nu> a écrit :
> 
> I've just noticed an error in Implementation Report test 459 (ecmascript).
> 
> This test contains the incorrect (and invalid!) ecmascript condition:
> 
>  "Var4==0 | Var3 != 2".

It’s not technically invalid, and it’s not functionally broken either, although probably by accident.

‘|’ is a bitwise OR, has lower priority than comparison operators, and, when its operands are booleans (which they are here), it coerces them to 0 or 1 and so the result is 0 or 1, which is coerced back to the expected boolean.

			David
Received on Monday, 28 December 2015 20:06:48 UTC

This archive was generated by hypermail 2.3.1 : Monday, 28 December 2015 20:06:50 UTC