Don't use properties but the prototype chain for the "isWebDriverError()"
Categories
(Remote Protocol :: Agent, defect, P3)
Tracking
(firefox151 fixed)
| Tracking | Status | |
|---|---|---|
| firefox151 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
Details
(Whiteboard: [webdriver:m20][webdriver:relnote])
Attachments
(1 file)
Recently while working on bug 2031596 I noticed that a platform bug caused an error to be thrown which had the same name (UnknownError) as one of our known WebDriver Errors. As such the check that we run before serializing an error via isWebDriverError() returned true and caused the toJSON() method to be called which only exists for WebDriver errors:
Given that this could be always the case when a fake object has similar properties and values we should not rely on them but find a better way to identify errors that are based on the WebDriver error type. Given that we cannot use instanceof we could use the actual prototype chain to check for a base WebDriverError entry. For the case above it works just fine.
| Assignee | ||
Comment 1•1 month ago
|
||
Here a try build for this change:
https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=36283
| Assignee | ||
Comment 2•1 month ago
|
||
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Updated•19 days ago
|
Description
•