Skip to content

Commit

Permalink
HTML: self.reportError()
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Jul 22, 2021
1 parent 6cb0daf commit 8e5a434
Showing 1 changed file with 22 additions and 0 deletions.
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 });

test(t => {
let happened = false;
self.addEventListener("error", t.step_func(e => {
assert_equals(e.error, 1);
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)");

0 comments on commit 8e5a434

Please sign in to comment.