MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / init

Function init

src/Fetch.js:295–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293#endif
294
295 async init() {
296 Fetch.xhrs = new HandleAllocator();
297#if FETCH_SUPPORT_INDEXEDDB
298#if PTHREADS
299 if (ENVIRONMENT_IS_PTHREAD) return;
300#endif
301
302 addRunDependency('library_fetch_init');
303 try {
304 var db = await Fetch.openDatabase('emscripten_filesystem', 1);
305#if FETCH_DEBUG
306 dbg('fetch: IndexedDB successfully opened.');
307#endif
308 Fetch.dbInstance = db;
309 } catch (e) {
310#if FETCH_DEBUG
311 dbg('fetch: IndexedDB open failed.');
312#endif
313 Fetch.dbInstance = false;
314 } finally {
315 removeRunDependency('library_fetch_init');
316 }
317#endif // ~FETCH_SUPPORT_INDEXEDDB
318 }
319}
320
321#if FETCH_SUPPORT_INDEXEDDB

Callers 2

startWasmWorkerFunction · 0.70
modularize.jsFile · 0.70

Calls 3

addRunDependencyFunction · 0.85
removeRunDependencyFunction · 0.85
dbgFunction · 0.50

Tested by

no test coverage detected