WebAssembly.Tag() constructor

The WebAssembly.Tag() constructor creates a new WebAssembly.Tag object.

Syntax

new WebAssembly.Tag(type)

Parameters

type

An object that can contain the following members:

parameters

An array of data types ("i32", "i64", "f32", "f64", "v128", "externref", "anyfunc").

Exceptions

  • TypeError:
    • : Thrown if at least one of these conditions are met:
      • The type parameter is not an object.
      • The type.parameters property is not supplied.
      • The type.parameters contains an unsupported data type.
  • A TypeError will be thrown if type is not an object, the type.parameters property is not supplied, or type.parameters contains an unsupported data type.

Examples

This creates a tag with two values.

const tag = new WebAssembly.Tag({ parameters: ["i32", "i64"] });

Specifications

Specification
WebAssembly JavaScript Interface: Exception Handling
# dom-tag-tag

Browser compatibility

BCD tables only load in the browser

See also