Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[js] add coercion from $T_BOOL to $T_INT.
  • Loading branch information
pmurias committed Oct 24, 2015
1 parent 4fd2e45 commit f3aed7a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vm/js/QAST/Compiler.nqp
Expand Up @@ -2321,6 +2321,9 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
if $got == $T_NUM {
return Chunk.new($T_INT, "({$chunk.expr}|0)", [$chunk]);
}
if $got == $T_BOOL {
return Chunk.new($T_INT, "({$chunk.expr} ? '1' : '0')", [$chunk]);
}
}

if $got == $T_OBJ {
Expand Down

0 comments on commit f3aed7a

Please sign in to comment.