Skip to content

[Bug]: 0.0 is serialized as -0 when passed to evaluate() #3186

Description

@ARDA7787

Version

1.62.1

Steps to reproduce

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()

result = page.evaluate("(value) => Object.is(value, -0)", 0.0)
print(result)

browser.close()

Expected behavior

Passing Python 0.0 to JavaScript should preserve positive zero.
Object.is(value, -0) should return false.

Actual behavior

Python 0.0 is serialized as JavaScript -0.
Object.is(value, -0) returns true.

Additional context

No response

Environment

- Operating System: macOS Tahoe 26.4.1
- CPU: Apple M1 (arm64)
- Browser: Chromium
- Python Version: Python 3.14.5
- Other info:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions