Skip to content

TracingPlatform performs undefined behavior in JS that makes it unusable in Wasm #4644

Description

@sjrd

private[this] val function0Property =
js.Object.getOwnPropertyNames((() => ()).asInstanceOf[js.Object])(0)
private[this] val function1Property =
js.Object.getOwnPropertyNames(((_: Unit) => ()).asInstanceOf[js.Object])(0)

These lines attempt to break through Scala.js abstractions. They access JS properties of a Scala.js object. That is undefined behavior.

When linking for WebAssembly, they actually crash, since Scala.js objects really don't have JS properties.

Since Tracing is always called by IO.async, it makes the latter completely unusable with Scala.js-on-Wasm.

There does not appear to be any workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions