mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-04 16:11:54 +00:00
This is needed for shadow realms which don't have a window or worker global object. Fixes a crash for the attached test.
20 lines
530 B
HTML
20 lines
530 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
asyncTest(async done => {
|
|
const shadowRealm = new ShadowRealm();
|
|
|
|
try {
|
|
const result = await new Promise(shadowRealm.evaluate(`
|
|
(resolve, reject) => {
|
|
(async () => {
|
|
throw new Error('An error!');
|
|
})().then(resolve, (e) => reject(e.toString()));
|
|
}
|
|
`));
|
|
} catch (e) {
|
|
println(e);
|
|
}
|
|
|
|
done();
|
|
});
|
|
</script>
|