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

Code before:
                                                  "to the non-extensible target"));
    }

    if (setting_config_false)
    {
      return ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
                                                  "which is non-existent in the target"));
    }
  }
  /* 20. */
  else
  {
    ecma_value_t ret_value = ECMA_VALUE_EMPTY;

    if (!ecma_op_is_compatible_property_descriptor (prop_desc_p, &target_desc, is_target_ext))
    {
      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for adding property that is "
                                                       "incompatible with the existing property in the target"));
    }
    else if (setting_config_false && (target_desc.flags & ECMA_PROP_IS_CONFIGURABLE))
    {
      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
                                                       "which is configurable in the target"));
    }
    /* ES11: 9.5.6.16.c*/
    else if ((target_desc.flags & ECMA_PROP_IS_VALUE_DEFINED)
             && !(target_desc.flags & ECMA_PROP_IS_CONFIGURABLE)
             && (target_desc.flags & ECMA_PROP_IS_WRITABLE)
             &&  (prop_desc_p->flags & ECMA_PROP_IS_WRITABLE_DEFINED)
             &&  !(prop_desc_p->flags & ECMA_PROP_IS_WRITABLE))
    {
      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
                                                       "which is configurable in the target"));
    }

    ecma_free_property_descriptor (&target_desc);

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

  return ECMA_VALUE_TRUE;
} /* ecma_proxy_object_define_own_property */

/**
 * The Proxy object [[HasProperty]] internal routine
 *
 * See also:
 *          ECMAScript v6, 9.5.7

Review comment (suggestion):
`If IsDataDescriptor(targetDesc) ` this means `target_desc.flags & (ECMA_PROP_IS_VALUE_DEFINED | ECMA_PROP_IS_WRITABLE_DEFINED) != 0`

Code after:
    {
      return ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for adding property "
                                                  "to the non-extensible target"));
    }

    if (setting_config_false)
    {
      return ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
                                                  "which is non-existent in the target"));
    }
  }
  /* 20. */
  else
  {
    ecma_value_t ret_value = ECMA_VALUE_EMPTY;

    if (!ecma_op_is_compatible_property_descriptor (prop_desc_p, &target_desc, is_target_ext))
    {
      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for adding property that is "
                                                       "incompatible with the existing property in the target"));
    }
    else if (setting_config_false && (target_desc.flags & ECMA_PROP_IS_CONFIGURABLE))
    {
      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
                                                       "which is configurable in the target"));
    }
    /* ES11: 16.c */
    else if ((target_desc.flags & (ECMA_PROP_IS_VALUE_DEFINED | ECMA_PROP_IS_WRITABLE_DEFINED)) != 0
             && (prop_desc_p->flags & (ECMA_PROP_IS_WRITABLE_DEFINED | ECMA_PROP_IS_WRITABLE))
                 == ECMA_PROP_IS_WRITABLE_DEFINED
             && (target_desc.flags & (ECMA_PROP_IS_WRITABLE | ECMA_PROP_IS_CONFIGURABLE)) == ECMA_PROP_IS_WRITABLE)

    {
      ret_value = ecma_raise_type_error (ECMA_ERR_MSG ("Trap returned truish for defining non-configurable property "
                                                       "which is configurable in the target"));
    }

    ecma_free_property_descriptor (&target_desc);

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

  return ECMA_VALUE_TRUE;
} /* ecma_proxy_object_define_own_property */

/**
 * The Proxy object [[HasProperty]] internal routine
 *