Skip to content

Commit

Permalink
Use js_truthy helper instead of parser version
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 22, 2013
1 parent 8f17aae commit c398329
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/opal/nodes/case.rb
Expand Up @@ -68,7 +68,7 @@ def compile
call = s(:call, check, :===, s(:arglist, s(:js_tmp, '$case')))
push expr(call)
else
push @parser.js_truthy(check)
push js_truthy(check)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/opal/nodes/definitions.rb
Expand Up @@ -188,7 +188,7 @@ class WhileNode < Node

def compile
with_temp do |redo_var|
test_code = @parser.js_truthy(test)
test_code = js_truthy(test)

@parser.in_while do
while_loop[:closure] = true if wrap_in_closure?
Expand Down
2 changes: 1 addition & 1 deletion lib/opal/nodes/logic.rb
Expand Up @@ -112,7 +112,7 @@ def compile
truthy_opt = nil

with_temp do |tmp|
if truthy_opt = @parser.js_truthy_optimize(lhs)
if truthy_opt = js_truthy_optimize(lhs)
push "((#{tmp} = ", truthy_opt
push ") ? "
push expr(rhs)
Expand Down

0 comments on commit c398329

Please sign in to comment.