Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readSync and others functions doesn't really supports uint8array #733

Closed
Tracked by #735
Mesteery opened this issue Aug 27, 2021 · 1 comment · Fixed by #1083
Closed
Tracked by #735

readSync and others functions doesn't really supports uint8array #733

Mesteery opened this issue Aug 27, 2021 · 1 comment · Fixed by #1083

Comments

@Mesteery
Copy link
Contributor

Functions such as readSync do not really support Uint8Array. It would be nice to support a Uint8Array, or better yet, like Node.js, all Typed Array and DataView.

@corwin-of-amber
Copy link
Contributor

In a browser environment, and with [email protected], it works by coincidence. But with newer versions of buffer, it generates this error:

> fd = mfs.openSync('/proj1/foo', 'r')
> mfs.readSync(fd, new Uint8Array(500), 0, 500)
Uncaught TypeError: argument should be a Buffer
    at Uint8Array.copy (index-13.js:1691)
    at Node.read (node-6.js:122)
    at File.read (node-6.js:380)
    at Volume.readBase (volume-3.js:878)
    at Volume.readSync (volume-3.js:882)
    at <anonymous>:1:5

I encountered the problem while using wasmer-js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants