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

Text reader doesn't accept byte arrays of text anymore #77

Closed
mtcalvin opened this issue Sep 12, 2017 · 1 comment
Closed

Text reader doesn't accept byte arrays of text anymore #77

mtcalvin opened this issue Sep 12, 2017 · 1 comment

Comments

@mtcalvin
Copy link
Contributor

I'm unsure if this is a regression or if it was never intended behavior in the first place.

Previously, passing text data as a byte array to makeReader would still return a functioning text reader. Now it throws an error:

var ionJs = require("ion-js")
var input = "{foo:bar}";
var arr = new Uint8Array(input.length)
// A more realistic example would be loading a text file from disk as a Buffer (node.js) or Blob (HTML5)
for (var i = 0; i < input.length; i++) arr[i] = input.charCodeAt(i)

var reader = ionJs.makeReader(arr);
console.log(reader.next().name);
TypeError: this._src.charCodeAt is not a function

2.0.0: https://runkit.com/embed/vz9xv8h87vqp
2.1.2: https://runkit.com/embed/ee8ubusq2qrx (contains more detailed stack trace)

@wesboyt
Copy link
Contributor

wesboyt commented Jul 18, 2019

fixed in: fd49bc8

@wesboyt wesboyt closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants