mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-18 01:11:32 +00:00
Is it a strawberry, see boyanio/wasm-wheel#2
This commit is contained in:
@ -42,11 +42,11 @@ globalScope["load"] = function load(ptr) {
|
||||
var Module = require("../module").Module;
|
||||
Module.prototype.toBinary = function toBinary(bufferSize) {
|
||||
if (!bufferSize) bufferSize = 1024 * 1024; // FIXME: see binaryen.js-post.js in Binaryen
|
||||
var ptr = _malloc(bufferSize);
|
||||
var ptr = Heap.allocate(bufferSize);
|
||||
var len = this.write(ptr, bufferSize);
|
||||
var ret = new Uint8Array(len);
|
||||
ret.set(binaryen.HEAPU8.subarray(ptr, ptr + len));
|
||||
_free(ptr);
|
||||
Heap.dispose(ptr);
|
||||
return ret;
|
||||
};
|
||||
Module.prototype.toText = function toText() {
|
||||
|
Reference in New Issue
Block a user