Skip to content

structuredClone() / postMessage() reject DataView values #5167

@Monti-27

Description

@Monti-27

Ran into this while checking structured clone support.

const view = new DataView(new ArrayBuffer(4));
structuredClone(view);

Current result:

TypeError: Data views are not supported yet.

This comes from core/runtime/src/store/from.rs, and it affects both structuredClone() and postMessage() since both go through JsValueStore::try_from_js(...).

This also looks like unfinished support rather than an intentional gap:

  • JsValueStore already has a ValueStoreInner::DataView variant in core/runtime/src/store/mod.rs
  • core/runtime/src/store/to.rs already has a DataView reconstruction path

There is direct WPT coverage for cloning DataView values in:

  • tests_wpt/html/webappapis/structured-clone/structured-clone-battery-of-tests.js
  • tests_wpt/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js

So the main issue here is just that Boa rejects DataView values outright right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions