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

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