I am migrating my V8 code from using "plain scripts" to using "ES6 Modules". There are a few concepts that I am struggling with.
First, how might I retrieve a class definition defined in a module? Previously I would have used the "global" object on the "context" (i.e. context->Global()), and found the class definition there. I can't find a good example on how to do that in a module. I am experimenting with Module::GetModuleNamespace(), but I'm not sure that I'm on the right track.
Second, am I allowed to take a persistent handle to a module? I am finding that after restoring a module from a persistent handle, I encounter the failure below.
#
# Fatal error in C:\621300de\v8\src/api/api-inl.h, line 128
# Debug check failed: allow_empty_handle || that != nullptr.
#
#
#
#FailureMessage Object: 0000006114FBC2E0
==== C stack trace ===============================
v8::base::debug::StackTrace::StackTrace [0x0,000,7FF,60D,F82,80B+27]
v8::platform::DefaultPlatform::PostJob [0x0,000,7FF,60D,F7F,1E1+401]
V8_Fatal [0x0,000,7FF,60C,251,B87+167]
v8::base::PrintCheckOperand<unsigned __int64> [0x0,000,7FF,60C,251,683+627]
v8::Module::GetStatus [0x0,000,7FF,60C,1E0,3FD+141]
v8::Module::GetModuleNamespace [0x0,000,7FF,60C,1D1,243+19]