Add read function implementation in wasm
This commit is contained in:
committed by
Pavel Punegov
parent
cae31c7853
commit
4dd4911b58
@@ -129,6 +129,11 @@ let konan_dependencies = {
|
|||||||
fromString(utf8encode(readline() + '\n'), str);
|
fromString(utf8encode(readline() + '\n'), str);
|
||||||
return str;
|
return str;
|
||||||
},
|
},
|
||||||
|
read: function (file, str, size) {
|
||||||
|
let string = utf8encode(readline() + '\n');
|
||||||
|
fromString(string.substring(0, size), str);
|
||||||
|
return string.length;
|
||||||
|
},
|
||||||
Konan_notify_memory_grow: function() {
|
Konan_notify_memory_grow: function() {
|
||||||
heap = new Uint8Array(instance.exports.memory.buffer);
|
heap = new Uint8Array(instance.exports.memory.buffer);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user