Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix !"string".
  • Loading branch information
jnthn committed Jan 28, 2013
1 parent 8b22061 commit 056979a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions nqp-jvm-cc.nqp
Expand Up @@ -162,9 +162,8 @@ $ops.add_hll_op('nqp', 'falsey', -> $qastcomp, $op {
$TYPE_OPS, 'istrue', 'Long', $TYPE_SMO, $TYPE_TC ));
}
elsif $res.type == $RT_STR {
$il.append(JAST::Instruction.new( :op('aload_1') ));
$il.append(JAST::Instruction.new( :op('invokestatic'),
$TYPE_OPS, 'isfalse_s', 'Long', $TYPE_STR, $TYPE_TC ));
$TYPE_OPS, 'isfalse_s', 'Long', $TYPE_STR ));
}
else {
my $false := JAST::Label.new( :name($op.unique('not_false')) );
Expand Down
3 changes: 3 additions & 0 deletions src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -1293,6 +1293,9 @@ public static long isfalse(SixModelObject obj, ThreadContext tc) {
public static long istrue_s(String str) {
return str.equals("") || str.equals("0") ? 0 : 1;
}
public static long isfalse_s(String str) {
return str.equals("") || str.equals("0") ? 1 : 0;
}

/* Smart coercions. */
public static String smart_stringify(SixModelObject obj, ThreadContext tc) {
Expand Down

0 comments on commit 056979a

Please sign in to comment.