| 3323 | onRecoverableError("getModule", jsEntry.exceptionTracker); |
| 3324 | return; |
| 3325 | } |
| 3326 | |
| 3327 | importResult->addUnloadObserver(observer); |
| 3328 | }); |
| 3329 | } |
| 3330 | |
| 3331 | void JavaScriptRuntime::preloadModule(const StringBox& path, int32_t maxDepth) { |
| 3332 | dispatchOnJsThreadAsync(nullptr, [=](JavaScriptEntryParameters& jsEntry) { |
| 3333 | VALDI_TRACE_META("Valdi.preloadModule", path); |
| 3334 | |
| 3335 | std::initializer_list<JSValueRef> params = { |
| 3336 | jsEntry.jsContext.newStringUTF8(path.toStringView(), jsEntry.exceptionTracker), |
| 3337 | jsEntry.jsContext.newNumber(maxDepth)}; |
| 3338 | |
| 3339 | if (!jsEntry.exceptionTracker) { |
| 3340 | return; |
| 3341 | } |
| 3342 | |
| 3343 | JSFunctionCallContext callContext(jsEntry.jsContext, params.begin(), params.size(), jsEntry.exceptionTracker); |
| 3344 | |
| 3345 | jsEntry.jsContext.callObjectProperty( |
| 3346 | _moduleLoader.get(), _propertyNameIndex.getJsName(kPreloadModulePropertyName), callContext); |
| 3347 | }); |
| 3348 | } |
| 3349 |
nothing calls this directly
no test coverage detected