dominictarr/JSONStream — pull request #23 by GraemeF (2012-10-23 20:35:15+00:00)
Title: Check whether or not Buffer and Int32Array are present and support buf[index]

As I mentioned in creationix/jsonparse#10 I've run into a problem with a combination of browserify/zombie where browserify's implementation of `Buffer` can't implement the `[]` operator which jsonparse makes use of. I guess the same will happen for other polyfills too.

This pull request intends to check that whatever is given to jsonparse supports `[]`, falling back to `Int32Array` and then `Array` if `Buffer` is either not available or won't work with jsonparse. The tests now pass using buffer-browserify's `Buffer` where they previously failed.

As you can probably tell I'm no JS expert - particularly when it comes to client-side stuff - so am prepared for ridicule/schooling as appropriate :grin: