()
| 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 |
no test coverage detected