We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2397473 commit 3909a48Copy full SHA for 3909a48
src/vm/js/Compiler.nqp
@@ -598,8 +598,10 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
598
}
599
600
if $desired == $T_BOOL {
601
- if $got == $T_INT || $got == $T_NUM {
+ if $got == $T_INT {
602
return Chunk.new($T_BOOL, $chunk.expr, $chunk);
603
+ } elsif $got == $T_NUM {
604
+ return Chunk.new($T_BOOL, "({$chunk.expr} !== 0)", $chunk);
605
} elsif $got == $T_STR {
606
return Chunk.new($T_BOOL, "({$chunk.expr} && {$chunk.expr} !== nqp.null_s)", $chunk);
607
0 commit comments