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

buf[i] not working sometimes #22

Open
andrewrk opened this issue Aug 8, 2013 · 4 comments
Open

buf[i] not working sometimes #22

andrewrk opened this issue Aug 8, 2013 · 4 comments

Comments

@andrewrk
Copy link
Contributor

andrewrk commented Aug 8, 2013

Causing zlib-browserify to be broken: brianloveswords/zlib-browserify#6

To produce the issue:

  1. Clone this gist
  2. browserify test.js >out.js
  3. Copy out.js into jsbeautifier.org and then paste back into out.js
  4. Add a debugger statement like this:
                        debugger
                        a.C = l[k++];
                        a.D = l[k++];
                        (31 !== a.C || 139 !== a.D) && m(Error("invalid file signature:", a.C, a.D));
  1. run in the browser

You will notice that l is a Buffer and l[0] is yielding undefined when it should yield 31. Note also that l.parent[0] works.

@andrewrk
Copy link
Contributor Author

andrewrk commented Aug 8, 2013

@substack might be interested to see this.

@terinjokes
Copy link

I've found that an implementation of a streaming Boyer-Moore-Horspool search streamsearch breaks because of this. Seems pretty egregious as it's a break from the Node API.

@andrewrk
Copy link
Contributor Author

@terinjokes for what it's worth, I think I got around the issue by using https://github.com/chrisdickinson/bops

but even then there was an issue I had to work around: chrisdickinson/bops#7

@terinjokes
Copy link

This actually looks fixed in HEAD, but hasn't been pulled into a newer version of insert-module-globals.

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