Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML: self.reportError() #29738

Merged
merged 4 commits into from
Jul 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions html/webappapis/scripting/reporterror.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
setup({ allow_uncaught_exception:true });

annevk marked this conversation as resolved.
Show resolved Hide resolved
test(t => {
let happened = false;
self.addEventListener("error", t.step_func(e => {
assert_equals(e.error, 1);
annevk marked this conversation as resolved.
Show resolved Hide resolved
happened = true;
}));
self.reportError(1);
assert_true(happened);
}, "self.reportError(1)");

test(t => {
const throwable = new TypeError();
let happened = false;
self.addEventListener("error", t.step_func(e => {
assert_equals(e.error, throwable);
happened = true;
}));
self.reportError(throwable);
assert_true(happened);
}, "self.reportError(obj)");