Repository: jerryscript-project/jerryscript
File: jerry-core/ecma/operations/ecma-typedarray-object.c (C)

Code before:
  {
    return ECMA_VALUE_FALSE;
  }

  if (property_desc_p->flags & ECMA_PROP_IS_VALUE_DEFINED)
  {
    ecma_typedarray_info_t info = ecma_typedarray_get_info (obj_p);

    if (index >= info.length)
    {
      return ECMA_VALUE_FALSE;
    }

    lit_utf8_byte_t *src_buffer = info.buffer_p + (index << info.shift);
    ecma_value_t set_element = ecma_set_typedarray_element (src_buffer, property_desc_p->value, info.id);

    if (ECMA_IS_VALUE_ERROR (set_element))
    {
      return set_element;
    }
  }

  return ECMA_VALUE_TRUE;
} /* ecma_op_typedarray_define_index_prop */

/* Specify the creation of a new TypedArray
 * object using a constructor function.
 *
 * See also: ES11 22.2.4.6
 *
 * Used by:
 *        - ecma_typedarray_species_create
 *
 * @return ecma_value_t
 *
 */
ecma_value_t ecma_typedarray_create (ecma_object_t *constructor_p, /**< constructor function */
                                     ecma_value_t *arguments_list_p, /**< argument list */
                                     uint32_t arguments_list_len) /**< length of argument list */
{
  ecma_number_t num;
  if (ECMA_IS_VALUE_ERROR (ecma_op_to_number (arguments_list_p[0], &num)))
  {
    return ECMA_VALUE_ERROR;
  }
  uint32_t length = ecma_number_to_uint32 (num);

  // 1. Let newTypedArray be ? Construct(constructor, argumentList).
  ecma_value_t ret_val = ecma_op_function_construct (constructor_p,
                                                     constructor_p,
                                                     arguments_list_p,

Review comment (suggestion):
Doxygen comments should stars with

```
/**
 * Specify the creation of a new TypedArray...
 */`

Code after:
      || ((property_desc_p->flags & ECMA_PROP_IS_WRITABLE_DEFINED)
          && !(property_desc_p->flags & ECMA_PROP_IS_WRITABLE)))
  {
    return ECMA_VALUE_FALSE;
  }

  if (property_desc_p->flags & ECMA_PROP_IS_VALUE_DEFINED)
  {
    ecma_typedarray_info_t info = ecma_typedarray_get_info (obj_p);

    if (index >= info.length)
    {
      return ECMA_VALUE_FALSE;
    }

    lit_utf8_byte_t *src_buffer = info.buffer_p + (index << info.shift);
    ecma_value_t set_element = ecma_set_typedarray_element (src_buffer, property_desc_p->value, info.id);

    if (ECMA_IS_VALUE_ERROR (set_element))
    {
      return set_element;
    }
  }

  return ECMA_VALUE_TRUE;
} /* ecma_op_typedarray_define_index_prop */

/**
 * Specify the creation of a new TypedArray
 * object using a constructor function.
 *
 * See also: ES11 22.2.4.6
 *
 * Used by:
 *        - ecma_typedarray_species_create
 *
 * @return ecma_value_t function object from created from constructor_p argument
 */

ecma_value_t
ecma_typedarray_create (ecma_object_t *constructor_p, /**< constructor function */
                        ecma_value_t *arguments_list_p, /**< argument list */
                        uint32_t arguments_list_len) /**< length of argument list */
{
  ecma_value_t ret_val = ecma_op_function_construct (constructor_p,
                                                     constructor_p,
                                                     arguments_list_p,
                                                     arguments_list_len);
  if (ECMA_IS_VALUE_ERROR (ret_val))
  {
    return ret_val;