Skip to content

Introduce 'ecma_is_value_nullish' #5170

Open
@LaszloLango

Description

@LaszloLango

ecma_is_value_null and ecma_is_value_undefined is used together in multiple places in the source code. It would nice to have a new ecma_is_value_nullish function to make the code simpler and more readable. e.g:

extern inline bool JERRY_ATTR_CONST JERRY_ATTR_ALWAYS_INLINE
ecma_is_value_nullish (ecma_value_t value) /**< ecma value */
{
  return ecma_is_value_equal_to_simple_value (value, ECMA_VALUE_NULL) || ecma_is_value_equal_to_simple_value (value, ECMA_VALUE_UNDEFINED);
} /* ecma_is_value_null */

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions