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

The type.parameters argument is not supplied, does not contain at least one value, or contains an unsupported tag descriptor.

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