Value

Value

interface Value

Defines a value for use in WebAssembly at runtime.

From the docs:

WebAssembly computations manipulate values of the four basic value types: integers and floating-point data of 32 or 64 bit width each, respectively.

In most places of the semantics, values of different types can occur. In order to avoid ambiguities, values are therefore represented with an abstract syntax that makes their type explicit. It is convenient to reuse the same notation as for the const instructions producing them:


val    ::= i32.const i32
i64.const i64
f32.const f32
f64.const f64

Fields

Name Description
abstract value: T

Extensions

checkType

fun Value<*>.checkType(expected: ValueType)

Checks the receiving Value against an expected ValueType

Receiver

Name Description
Value<*>

Parameters

Name Description
expected: ValueType

ReturnValue

Name Description
Unit

isType

fun Value<*>.isType(expected: ValueType): Boolean

Checks the receiving Value against an expected ValueType

Receiver

Name Description
Value<*>

Parameters

Name Description
expected: ValueType

ReturnValue

Name Description
Boolean