class Opal::Nodes::XStringNode
def compile_javascript
def compile_javascript @should_add_semicolon = false unpacked_children = unpack_return(children) stripped_children = XStringNode.strip_empty_children(unpacked_children) if XStringNode.single_line?(stripped_children) # If it's a single line we'll try to: # # - strip empty lines # - remove a trailing `;` # - detect an embedded `return` # - prepend a `return` when needed # - append a `;` when needed # - warn the user not to use the semicolon in single-line x-strings compile_single_line(stripped_children) else # Here we leave to the user the responsibility to add # a return where it's due. unpacked_children.each { |c| compile_child(c) } end wrap '(', ')' if recv? push ';' if @should_add_semicolon end