-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Hook up the HostInitializeShadowRealm callback
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.
- Loading branch information
1 parent
f617824
commit a16bd7c
Showing
5 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/HTML/shadow-realm-async-evaluate.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PASS: Exception thrown 'TypeError: Wrapped value must be primitive or a function object, got [object Promise]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Shadow realm evaluation returned: 2 |
13 changes: 13 additions & 0 deletions
13
Tests/LibWeb/Text/input/HTML/shadow-realm-async-evaluate.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<script src="../include.js"></script> | ||
<script> | ||
test(() => { | ||
const realm = new ShadowRealm(); | ||
const result = realm.evaluate(`() => 1 + 1`)(); | ||
println(`Shadow realm evaluation returned: ${result}`); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters