[Seaside-dev] Javascript Condition with else decoration

Esteban A. Maringolo emaringolo at gmail.com
Wed Oct 1 17:16:31 UTC 2014


2014-10-01 14:08 GMT-03:00 Philippe Marschall <philippe.marschall at gmail.com>:
>> ps: An alternative solution would be to modify the JSIfThenElse, but this
>> would require adding returns to the trueStatement and falseStatement of this
>> class.
>
> Because an if is not an expression in JavaScript?

Ternary operator (? :), modeled with JSIfThenElse. can't have blocks
as parameters.

It is, you can have
(a > 3) ? 'Bigger' : 'Smaller';

but not:
(a > 3) ? {return 'Bigger' } : {return 'Smaller'}


> Everything is a bit confusion at first but to me right now you change
> looks like the simplest way to achieve what you want without
> refactoring the whole hierarchies.

Indeed. That's what I wanted. To be as non-invasive as possible.
The decoration gets a little awkward, but it does the job.

Regards,

Esteban A. Maringolo


More information about the seaside-dev mailing list