MCPcopy Index your code
hub / github.com/EmulatorJS/EmulatorJS / loadScript

Function loadScript

data/loader.js:17–35  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

15 if (!scriptPath.endsWith("/")) scriptPath += "/";
16 //console.log(scriptPath);
17 function loadScript(file) {
18 return new Promise(function(resolve) {
19 let script = document.createElement("script");
20 script.src = function() {
21 if ("undefined" != typeof EJS_paths && typeof EJS_paths[file] === "string") {
22 return EJS_paths[file];
23 } else if (file.endsWith("emulator.min.js")) {
24 return scriptPath + file;
25 } else {
26 return scriptPath + "src/" + file;
27 }
28 }();
29 script.onload = resolve;
30 script.onerror = () => {
31 filesmissing(file).then(e => resolve());
32 }
33 document.head.appendChild(script);
34 })
35 }
36
37 function loadStyle(file) {
38 return new Promise(function(resolve) {

Callers 2

filesmissingFunction · 0.85
loader.jsFile · 0.85

Calls 2

filesmissingFunction · 0.85
createElementMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…