ref.is_null
Pops a funcref value off the stack and checks if it NULL or not, and then pushes the result back on to the stack.

Syntax

ref.is_null

Stack In

funcref A reference to a function.

Stack Out

i32 The result of the check. If the function reference is NULL then the result will be 1. If the function reference is something other than NULL then the result will be 0.

Example

;; Create sort function
(func $sort (param $callback funcref)
  ;; Check the $callback is not NULL
  local.get $callback
  ref.is_null

  ;; If $callback was NULL
  if
    ;; The $callback function is NULL, so stop here
    return
  end

  ;; Continue with the sort process...
)