mirror of
https://github.com/servo/servo
synced 2026-05-09 00:22:16 +02:00
Implement WindowOrWorkerGlobalScope::reportError (#40654)
This web API is alternative API to `throw e`, which is why we can reuse a lot of the existing machinery. The one testcase that isn't passing yet is because it reports an empty `TypeError`. The current logic in `ErrorInfo` only retrieves the message data, but doesn't include the type of the exception. For that, we need to use `(*report)._base.errorNumber` and map that back to the original type codes. However, deferring that to a follow-up as that requires some more work in mozjs. Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
committed by
GitHub
parent
10796b8590
commit
8e0c2d5750
@@ -684,7 +684,7 @@ DOMInterfaces = {
|
||||
},
|
||||
|
||||
'Window': {
|
||||
'canGc': ['CreateImageBitmap', 'CreateImageBitmap_', 'CookieStore', 'Fetch', 'FetchLater', 'Open', 'SetInterval', 'SetTimeout', 'Stop', 'StructuredClone', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
|
||||
'canGc': ['CreateImageBitmap', 'CreateImageBitmap_', 'CookieStore', 'Fetch', 'FetchLater', 'Open', 'ReportError', 'SetInterval', 'SetTimeout', 'Stop', 'StructuredClone', 'TrustedTypes', 'WebdriverCallback', 'WebdriverException'],
|
||||
'inRealms': ['Fetch', 'GetOpener', 'WebdriverCallback'],
|
||||
'additionalTraits': ['crate::interfaces::WindowHelpers'],
|
||||
},
|
||||
@@ -696,7 +696,7 @@ DOMInterfaces = {
|
||||
|
||||
'WorkerGlobalScope': {
|
||||
'inRealms': ['Fetch'],
|
||||
'canGc': ['Fetch', 'CreateImageBitmap', 'CreateImageBitmap_', 'ImportScripts', 'SetInterval', 'SetTimeout', 'StructuredClone', 'TrustedTypes'],
|
||||
'canGc': ['Fetch', 'CreateImageBitmap', 'CreateImageBitmap_', 'ImportScripts', 'ReportError', 'SetInterval', 'SetTimeout', 'StructuredClone', 'TrustedTypes'],
|
||||
},
|
||||
|
||||
'Worklet': {
|
||||
|
||||
@@ -10,6 +10,8 @@ typedef (TrustedScript or DOMString or Function) TimerHandler;
|
||||
interface mixin WindowOrWorkerGlobalScope {
|
||||
[Replaceable] readonly attribute USVString origin;
|
||||
|
||||
undefined reportError(any e);
|
||||
|
||||
// base64 utility methods
|
||||
[Throws] DOMString btoa(DOMString data);
|
||||
[Throws] DOMString atob(DOMString data);
|
||||
|
||||
Reference in New Issue
Block a user