Movatterモバイル変換


[0]ホーム

URL:


  1. WebAssembly
  2. Reference
  3. WebAssembly control flow instructions
  4. end

end: Wasm text instruction

end is used to end ablock,loop,if, orelse. In the other examples we used the s-expression syntax which doesn't require theend, so you won't find it in the other examples here. However, it's still useful to know about since this is what the browsers display in devtools.

Try it

(module  ;; import the browser console object, you'll need to pass this in from JavaScript  (import "console" "log" (func $log (param i32)))  (func    i32.const 0 ;; change to positive number if you want to run the if block    if      i32.const 1      call $log ;; should log '1'    end  )  (start 1) ;; run the first function automatically)
const url = "{%wasm-url%}";await WebAssembly.instantiateStreaming(fetch(url), { console });

Syntax

wat
i32.const 0if  ;; do somethingend
InstructionBinary opcode
end0x0b

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp