Stringify unknown JavaScript objects in global exception handlers

When turning DOM exceptions into `ErrorInfo` always try to stringify
the JavaScript value, even if it's an object that isn't a `DOMException`
or native exception.  This means that exceptions that extend the `Error`
prototype are now stringified. The result is that test output for WPT
global assertion failures is more useful. For instance for the test
include-frames-from-child-same-origin-grandchild.sub.html:

Before:
```
uncaught exception: unknown (can't convert to string)
```

After:
```
uncaught exception: Error: assert_equals: expected 4 but got 3
```
This commit is contained in:
Martin Robinson 2023-01-12 17:10:34 +01:00
parent 633f14df11
commit e68ebd2617
3 changed files with 81 additions and 30 deletions

View file

@ -13746,6 +13746,13 @@
{}
]
],
"global_exception_stringification.html": [
"b1c6cb6c390cca290085eea61ba4bf2f34aa4475",
[
null,
{}
]
],
"globals": {
"entry.html": [
"f963385342adbd92e4858a507c88155b4ed4371f",