AssemblyScript/wabt.js

parseWat() fails w/ Node.js Buffer type

mikeal opened this issue · 1 comments

The Node.js Buffer type is a valid Uint8Array, but using one results in a strange error that leads me to believe the code handling for strings might be getting called instead.

I can fix it by converting the Buffer to a Uint8Array but that causes a memcopy, so it would be great if it were fixed.

Error: parseWat failed:
./example.wat:8:1: error: unexpected char

    at Object.parseWat (/Users/mikealrogers/code/indrajala/node_modules/wabt/index.js:28:27008)
    at run (file:///Users/mikealrogers/code/indrajala/cli.js:7:29)

Could you post your code please?