Skip to content

Make IsObject() allow functions?聽#207

Closed

Description

@addaleax

Hi everyone!

I鈥檝e just received my first PR from somebody else on a N-API project 馃帀 node-ffi-napi/weak-napi#3

I鈥檓 wondering whether it makes sense to change IsObject() in the wrapper so that napi_function is also allowed, because functions are objects in the JS sense and any N-API operation that expects an object should also work on a function. What do you think?

Activity

  1. jasongin commented on Jan 2, 2018

    @jasongin
    Member

    I agree, it seems like a bug. IsObject() should be true for functions.

  2. mhdawson commented on Jan 3, 2018

    @mhdawson
    Member

    I agree as well. IsObject() should return true for a function.

  3. guymguym commented on Jan 3, 2018

    @guymguym

    Hey, sounds good to me.
    btw you might consider having the original IsObject meaning as IsObjectLike the same as done by lodash:
    https://lodash.com/docs/4.17.4#isObject
    https://lodash.com/docs/4.17.4#isObjectLike

  4. added a commit that references this issue on Jan 22, 2018
  5. added a commit that references this issue on Jan 28, 2018
  6. addaleax commented on May 15, 2018

    @addaleax
    MemberAuthor

    This has been fixed a while ago, the PR author just didn鈥檛 add a Fixes: tag. Closing! :)

  7. added a commit that references this issue on Aug 24, 2022
  8. added a commit that references this issue on Aug 26, 2022
  9. added a commit that references this issue on Sep 19, 2022
  10. added a commit that references this issue on Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions