def translate_js(js, HEADER=DEFAULT_HEADER, use_compilation_plan=False):
 if (use_compilation_plan and (not ('//' in js)) and (not ('/*' in js))):
  return translate_js_with_compilation_plan(js, HEADER=HEADER)
 parser = pyjsparser.PyJsParser()
 parsed = parser.parse(js)
 translating_nodes.clean_stacks()
 return (HEADER + translating_nodes.trans(parsed))

def translate_js ( js , HEADER = DEFAULT_HEADER , use_compilation_plan = False ) : if ( use_compilation_plan and ( not ( '//' in js ) ) and ( not ( '/*' in js ) ) ) : return translate_js_with_compilation_plan ( js , HEADER = HEADER ) parser = pyjsparser . PyJsParser ( ) parsed = parser . parse ( js ) translating_nodes . clean_stacks ( ) return ( HEADER + translating_nodes . trans ( parsed ) )
js has to be a javascript source code .