-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: propagate aborted state to dependent signals before firing events
- Loading branch information
Showing
7 changed files
with
131 additions
and
6 deletions.
There are no files selected for viewing
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
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
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,6 @@ | ||
features: | ||
- name: aborting | ||
files: "**" | ||
- name: abortsignal-any | ||
files: | ||
- abort-signal-any.any.js |
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,23 @@ | ||
<!DOCTYPE html> | ||
<html class=test-wait> | ||
<head> | ||
<title>AbortSignal::Any when source signal was garbage collected</title> | ||
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1908466"> | ||
<link rel="author" title="Vincent Hilla" href="mailto:vhilla@mozilla.com"> | ||
<script src="/common/gc.js"></script> | ||
</head> | ||
<body> | ||
<p>Test passes if the browser does not crash.</p> | ||
<script> | ||
async function test() { | ||
let controller = new AbortController(); | ||
let signal = AbortSignal.any([controller.signal]); | ||
controller = undefined; | ||
await garbageCollect(); | ||
AbortSignal.any([signal]); | ||
document.documentElement.classList.remove('test-wait'); | ||
} | ||
test(); | ||
</script> | ||
</body> | ||
</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,11 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<script> | ||
let b; | ||
window.addEventListener("DOMContentLoaded", () => { | ||
let a = new AbortController() | ||
b = AbortSignal.any([a.signal]) | ||
a.signal.addEventListener("abort", () => { AbortSignal.any([b]) }, { }) | ||
a.abort(undefined) | ||
}) | ||
</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
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