Skip to content

Add wrappers for node_api_nogc_env and node_api_nogc_finalize #1508

@KevinEady

Description

@KevinEady

Since nodejs/node#50060 is now in core, we need to add support for these types.

Looking at the Node-API docs, we can find which node-addon-api methods on Napi::Env should be split between normal and nogc variants. The normal variant can use nogc methods, but not the other way around:

  • nogc:
    • AddCleanupHook
    • GetInstanceData
    • SetInstanceData
    • GetModuleFileName
  • normal:
    • Global
    • Undefined
    • Null
    • IsExceptionPending
    • GetAndClearPendingException
    • RunScript

Additionally, all JavaScript-using paradigms (creating new Values, calling functions, ...) should use the normal variant, and have a compile-time error if a nogc variant is supplied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions