diff options
author | Samuel Stauffer <[email protected]> | 2022-03-03 11:25:37 -0800 |
---|---|---|
committer | Ron Evans <[email protected]> | 2022-03-07 19:01:55 +0100 |
commit | 0fd3d785a3a2a075719f644752334c1fbb0ab0d0 (patch) | |
tree | 11842dc8c5a5d110cc08e6058de8f05d200d0408 /targets | |
parent | b9c0aa77bf9f5a306e4b7d3d2df1efabdab96a5e (diff) | |
download | tinygo-0fd3d785a3a2a075719f644752334c1fbb0ab0d0.tar.gz tinygo-0fd3d785a3a2a075719f644752334c1fbb0ab0d0.zip |
syscall/js: allow copyBytesTo(Go|JS) to use Uint8ClampedArray
From https://github.com/golang/go/commit/f0e8b81aa34120e21642c569912bde00ccd33393
Fixes https://github.com/tinygo-org/tinygo/issues/1941
Diffstat (limited to 'targets')
-rw-r--r-- | targets/wasm_exec.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js index 053a2d62d..8021b44eb 100644 --- a/targets/wasm_exec.js +++ b/targets/wasm_exec.js @@ -424,7 +424,7 @@ const dst = loadSlice(dest_addr, dest_len); const src = loadValue(source_addr); - if (!(src instanceof Uint8Array)) { + if (!(src instanceof Uint8Array || src instanceof Uint8ClampedArray)) { mem().setUint8(returned_status_addr, 0); // Return "not ok" status return; } @@ -443,7 +443,7 @@ const dst = loadValue(dest_addr); const src = loadSlice(source_addr, source_len); - if (!(dst instanceof Uint8Array)) { + if (!(dst instanceof Uint8Array || dst instanceof Uint8ClampedArray)) { mem().setUint8(returned_status_addr, 0); // Return "not ok" status return; } |