Bug 1735474 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

FYI relevant design docs from Chrome's side:

- https://bugs.chromium.org/p/chromium/issues/detail?id=1144839
- https://docs.google.com/document/d/1l75bKG3ecO7xJPzlnpaXQUhEy9wR1XcC2srwyB6E-aE/edit
- https://docs.google.com/document/d/1C68-UiKmG7TUN5xVpdw7eSiHRTQEjlGB2-svenaIm4s/edit

It seems that the documents are not accounting for non-serializable or non-callable functions. E.g.:

- `class X{}` = cannot be called, only with `new`.
- `Math.min` = `function() { [native functon] }` cannot be serialized.
- `new Proxy(function() {}, {});` = Proxy around function.

The docs do account for cases where `func.toString` has been overridden with a custom implementation.
In practice, Xray vision in Firefox ensures that `func.toString` uses the native `toString` implementation, but it would be good to have unit tests nevertheless. Consider making that part of the initial patch, or a follow-up bug.
FYI relevant design docs from Chrome's side:

- https://bugs.chromium.org/p/chromium/issues/detail?id=1144839
- https://docs.google.com/document/d/1l75bKG3ecO7xJPzlnpaXQUhEy9wR1XcC2srwyB6E-aE/edit
- https://docs.google.com/document/d/1C68-UiKmG7TUN5xVpdw7eSiHRTQEjlGB2-svenaIm4s/edit

It seems that the documents are not accounting for non-serializable or non-callable functions. E.g.:

- `class X{}` = cannot be called, only with `new`.
- `Math.min` = `function() { [native functon] }` cannot be serialized.
- `new Proxy(function() {}, {});` = Proxy around function.
- `a = {async prop(){}, prop2() {}};` -> `a.prop` and `a.prop2` cannot be called after trivial serialization (`(async prop(){})()` and `(prop2(){})()` are invalid synyax)

The docs do account for cases where `func.toString` has been overridden with a custom implementation.
In practice, Xray vision in Firefox ensures that `func.toString` uses the native `toString` implementation, but it would be good to have unit tests nevertheless. Consider making that part of the initial patch, or a follow-up bug.
FYI relevant design docs from Chrome's side:

- https://bugs.chromium.org/p/chromium/issues/detail?id=1144839
- https://docs.google.com/document/d/1l75bKG3ecO7xJPzlnpaXQUhEy9wR1XcC2srwyB6E-aE/edit
- https://docs.google.com/document/d/1C68-UiKmG7TUN5xVpdw7eSiHRTQEjlGB2-svenaIm4s/edit

It seems that the documents are not accounting for non-serializable or non-callable functions. E.g.:

- `class X{}` = cannot be called, only with `new`.
- `Math.min` = `function() { [native functon] }` cannot be serialized.
- `new Proxy(function() {}, {});` = Proxy around function.
- `a = {async prop(){}, prop2() {}};` -> `a.prop` and `a.prop2` cannot be called after trivial serialization (`(async prop(){})()` and `(prop2(){})()` are syntactically invalid)

The docs do account for cases where `func.toString` has been overridden with a custom implementation.
In practice, Xray vision in Firefox ensures that `func.toString` uses the native `toString` implementation, but it would be good to have unit tests nevertheless. Consider making that part of the initial patch, or a follow-up bug.

Back to Bug 1735474 Comment 3