mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
nosafe param to Emscripten Module.getValue is optional
This commit is contained in:
@@ -11,6 +11,8 @@ function ModuleTest(): void {
|
||||
|
||||
var myTypedArray = new Uint8Array(10);
|
||||
var buf = Module._malloc(myTypedArray.length*myTypedArray.BYTES_PER_ELEMENT);
|
||||
Module.setValue(buf, 10, 'i32');
|
||||
var x = Module.getValue(buf, 'i32') + 123;
|
||||
Module.HEAPU8.set(myTypedArray, buf);
|
||||
Module.ccall('my_function', 'number', ['number'], [buf]);
|
||||
Module._free(buf);
|
||||
|
||||
Reference in New Issue
Block a user