Closed djcoin closed 10 years ago
By the way, I got a "Uncaught Error: Unexpected "\u0000" at position 0 in state START " when commenting out the "if(process.browser)" part and using new Buffer (with the browserify-buffer shim) :s
Here is a fix that worked for us: https://github.com/SpiderStrategies/JSONStream/commit/2544fd0bea4be4cb21dd33937c24c309e577a1cf
oh sorry I missed this issue the first time - this shouldn't really be a problem now days because of https://github.com/feross/buffer <- complete polyfil for buffer in all browsers. You should get this if you use a recent browserify
@mattsgarlata does you code still work if you use Int8Array ? I it looks like you are allocating 4 bytes per input byte. Also, you could just create a Int8Array with the necessary length and then set it's values instead of creating an array and then turning it into an typed array
@dominictarr We're just relying on using the buffer polyfill in the browser, now that it's supported. I don't think there's a reason to have the if (process.browser)
check anymore, right?
that is correct, we could remove it.
I think it would be a good idea to remove it, since it doesn't work with unicode.
okay, it's removed in 0.8.3
Hi,
I have an issue with the Int32Array. If the browser does not support typed array I guess it breaks. In my case (chromium Version 23.0.1271.97 (171054) ), it breaks because the Int32Array does not have the "slice" method. (This breaks in the jsonparse module)
But I was wondering if we couldn't just remove the Int32Array stuff now that Buffer is browserify-able ? If anyone knows a good typed-array polyfill, otherwise, it would be nice to notify it in the README so that you can take into account this requirement and work it around for older/weird browser, avoiding them to break.
Thanks !