mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
Correct dynamic module loading/caching
Refactors some of the module loading logic. Both normal modules import and dynamic module import now share more of the same code - they both go through the slightly modified `module` function. Dynamic modules now check the cache first, before loading, and when cached, resolve the correct promise. This can now happen regardless of the module loading state. Also tried to replace some page arenas with call arenas and added some basic tests for both normal and dynamic module loading.
This commit is contained in:
@@ -93,7 +93,7 @@
|
||||
}
|
||||
|
||||
async function async(promise, cb) {
|
||||
const script_id = document.currentScript.id;
|
||||
const script_id = document.currentScript ? document.currentScript.id : '<script id is unavailable in browsers>';
|
||||
const stack = new Error().stack;
|
||||
const value = await promise;
|
||||
this._captured = {script_id: script_id, stack: stack};
|
||||
|
||||
Reference in New Issue
Block a user