Closed creotutar closed 5 years ago
Added grouping of the operands for binary options to stop grouping with nullsafe-checks. E.g. Given
{let $foo: 'test' /} {let $bar: [:] /} {let $baz: $foo or $bar?['nonexistantkey'] /}
soy2js translates the soy for baz into the following
baz
var baz = (opt_data.foo || (opt_data.bar == null) ? null : opt_data.bar['nonexistantkey']);
which would evaluate to null when you would expect it to be test. Fixed so that it translates to
null
test
var baz = ((opt_data.foo) || ((opt_data.bar == null) ? null : opt_data.bar['nonexistantkey']));
Thanks very much for diagnosing and fixing with tests!
Added grouping of the operands for binary options to stop grouping with nullsafe-checks. E.g. Given
soy2js translates the soy for
baz
into the followingwhich would evaluate to
null
when you would expect it to betest
. Fixed so that it translates to