mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +00:00
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
This commit is contained in:
committed by
Ron Evans
parent
b9c0aa77bf
commit
0fd3d785a3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user