Skip to content

Implement napi_is_buffer #68

Description

@kraenhansen
No description provided.

Activity

  1. self-assigned this
    on May 14, 2025
  2. mani3xis commented on May 16, 2025

    @mani3xis
    Contributor

    FYI: I will copy the implementation that I've used for my node-sodium demo.

  3. kraenhansen commented on Aug 12, 2026

    @kraenhansen
    CollaboratorAuthor

    Implemented in packages/host/cpp/RuntimeNodeApi.cpp, covered by packages/node-addon-examples/tests/buffers (a port of Node's test_buffer).

    One fidelity note for whoever picks up #171: the host's napi_is_buffer answers true for any ArrayBuffer or TypedArray, which is looser than Node — and looser than Hermes' own implementation (API/napi/hermes_napi_buffer.cpp, adopted in #372), which only accepts a Uint8Array. The host's definition currently shadows Hermes' in the generated injector, so tightening this is a matter of dropping the shim.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions