| 3323 | |
| 3324 | void JavaScriptRuntime::unloadModulesAndDependentModules(const std::vector<ResourceId>& resourceIds, |
| 3325 | bool isHotReloading) { |
| 3326 | constexpr auto reason = JsThreadDispatchReason::UnloadModulesAndDependents; |
| 3327 | dispatchOnJsThreadAsync(reason, [=](JavaScriptEntryParameters& entry) { |
| 3328 | for (const auto& jsWorker : getAllWorkers()) { |
| 3329 | jsWorker->unloadModulesAndDependentModules(resourceIds, isHotReloading); |
| 3330 | } |
| 3331 | |
| 3332 | doUnloadModulesAndDependentModules(resourceIds, isHotReloading, entry); |
| 3333 | if (isHotReloading) { |
| 3334 | reevalUnloadedModulesIfNeeded(); |
| 3335 | } |
| 3336 | }); |
| 3337 | } |
| 3338 | |
| 3339 | bool JavaScriptRuntime::isJsModuleLoaded(const ResourceId& resourceId) { |
| 3340 | bool loaded = false; |
| 3341 | |
| 3342 | dispatchSynchronouslyOnJsThread(JsThreadDispatchReason::IsJsModuleLoaded, [&](JavaScriptEntryParameters& entry) { |
| 3343 | auto pathResult = entry.jsContext.newStringUTF8(resourceId.toAbsolutePath(), entry.exceptionTracker); |
| 3344 | if (!entry.exceptionTracker) { |
| 3345 | onRecoverableError("isJsModuleLoaded", entry.exceptionTracker); |
| 3346 | return; |
| 3347 | } |
| 3348 | |
| 3349 | JSFunctionCallContext params(entry.jsContext, &pathResult, 1, entry.exceptionTracker); |
nothing calls this directly
no test coverage detected