Skip to content

Commit

Permalink
revert support
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Sep 15, 2023
1 parent 6a5c1d2 commit 5f78245
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
6 changes: 2 additions & 4 deletions playwright/_impl/_js_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ def serialize_value(
return dict(v="-0")
if math.isnan(value):
return dict(v="NaN")
if isinstance(value, set):
return {"se": serialize_value(list(value), handles, visitor_info)}
if isinstance(value, datetime):
return dict(d=value.isoformat() + "Z")
if isinstance(value, bool):
Expand Down Expand Up @@ -198,10 +196,10 @@ def parse_value(value: Any, refs: Optional[Dict[int, Any]] = None) -> Any:
return int(value["bi"])

if "m" in value:
return dict(parse_value(value["m"], refs))
return {}

if "se" in value:
return set(parse_value(value["se"], refs))
return set()

if "a" in value:
a: List = []
Expand Down
7 changes: 2 additions & 5 deletions tests/async/test_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,11 @@ async def test_evaluate_transfer_bigint(page: Page) -> None:


async def test_should_transfer_maps(page):
map_obj = {"foo": "bar"}
result = await page.evaluate("a => new Map(Object.entries(a))", map_obj)
assert result == map_obj
assert await page.evaluate("() => new Map([[1, { test: 42n }]])") == {}


async def test_should_transfer_sets(page):
assert await page.evaluate("() => new Set([1, 42n])") == set([1, 42])
assert await page.evaluate("a => a", set([1, "17"])) == set([1, "17"])
assert await page.evaluate("() => new Set([1, { test: 42n }])") == set()


async def test_evaluate_return_undefined_for_objects_with_symbols(page):
Expand Down

0 comments on commit 5f78245

Please sign in to comment.