Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Should IndexValueToU64 use ToBigInt64? #85

Closed
@backes

Description

@backes

When implementing #75 in V8 I was wondering that the IndexValueToU64 algorithm throws a TypeError if the value is not a BigInt, instead of using the ToBigInt64 algorithm that's also used in ToWebAssemblyValue.

Any reason for this restriction, or should we be consistent there and accept anything that converts to a BigInt64 according to that algorithm (in particular boolean values and string, but notably not Numbers).

One difficulty with switching to ToBigInt64 would be static typing on the IndexValue type. Instead of unsigned long or bigint this would need to be unsigned long or object I guess.

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