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

structuredClone #984

Merged
merged 73 commits into from Dec 9, 2021
Merged

structuredClone #984

merged 73 commits into from Dec 9, 2021

Commits on Dec 9, 2021

  1. add structured-clone entry points

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    d220907 View commit details
    Browse the repository at this point in the history
  2. add cloning of primitives, wrappers, Date, RegExp, Map, Set

    Actually we should be checking the existance of internal slots,
    and toString comes close, but @@toStringTag can be overriden.
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    ebc8a32 View commit details
    Browse the repository at this point in the history
  3. add cloning of array and object

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    3bb20f1 View commit details
    Browse the repository at this point in the history
  4. cache cloned value in a weakmap

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    d807b2e View commit details
    Browse the repository at this point in the history
  5. export structuredCloneInternal directly

    If transfer behaviour is not replicatable,
    we don't need wrapping function at all.
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    235e6f7 View commit details
    Browse the repository at this point in the history
  6. refactor structuredCloneInternal using classof

    fixed infinite recursion
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    5d7c03c View commit details
    Browse the repository at this point in the history
  7. treat array as object

    this conforms to the spec more closely,
    and it also copies non-indexed key as well
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    25476cc View commit details
    Browse the repository at this point in the history
  8. add tests

    copied from web-platform-tests with adjustments to work with QUnit.
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    8fae5ef View commit details
    Browse the repository at this point in the history
  9. implement Error cloning

    I'm not 100% sure stack cloning would work everywhere, but it seems to
    work on Firefox and Chrome and Node.js.
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    3c5342a View commit details
    Browse the repository at this point in the history
  10. apply suggestions from review

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    0ebccea View commit details
    Browse the repository at this point in the history
  11. implement arraybuffer cloning

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    14b3a78 View commit details
    Browse the repository at this point in the history
  12. implement SharedArrayBuffer cloning

    CAVEATS: this will *not* shrare memory as
    you might expect for strucutred cloning.
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    3cb770d View commit details
    Browse the repository at this point in the history
  13. implement Blob cloning

    although the type is different the interface is more or less the same.
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    5381fac View commit details
    Browse the repository at this point in the history
  14. implement DataView cloning

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    50a1827 View commit details
    Browse the repository at this point in the history
  15. update compat data

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    40eccb7 View commit details
    Browse the repository at this point in the history
  16. implement TypedArray cloning

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    da59491 View commit details
    Browse the repository at this point in the history
  17. use map for caching

    since the map itself does not live longer then the function, it is ok
    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    071ffae View commit details
    Browse the repository at this point in the history
  18. rename has

    BasixKOR authored and zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    e6d0a27 View commit details
    Browse the repository at this point in the history
  19. some fixes

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    5800aea View commit details
    Browse the repository at this point in the history
  20. clone File and ImageData

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    e149ca8 View commit details
    Browse the repository at this point in the history
  21. improve tests

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    34b6f80 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    ae44dee View commit details
    Browse the repository at this point in the history
  23. some improvements

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    8977c69 View commit details
    Browse the repository at this point in the history
  24. clone geometry types

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    9284911 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    300491e View commit details
    Browse the repository at this point in the history
  26. add pure version tests

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    53d7619 View commit details
    Browse the repository at this point in the history
  27. forced usage of polyfill in the pure version since native `structured…

    …Clone` can't work with wrapped `Map` / `Set`
    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    4707b73 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    2040a05 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    bbaddce View commit details
    Browse the repository at this point in the history
  30. fix FF implementation

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    1b81767 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    f4bb633 View commit details
    Browse the repository at this point in the history
  32. some stylistic changes

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    fddef17 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    1675881 View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    104a7b5 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    48981fd View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    fc14c99 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    44ae9b1 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    eb03549 View commit details
    Browse the repository at this point in the history
  39. clone FileList

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    d354dd3 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    92755dc View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    5341988 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    68e1f60 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    488c1fe View commit details
    Browse the repository at this point in the history
  44. use nativeRestrictedStructuredClone where it's possible, throw `Dat…

    …aCloneError` where it's required
    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    e46a9ea View commit details
    Browse the repository at this point in the history
  45. cloneError#stack

    it's not defined in the spec, but seems it should work similarly to `.stack` and it works in Chrome
    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    166cc3f View commit details
    Browse the repository at this point in the history
  46. drop extra case

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    0a84f77 View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    f64a562 View commit details
    Browse the repository at this point in the history
  48. update compat test

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    904ede6 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    7beae95 View commit details
    Browse the repository at this point in the history
  50. improve transfer handling

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    5d170d8 View commit details
    Browse the repository at this point in the history
  51. Configuration menu
    Copy the full SHA
    a14201d View commit details
    Browse the repository at this point in the history
  52. Configuration menu
    Copy the full SHA
    b925e5a View commit details
    Browse the repository at this point in the history
  53. fix .sham flag

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    017a374 View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    047e8ac View commit details
    Browse the repository at this point in the history
  55. some stylistic changes

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    00f0d0c View commit details
    Browse the repository at this point in the history
  56. use CreateDataProperty

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    4c32695 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    1fdfd14 View commit details
    Browse the repository at this point in the history
  58. some comments

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    9fbedfb View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    31d5712 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    95663bf View commit details
    Browse the repository at this point in the history
  61. Update packages/core-js/modules/web.structured-clone.js

    Co-authored-by: Kenta Moriuchi <moriken@kimamass.com>
    zloirock and petamoriken committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    be7be95 View commit details
    Browse the repository at this point in the history
  62. drop USE_STRUCTURED_CLONE_FROM_MARK fast case

    native `structuredClone` is already available in unstable versions of all modern engines, but no one of them still not passes new (related to html/5749) errors cloning tests
    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    bba0457 View commit details
    Browse the repository at this point in the history
  63. update docs

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    e9f74db View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    f80540d View commit details
    Browse the repository at this point in the history
  65. fix linting

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    2fbece8 View commit details
    Browse the repository at this point in the history
  66. native NodeJS structuredClone throws a TypeError on transferable …

    …non-serializable instead of `DOMException`
    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    a9298a7 View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    5826451 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    6475af3 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    205a8b6 View commit details
    Browse the repository at this point in the history
  70. add some comments

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    6414360 View commit details
    Browse the repository at this point in the history
  71. refactor tests

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    64be468 View commit details
    Browse the repository at this point in the history
  72. use polyfilled DOMException

    zloirock committed Dec 9, 2021
    Configuration menu
    Copy the full SHA
    27182a3 View commit details
    Browse the repository at this point in the history
  73. Configuration menu
    Copy the full SHA
    e0d475e View commit details
    Browse the repository at this point in the history