mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 11:37:16 +02:00
BindingsGenerator: Handle global interfaces without named properties
DedicatedWorkerGlobalScope is an object with a Global extended
attribute, but does not define any named property getters. This needs to
be handled by setting the prototype chain to:
DedicatedWorkerGlobalScope
^ DedicatedWorkerGlobalScopePrototype
^ WorkerGlobalScopePrototype
(This is different from something like Window, where there is an
intermediate WindowProperties object for named properties.)
Previously, we treated the GlobalMixin object as if it was a simple
prototype object, accidentally setting DedicatedWorkerGlobalScope's
prototype to WorkerGlobalScopePrototype. This caused the expression
self instanceof DedicatedWorkerGlobalScope
to return false inside workers.
This makes us pass many more of the "/xhr/idlharness.any.worker" WPT
tests than before, rather than failing early.
This commit is contained in:
Notes:
github-actions[bot]
2024-10-12 17:22:59 +00:00
Author: https://github.com/sin-ack Commit: https://github.com/LadybirdBrowser/ladybird/commit/d5948709cd4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1744
@@ -0,0 +1,15 @@
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const worker = new Worker("DedicatedWorkerGlobalScope-instanceof-worker.js");
|
||||
worker.onmessage = function (event) {
|
||||
if (event.data.result === true) {
|
||||
println("PASS");
|
||||
} else {
|
||||
println("FAIL");
|
||||
}
|
||||
done();
|
||||
};
|
||||
worker.postMessage("run");
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user