Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serializeValue to properly handle slices #411

Closed
wants to merge 2 commits into from
Closed

Fix serializeValue to properly handle slices #411

wants to merge 2 commits into from

Conversation

reginaldl
Copy link
Contributor

This change fixes serialization of slices when passed as argument to Evaluate().
I found two issues with how slices are serialized:

  • The original argument was directly modified (passed as a reference) to become a map. We now create a separate map.
  • Once serialized, we returned a slice of map which I believe is not expected. We now returned {"a": [..]}, which is what the python library does here.

I also added a few tests.

I discovered that passing floats and time will not work.
We do not correctly serialize valid floats but when I tried fixing it I got the following error:
playwright: arg.value.v: expected one of (null|undefined|NaN|Infinity|-Infinity|-0)

Unfortunately, I wasn't able to fix this.

@canstand
Copy link
Collaborator

Thank you @reginaldl. There are multiple issues with serializeValue. I'll address it overall with another PR.

@canstand
Copy link
Collaborator

@reginaldl #412 merged and add you as co-authored.

@canstand
Copy link
Collaborator

canstand commented Feb 5, 2024

close due to #412

@canstand canstand closed this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants