Skip to content

src: expose MaybeInitializeContext to allow existing contexts

Splits the node.js specific tweak intialization of NewContext into a new helper MaybeInitializeContext so that embedders with existing contexts can still use them in a node Environment now that primordials are initialized and required so early.

Found this issue while upgrading Electron to node 12.4, now primordials are created in every context --> https://github.com/electron/node/commit/3da36d0e94987dc6594fdffc3678d3f970cdac75 we need to initialize a context the same way node does but we don't create the context so this method had to be split into two to allow folks with pre-created contexts to still use them in node Environments

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

Merge request reports

Loading