script callFunction and evaluate fail if the script throws an object which doesn't implement toString()
Categories
(Remote Protocol :: WebDriver BiDi, defect, P1)
Tracking
(firefox104 fixed)
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
Details
(Whiteboard: [webdriver:m4], [wptsync upstream])
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
When a call to script.evaluate/callFunction encounters an exception, the logic to extract the text
is really weak:
text:
typeof exception === "object"
? exception.toString()
: String(exception),
First this will fail on null
as it is an object but has no toString
property. But it would also fail on a random object such as { toString: "not a method" }
or any other variant.
For null
, the test should be covered by extending our exception_details test cases to cover primitives. For random objects, it might be worth adding a mozilla-specific wdspec test. Or we can extract some of that logic to a dedicated helper and add xpcshell tests.
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
Comment 4•2 years ago
|
||
bugherder |
Comment 5•2 years ago
|
||
Post-adding to M4 given that this work is part of it and the project was only on-hold when the patch got landed.
Comment 7•2 years ago
|
||
The upstream PR got merged via https://github.com/web-platform-tests/wpt/pull/34945.
Description
•