-
-
Notifications
You must be signed in to change notification settings - Fork 696
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ajaxerror not serialized properly (#4211)
* add failing unit test for ajaxError serialization not working - all extendend properties get lost * change all worker_transfer tests to use structuredClone for realistic test; note that jsdom Blob does not work with node native structuredClone so that one line is disabled * serialize/deserialize Error so extends of Error pass through postMessage; e.g. AJAXError which already is registered for transfer but ignored because it's instance of Error * changelog entry * if the sublcass of a built-in object is registered, use the registered class, otherwise use the built-in to serialize/deserialize; fixes the issue that most Errors are (de)serialized by the builtin but AjaxError extend is not * Revert "if the sublcass of a built-in object is registered, use the registered class, otherwise use the built-in to serialize/deserialize; fixes the issue that most Errors are (de)serialized by the builtin but AjaxError extend is not" This reverts commit 5f378cd. * when serializing/deserializing check if the class is registered * style fix as reviewed Co-authored-by: Harel M <harel.mazor@gmail.com> * refactor for less duplication * Revert "change all worker_transfer tests to use structuredClone for realistic test; note that jsdom Blob does not work with node native structuredClone so that one line is disabled" This reverts commit cbf397d. * change the ajaxerror test to not use structuredClone until jsdom provides it since we don't want a custom jest env * improve changelog entry * add more tests to web_worker_transfer * deserialize uses $name * add more tests - note how the test agains BigInt really shows that the implementation is missing the ability to serialize/deserialize some valid objects which can probably be seralized/deserialized by primitives * explicit types --------- Co-authored-by: Harel M <harel.mazor@gmail.com>
- Loading branch information
Showing
3 changed files
with
183 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters