code: def read_js_object(js_script):
      """
      Reads the JavaScript file and return a dictionary of variables definded in the script.
  
      Args:
          js_script (string) - path to JavaScript File
  
      Returns:
          Dictionary of variables defines in script
      """
  
      def visit(node):
          if isinstance(node, asttypes.Program):
              d = {}
              for child in node:
                  if not isinstance(child, asttypes.VarStatement):
                      raise ValueError(
                          "All statements should be var statements"
                      )
                  key, val = visit(child)
                  d[key] = val
              return d
          elif isinstance(node, asttypes.VarStatement):
              return visit(node.children()[0])
          elif isinstance(node, asttypes.VarDecl):
              return (visit(node.identifier), visit(node.initializer))
          elif isinstance(node, asttypes.Object):
              d = {}
              for property in node:
                  key = visit(property.left)
                  value = visit(property.right)
                  d[key] = value
              return d
          elif isinstance(node, asttypes.BinOp):
              # simple constant folding
              if node.op == "+":
                  if isinstance(
                      node.left, asttypes.String
                  ) and isinstance(node.right, asttypes.String):
                      return visit(node.left) + visit(node.right)
                  elif isinstance(
                      node.left, asttypes.Number
                  ) and isinstance(node.right, asttypes.Number):
                      return visit(node.left) + visit(node.right)
                  else:
                      raise ValueError(
                          "Cannot + on anything other than two literals"
                      )
              else:
                  raise ValueError("Cannot do operator '%s'" % node.op)
  
          elif isinstance(node, asttypes.String) or isinstance(
              node, asttypes.Number
          ):
              return literal_eval(node.value)
          elif isinstance(node, asttypes.Array):
              return [visit(x) for x in node]
          elif isinstance(node, asttypes.Null):
              return None
          elif isinstance(node, asttypes.Boolean):
              if str(node) == "false":
                  return False
              else:
                  return True
          elif isinstance(node, asttypes.Identifier):
              return node.value
          else:
              raise Exception("Unhandled node: %r" % node)
  
      return visit(es5(js_script))
  
file_path: hls4ml/hls4ml/report/quartus_report.py
imports: import os
  import webbrowser
  from ast import literal_eval
  from calmjs.parse import asttypes, es5
  from tabulate import tabulate
label_desc: Use image node_id 4 for calling a global function with example usage: read_js_object(js_script) and returns: visit, d, visit, visit,  visit, d, literal_eval, unknown, unknown, unknown, None, False, True, node