diff --git a/html/webappapis/scripting/reporterror.any.js b/html/webappapis/scripting/reporterror.any.js
new file mode 100644
index 00000000000000..edd0f25fff056a
--- /dev/null
+++ b/html/webappapis/scripting/reporterror.any.js
@@ -0,0 +1,12 @@
+test(t => {
+ let happened = false;
+ self.onerror = e => {
+ happened = true;
+ alert(typeof e);
+ assert_equals(e.error, 1);
+ };
+ self.addEventListener("x", () => { throw 1 });
+ self.dispatchEvent(new Event("x"));
+ //self.reportError(1);
+ assert_true(happened);
+});