funcref
value off the stack and checks if it NULL or not, and then
pushes the result back on to the stack.
ref.is_null
funcref | A reference to a function. |
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. |
;; 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... )