Skip to content

Commit

Permalink
Generator if in Javascript.
Browse files Browse the repository at this point in the history
  • Loading branch information
macournoyer committed Mar 28, 2012
1 parent 86edcc8 commit 8e5b949
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def get_local(name)
end

def if(condition, body)

emit "if ("
condition.compile(self)
emit ") {\n"
body.compile(self)
emit "}"
end

def assemble
Expand Down

0 comments on commit 8e5b949

Please sign in to comment.