fix parent not being updated when children ram cost increase.

This commit is contained in:
Olivier Gagnon 2021-10-14 14:50:57 -04:00
parent cc056ceef4
commit c556408208
3 changed files with 4 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -28,7 +28,8 @@ export async function executeJSScript(scripts: Script[] = [], workerScript: Work
// but not really behaves like import. Particularly, it cannot
// load fully dynamic content. So we hide the import from webpack
// by placing it inside an eval call.
script.markUpdated();
await script.updateRamUsage(scripts);
workerScript.ramUsage = script.ramUsage;
uurls = _getScriptUrls(script, scripts, []);
script.url = uurls[uurls.length - 1].url;
script.module = new Promise((resolve) => resolve(eval("import(uurls[uurls.length - 1].url)")));