Skip to content

Simplify js-string conversion from primitive numeric methods #23

@eqrion

Description

@eqrion

From the overview:

String (extensions to the existing wasm:js-string): 

Conversion from primitive numeric types: fromI32, fromU32, fromI64, fromU64, fromF64

Would it be sufficient to reduce this to:

js-value:from: (x: T) -> externref
  generic over any value type `T`
  equivalent to ToWebAssemblyValue(ToJSValue(x, T), 'externref')

js-number:toString: (x: externref) -> externref
  if (typeof x !== "number") trap();
  return x.toString();

The js-value:from method would also be useful for #20.

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