RESOLVED FIXED322845
[WebDriver][BiDi] Fix script.call_function trimming of error messages
https://bugs.webkit.org/show_bug.cgi?id=322845
Summary [WebDriver][BiDi] Fix script.call_function trimming of error messages
Lauro Moura
Reported 2026-08-28 08:10:08 PDT
Currently, BidiScriptAgent::callFunction does `String errorMessage = stringResult.error().right("Javascript;"_s.length())` to strip the prefix, but `right(n)` takes the n rightmost chars from the string. The right method is `substring(index)`. After fixing bug321148, I could detect this in the imported/w3c/webdriver/tests/bidi/session/unsubscribe/invalid.py::test_params_event_value_valid_and_invalid_event_name: webdriver.bidi.modules.script.ScriptEvaluateResultException: entifier "text1" And the payload: {"result":{"type":"exception","realm":"realm-32","exceptionDetails":{"text":"entifier \"text1\"","lineNumber":0,"columnNumber":0,"exception":{"type":"error","value":{"message":"entifier \"text1\""}},"stackTrace":{"callFrames":[]}}}, "id":4} (The actual underlying issue raising the exception will be handled on a separate patch) Patch incoming.
Attachments
Lauro Moura
Comment 1 2026-08-31 14:01:00 PDT
EWS
Comment 2 2026-08-31 17:51:25 PDT
Committed 320205@main (3eec920a914f): <https://commits.webkit.org/320205@main> Reviewed commits have been landed. Closing PR #72879 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2026-08-31 17:52:14 PDT
Note You need to log in before you can comment on or make changes to this bug.