Skip to content

Returning lone surrogates fails #1450

Open
@gsnedders

Description

@gsnedders

wd.execute_script(u"return '\\uD800'") fails (almost?) everywhere. (Sorry Jim, I don't have IE to hand.)

Chrome:

selenium.common.exceptions.WebDriverException: Message: unknown error: bad inspector message: {"id":18,"result":{"result":{"type":"object","value":{"status":0,"value":"\ud800"}}}}
  (Session info: chrome=77.0.3865.90)

Firefox:

selenium.common.exceptions.InvalidArgumentException: Message: unexpected end of hex escape at line 1 column 27

Safari doesn't throw, just returns None.

Per spec, because we use the ES JSON.[[Parse]] and JSON.[[Stringify]] functions, we should deal with lone surrogates fine. Except this appears to be a lie.

This cropped up from web-platform-tests/wpt#17577.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions