mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00

This is enough for a basic shadow realm to work :^) There is more that we still need to implement here such as module loading and fixing up the global object, but this is enough to get some basic usage working.
13 lines
351 B
HTML
13 lines
351 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const realm = new ShadowRealm()
|
|
const aSync = realm.evaluate(`async () => 1 + 1`);
|
|
try {
|
|
aSync();
|
|
println('Fail! No exception thrown');
|
|
} catch (e) {
|
|
println(`PASS: Exception thrown '${e}'`);
|
|
}
|
|
})
|
|
</script>
|