Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

make sure that the buffer can .slice() before trying to slice it #12

Closed
wants to merge 1 commit into from

4 participants

@substack
Collaborator

This fix is necessary in environments like browsers where sometimes without warning you'll have an Int32Array instead of a string or a buffer.

@creationix
Owner

Added @substack as collaborator and gave him npm push access. I haven't used this module personally in over a year.

@mikeal

this can probably be closed.

@substack
Collaborator

Closing. Everything works great in the latest browserify version.

@substack substack closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  jsonparse.js
View
2  jsonparse.js
@@ -110,7 +110,7 @@ proto.write = function (buffer) {
}
}else if (this.tState === STRING1){ // After open quote
n = buffer[i];
- if (n >= 128) {
+ if (n >= 128 && buffer.slice) {
for (var j = i; buffer[j] >= 128 && j < buffer.length; j++);
this.string += buffer.slice(i, j).toString();
i = j - 1;
Something went wrong with that request. Please try again.