WebAssembly is a low-level assembly-like language with a compact binary format that runs with near-native performance. It designed to run alongside JavaScript, allowing both to work together.
(c) MDN
🐊Putout processor adds ability to lint wasm.
npm i @putout/processor-wasm -D
{
"processors": ["wasm"]
}The
local.getinstruction returns the value of the local at index$idin the locals vector of the current function execution. The type parameter is bound to the type of the local.
get_local is DEPRECATED.
-get_local $a
+local.get $aThe
local.setinstruction returns the value of the local at index$idin the locals vector of the current function execution. The type parameter is bound to the type of the local.
set_local is DEPReCATED.
-set_local $a
+local.set $a(func (param $a i32) (param $b i32)
(get_local $a)
(get_local $b)
(i32.add)
)(func (param $a i32) (param $b i32)
(i32.add (get_local $a) (get_local $b))
)(module
(func $one (result i32)
i32.const 1
)
(func $oneTwo (param $y) (result i32 i32)
- (call $one (local.get $y))
+ (call $one)
i32.const 2
)
)(module
- (func $answer (result i32)
- i32.const 0x2A
- )
)MIT