MCPcopy Index your code
hub / github.com/CodeGraphContext/CodeGraphContext / Module2

Function Module2

website/public/wasm/web-tree-sitter.js:1520–3133  ·  view source on GitHub ↗
(moduleArg = {})

Source from the content-addressed store, hash-verified

1518
1519// lib/web-tree-sitter.mjs
1520async function Module2(moduleArg = {}) {
1521 var moduleRtn;
1522 var Module = moduleArg;
1523 var ENVIRONMENT_IS_WEB = typeof window == "object";
1524 var ENVIRONMENT_IS_WORKER = typeof WorkerGlobalScope != "undefined";
1525 var ENVIRONMENT_IS_NODE = typeof process == "object" && process.versions?.node && process.type != "renderer";
1526 if (ENVIRONMENT_IS_NODE) {
1527 const { createRequire } = await import("module");
1528 var require = createRequire(import.meta.url);
1529 }
1530 Module.currentQueryProgressCallback = null;
1531 Module.currentProgressCallback = null;
1532 Module.currentLogCallback = null;
1533 Module.currentParseCallback = null;
1534 var arguments_ = [];
1535 var thisProgram = "./this.program";
1536 var quit_ = /* @__PURE__ */ __name((status, toThrow) => {
1537 throw toThrow;
1538 }, "quit_");
1539 var _scriptName = import.meta.url;
1540 var scriptDirectory = "";
1541 function locateFile(path) {
1542 if (Module["locateFile"]) {
1543 return Module["locateFile"](path, scriptDirectory);
1544 }
1545 return scriptDirectory + path;
1546 }
1547 __name(locateFile, "locateFile");
1548 var readAsync, readBinary;
1549 if (ENVIRONMENT_IS_NODE) {
1550 var fs = require("fs");
1551 if (_scriptName.startsWith("file:")) {
1552 scriptDirectory = require("path").dirname(require("url").fileURLToPath(_scriptName)) + "/";
1553 }
1554 readBinary = /* @__PURE__ */ __name((filename) => {
1555 filename = isFileURI(filename) ? new URL(filename) : filename;
1556 var ret = fs.readFileSync(filename);
1557 return ret;
1558 }, "readBinary");
1559 readAsync = /* @__PURE__ */ __name(async (filename, binary2 = true) => {
1560 filename = isFileURI(filename) ? new URL(filename) : filename;
1561 var ret = fs.readFileSync(filename, binary2 ? void 0 : "utf8");
1562 return ret;
1563 }, "readAsync");
1564 if (process.argv.length > 1) {
1565 thisProgram = process.argv[1].replace(/\\/g, "/");
1566 }
1567 arguments_ = process.argv.slice(2);
1568 quit_ = /* @__PURE__ */ __name((status, toThrow) => {
1569 process.exitCode = status;
1570 throw toThrow;
1571 }, "quit_");
1572 } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
1573 try {
1574 scriptDirectory = new URL(".", _scriptName).href;
1575 } catch {
1576 }
1577 {

Callers

nothing calls this directly

Calls 15

__nameFunction · 0.85
resolveFunction · 0.85
failIfFunction · 0.85
getLEBFunction · 0.85
getStringFunction · 0.85
getU8Function · 0.85
getStringListFunction · 0.85
func2Function · 0.85
convertFunction · 0.85
loadDynamicLibraryFunction · 0.85
abortFunction · 0.85
updateMemoryViewsFunction · 0.85

Tested by

no test coverage detected