Adapt the tests for the onerror event on Worker global scopes to cover ShadowRealm global scopes as well.
One of the tests uses setTimeout() directly to fire the global onerror event. Use queueMicrotask() instead, since that is [Exposed=*]. We cannot use t.step_timeout() because that wraps the callback in a t.step_func() which catches the error and fails the test.
Run the microtask evaluation order tests in ShadowRealm scopes.
Add a new test ensuring that the behaviour of wrapping exceptions thrown from outer realm functions in a fresh TypeError extends to the onerror event as well.
(This PR was originally for just ErrorEvent and onerror. I added my queueMicrotask coverage as well, because most of the tests are quite related.)
Adapt the tests for the onerror event on Worker global scopes to cover ShadowRealm global scopes as well.
One of the tests uses setTimeout() directly to fire the global onerror event. Use queueMicrotask() instead, since that is [Exposed=*]. We cannot use t.step_timeout() because that wraps the callback in a t.step_func() which catches the error and fails the test.
Run the microtask evaluation order tests in ShadowRealm scopes.
Add a new test ensuring that the behaviour of wrapping exceptions thrown from outer realm functions in a fresh TypeError extends to the onerror event as well.
(This PR was originally for just ErrorEvent and onerror. I added my queueMicrotask coverage as well, because most of the tests are quite related.)