mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-10 17:53:55 +01:00
commit
a0361c9a42
@ -30,6 +30,7 @@ export async function compile(player: IPlayer, script: Script, scripts: Script[]
|
||||
const uurls = _getScriptUrls(script, scripts, []);
|
||||
const url = uurls[uurls.length - 1].url;
|
||||
if (script.url && script.url !== url) {
|
||||
URL.revokeObjectURL(script.url);
|
||||
// Thoughts: Should we be revoking any URLs here?
|
||||
// If a script is modified repeatedly between two states,
|
||||
// we could reuse the blob at a later time.
|
||||
@ -42,8 +43,9 @@ export async function compile(player: IPlayer, script: Script, scripts: Script[]
|
||||
// });
|
||||
// }
|
||||
}
|
||||
script.url = url;
|
||||
script.module = new Promise((resolve) => resolve(eval("import(url)")));
|
||||
if (script.dependencies.length > 0) script.dependencies.forEach((dep) => URL.revokeObjectURL(dep.url));
|
||||
script.url = uurls[uurls.length - 1].url;
|
||||
script.module = new Promise((resolve) => resolve(eval("import(uurls[uurls.length - 1].url)")));
|
||||
script.dependencies = uurls;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user