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

Define error semantics on serialising JS return values #1349

Open
andreastt opened this issue Nov 6, 2018 · 0 comments
Open

Define error semantics on serialising JS return values #1349

andreastt opened this issue Nov 6, 2018 · 0 comments

Comments

@andreastt
Copy link
Member

As @domenic pointed out to me in #whatwg, we have failed to define error behaviour related to the Execute Script and Execute Async Script commands. For any JS object an injected script interacts with, there is a chance of failure.

This is especially problematic for the internal JSON clone algorithm that serialises return values from injected scripts. If we for example consider the following injected script:

let rv = new Array(3);
Object.defineProperty(Array.prototype, "1", { get () { throw new Error("foo"); } })
return rv;

Here there is no chance of avoiding hitting the error when the array’s items are serialised in turn. The failure case above needs to be defined in detail.

(Depending on the implementation of the driver, script injection overriding document prototypes may also effect other commands that in theory are meant to work on the underlying data structures indepedently of prototype overrides, but I think this is outside the scope of this issue.)

This issue is related to the one @jugglinmike filed about fixing collection serialisation following my change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant