mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-29 01:45:49 +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);
|
||||
|
||||
4
emscripten/emscripten.d.ts
vendored
4
emscripten/emscripten.d.ts
vendored
@@ -22,8 +22,8 @@ declare module Module {
|
||||
function ccall(ident: string, returnType: string, argTypes: string[], args: any[]): any;
|
||||
function cwrap(ident: string, returnType: string, argTypes: string[]): any;
|
||||
|
||||
function setValue(ptr: number, value: any, type: string, noSafe: boolean): void;
|
||||
function getValue(ptr: number, type: string, noSafe: boolean): any;
|
||||
function setValue(ptr: number, value: any, type: string, noSafe?: boolean): void;
|
||||
function getValue(ptr: number, type: string, noSafe?: boolean): number;
|
||||
|
||||
var ALLOC_NORMAL: number;
|
||||
var ALLOC_STACK: number;
|
||||
|
||||
Reference in New Issue
Block a user