Skip to content

Support custom import namespace for functions implemented in JavaScript #20035

@toyobayashi

Description

@toyobayashi

Can I specify a custom import namespace for JavaScript function?

mergeInto(LibraryManager.library, {
  napi_create_int32: function (env, value, result) {
    // ...
  },
  napi_create_int32__sig: 'ipip',
  napi_create_int32__namespace: 'napi' // <-- instead of 'env'
})

compile result

WebAssembly.instantiate(/* ... */, {
  napi: { napi_create_int32 }
})

Refs: nodejs/node#49037

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