I've spent a good two full days trying to figure why it was not working.
We have a custom function attached to the window object that I was trying invoke with a deep dictionary object. While debugging I realized that when the framework serializes expression arguments it converts None to undefined instead of null.
In our case we explicitly check for null (inside the browser) and that was the reason it was failing.
I understand that you have both options (undefined and null) in javascript world while there is only None in python world. So I guess you had to choose one or another. My question is if it was the right choice here.
Also, it is a very subtle issue and it is not documented anywhere.
Below is the code in question.
|
return dict(v="undefined") |
I've spent a good two full days trying to figure why it was not working.
We have a custom function attached to the window object that I was trying invoke with a deep dictionary object. While debugging I realized that when the framework serializes expression arguments it converts
Nonetoundefinedinstead ofnull.In our case we explicitly check for
null(inside the browser) and that was the reason it was failing.I understand that you have both options (
undefinedandnull) in javascript world while there is onlyNonein python world. So I guess you had to choose one or another. My question is if it was the right choice here.Also, it is a very subtle issue and it is not documented anywhere.
Below is the code in question.
playwright-python/playwright/_impl/_js_handle.py
Line 101 in 6854c40