syscall/js: allow copyBytesTo(Go|JS) to use Uint8ClampedArray
From f0e8b81aa3
Fixes https://github.com/tinygo-org/tinygo/issues/1941
Этот коммит содержится в:
родитель
b9c0aa77bf
коммит
0fd3d785a3
1 изменённых файлов: 2 добавлений и 2 удалений
|
@ -424,7 +424,7 @@
|
||||||
|
|
||||||
const dst = loadSlice(dest_addr, dest_len);
|
const dst = loadSlice(dest_addr, dest_len);
|
||||||
const src = loadValue(source_addr);
|
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
|
mem().setUint8(returned_status_addr, 0); // Return "not ok" status
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -443,7 +443,7 @@
|
||||||
|
|
||||||
const dst = loadValue(dest_addr);
|
const dst = loadValue(dest_addr);
|
||||||
const src = loadSlice(source_addr, source_len);
|
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
|
mem().setUint8(returned_status_addr, 0); // Return "not ok" status
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче