Skip to content

Commit

Permalink
Ensure AbortSignal.throwIfAborted doesn't modify the message of an ab…
Browse files Browse the repository at this point in the history
…ort error

Fixed: 392413688
Change-Id: I3639c573cd7349eac1f9b09c427a5a52bccdda72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6209470
Reviewed-by: Andrey Kosyakov <[email protected]>
Commit-Queue: Nate Chapin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1412605}
  • Loading branch information
natechapin authored and chromium-wpt-export-bot committed Jan 29, 2025
1 parent 3f5cef6 commit 2e8b491
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dom/abort/event.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,12 @@ test(t => {

test(t => {
const reason = new Error('boom');
const message = reason.message;
const signal = AbortSignal.abort(reason);
assert_true(signal.aborted);
assert_throws_exactly(reason, () => signal.throwIfAborted());
assert_equals(reason.message, message,
"abort.reason should not be changed by throwIfAborted()");
}, "throwIfAborted() should throw abort.reason if signal aborted");

test(t => {
Expand Down

0 comments on commit 2e8b491

Please sign in to comment.