Skip to content

n-api: cache Symbol.hasInstance

This improves the performance of napi_instanceof() by retrieving Symbol.hasInstance from the global object once and then storing a persistent reference to it in the env.

Re https://github.com/nodejs/abi-stable-node/issues/209 Re https://github.com/nodejs/abi-stable-node/pull/214

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

N-API

Merge request reports

Loading