mirror of
https://github.com/servo/servo.git
synced 2025-09-11 15:38:24 +01:00
Auto merge of #29235 - servo:better-exceptions, r=jdm
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 ``` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes.
This commit is contained in:
commit
aaca4543fc
3 changed files with 81 additions and 30 deletions
|
@ -13746,6 +13746,13 @@
|
|||
{}
|
||||
]
|
||||
],
|
||||
"global_exception_stringification.html": [
|
||||
"b1c6cb6c390cca290085eea61ba4bf2f34aa4475",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
]
|
||||
],
|
||||
"globals": {
|
||||
"entry.html": [
|
||||
"f963385342adbd92e4858a507c88155b4ed4371f",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue