Skip to content

Add navigator.userAgent to global scope #2903

Closed
@guest271314

Description

@guest271314

Feature suggestion

See

Deno and Bun execute AssemblyScript directly (after transforming or stripping types).

AssemblyScript process.stdin.read() is not the same as Node.js process.stdin.read(). String.UTF8 is not defined in Node.js or Deno.

The rational being able to use the same code that can be executed directly by JavaScript/TypeScript runtimes and compiled to WASM by asc.

Instead of using String.UTF8 as a condition

if(`${typeof String.UTF8}`) {
  process.stdout.write("AssemblyScript Version 0.27.32");
} else {
  process.stdout.write(navigator.userAgent);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions