Skip to content

Jerry API: free callback #17

Closed
Closed
@ILyoan

Description

@ILyoan

Current version of jerry_api_set_object_free_callback() takes two parameter

  • pointer to object
  • function pointer to callback.

The prototype of callback is like this:

typedef void (*jerry_object_free_callback_t) (const uintptr_t native_p);

I think it's confusing that the callback takes native pointer as its parameter, since, at least i thought, there are no link connecting the native_p to something in this set of API.
Actually we need to set the native pointer using separate API named jerry_api_set_object_native_handle() to get it work. I think it's inconsistent. To make it consistent, I think, jerry_set_object_free_callback() should take one more parameter type of native pointer. or the callback function should take jerry_api_object_t* that is being destroyed and then we can access native pointer using jerry_api_get_object_native_handle().

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