https://webassembly.imtqy.com/demo/ says: "Execution semantics are fully implemented." sounds like MVP, but what exactly is missing or am I doing something wrong?
WAST:
(module
(memory 1)
(export "growMemory" $growMemory)
(func $growMemory (param $0 i32) (result i32) (grow_memory (get_local $0)))
(export "getMemorySize" $getMemorySize)
(func $getMemorySize (result i32) (memory_size))
)
JS code:
var xhr = new XMLHttpRequest();
xhr.open('GET', 'build/test.wasm', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function() {
var module = Wasm.instantiateModule(new Uint8Array(xhr.response));
console.log(module.exports.getMemorySize());
console.log(module.exports.growMemory(1));
console.log(module.exports.getMemorySize());
};
xhr.send(null);
Chrome Canary loads the WASM file, but grow_memory doesn't seem to be implemented:
65536
0
65536
And Firefox Nightly fails to load:
TypeError: wasm validation error at offset 124: bad expression code
Also the page size seems to be 0x10000 instead of 0x1000. But I can not find it in the design or specification.
source
share