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

Author: ARDA7787Created Aug 24, 2026Updated Aug 24, 2026

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:

Source: microsoft/playwright-python