Skip to content

i64 to BigInt in JS #1172

Closed
Closed
@xtuc

Description

@xtuc

Currently I64 can't pass the boundaries of WebAssembly, it will throw an exception from the Hostfunc. BigInt was already mentioned in some issues in the WebAssembly organization, but not exactly for what I mean here.

Today V8 announced the support for the BigInt proposal (still stage 3 at the moment), we can expect to see more and more adoption soon.

My idea is:

  • if the host support BigInt we can safely convert the i64 value into a BigInt value.
  • If not, it would throw.

This introduces an inconsistent behavior on some hosts, but avoiding that would lock down i64 in JS for a very long time.

What do you think?

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