def js_compile(client):
    """
    Compile all instructions in the client into a valid javascript source.
    """
    lines = []
    for action in client._actions:
        source = action._js_source_()
        if source:
            lines.append(source)
    js_source = '\n'.join(lines)
    return js_source
