MCPcopy Index your code
hub / github.com/sql-js/sql.js / useRequest

Function useRequest

js/sql-debug.js:403650–403667  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

403648 if (Module['memoryInitializerRequest']) {
403649 // a network request has already been created, just use that
403650 function useRequest() {
403651 var request = Module['memoryInitializerRequest'];
403652 var response = request.response;
403653 if (request.status !== 200 && request.status !== 0) {
403654 var data = tryParseAsDataURI(Module['memoryInitializerRequestURL']);
403655 if (data) {
403656 response = data.buffer;
403657 } else {
403658 // If you see this warning, the issue may be that you are using locateFile or memoryInitializerPrefixURL, and defining them in JS. That
403659 // means that the HTML file doesn't know about them, and when it tries to create the mem init request early, does it to the wrong place.
403660 // Look in your browser's devtools network console to see what's going on.
403661 console.warn('a problem seems to have happened with Module.memoryInitializerRequest, status: ' + request.status + ', retrying ' + memoryInitializer);
403662 doBrowserLoad();
403663 return;
403664 }
403665 }
403666 applyMemoryInitializer(response);
403667 }
403668 if (Module['memoryInitializerRequest'].response) {
403669 setTimeout(useRequest, 0); // it's already here; but, apply it asynchronously
403670 } else {

Callers

nothing calls this directly

Calls 3

applyMemoryInitializerFunction · 0.85
tryParseAsDataURIFunction · 0.70
doBrowserLoadFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…