Skip to content

Determine maximum supported JS string size #7

@daxpedda

Description

@daxpedda

I realized that in #3 we only considered what would happen if we try to encode a JS string bigger than 2^32 to Wasm. But what this doesn't cover is decoding from Wasm to a JS string. E.g. if a user attempts to convert to a JS string that results in a size bigger than what the engine supports it will trap, with no way to recover.

I really only see two ways to handle this:

  • Do not trap, but instead throw an exception. I'm not aware of anything similar having been done before.
  • Provide a function to query the maximum string size of the engine. Currently this is not even available in JS.

Cc @jakobkummerow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions