parser_module_check_duplicate_export (parser_context_t *context_p, /**< parser context */
                                      ecma_string_t *export_name_p) /**< exported identifier */
{
  /* We have to check in the currently constructed node, as well as all of the already added nodes. */
  ecma_module_names_t *current_names_p = context_p->module_names_p;

  while (current_names_p != NULL)
  {
    if (ecma_compare_ecma_strings (current_names_p->imex_name_p, export_name_p))
    {
      return true;
    }
    current_names_p = current_names_p->next_p;
  }

  ecma_module_names_t *name_p = JERRY_CONTEXT (module_current_p)->local_exports_p;

  while (name_p != NULL)
  {
    if (ecma_compare_ecma_strings (name_p->imex_name_p, export_name_p))
    {
      return true;
    }

    name_p = name_p->next_p;
  }

  ecma_module_node_t *export_node_p = JERRY_CONTEXT (module_current_p)->indirect_exports_p;

  while (export_node_p != NULL)
  {
    name_p = export_node_p->module_names_p;

    while (name_p != NULL)
    {
      if (ecma_compare_ecma_strings (name_p->imex_name_p, export_name_p))
      {
        return true;
      }

      name_p = name_p->next_p;
    }

    export_node_p = export_node_p->next_p;
  }

  /* Star exports don't have any names associated with them, so no need to check those. */
  return false;
} /* parser_module_check_duplicate_export */
parser_module_check_duplicate_export (parser_context_t *context_p,  
                                      ecma_string_t *export_name_p)  
{
   
  ecma_module_names_t *current_names_p = context_p->module_names_p;

  while (current_names_p != NULL)
  {
    if (ecma_compare_ecma_strings (current_names_p->imex_name_p, export_name_p))
    {
      return true;
    }
    current_names_p = current_names_p->next_p;
  }

  ecma_module_names_t *name_p = JERRY_CONTEXT (module_current_p)->local_exports_p;

  while (name_p != NULL)
  {
    if (ecma_compare_ecma_strings (name_p->imex_name_p, export_name_p))
    {
      return true;
    }

    name_p = name_p->next_p;
  }

  ecma_module_node_t *export_node_p = JERRY_CONTEXT (module_current_p)->indirect_exports_p;

  while (export_node_p != NULL)
  {
    name_p = export_node_p->module_names_p;

    while (name_p != NULL)
    {
      if (ecma_compare_ecma_strings (name_p->imex_name_p, export_name_p))
      {
        return true;
      }

      name_p = name_p->next_p;
    }

    export_node_p = export_node_p->next_p;
  }

   
  return false;
}  