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

avoid browserifying Buffer, for #39 #41

Merged
merged 4 commits into from
Oct 20, 2014
Merged

avoid browserifying Buffer, for #39 #41

merged 4 commits into from
Oct 20, 2014

Conversation

nlf
Copy link
Collaborator

@nlf nlf commented Sep 25, 2014

No description provided.

@nlf nlf added this to the 2.2.5 milestone Sep 25, 2014
@rlidwka
Copy link

rlidwka commented Sep 26, 2014

I'd bet it will throw with ReferenceError: global is not defined in a browser.

@nlf
Copy link
Collaborator Author

nlf commented Sep 26, 2014

I bet you're right. I'll add a guard to make sure globals exists first.

@nlf nlf changed the title refer to globals.Buffer so as to avoid browserifying Buffer, for #39 avoid browserifying Buffer, for #39 Sep 26, 2014
@nlf
Copy link
Collaborator Author

nlf commented Sep 26, 2014

I completely reworked this to use the suggestion from @latentflip in #39, as well as tweaking a couple other things to make sure that stringifying weird objects works correctly (since it didn't when I added tests to get coverage on this change)

@dominykas
Copy link

I'd wrap the final return in !!( ... ) to ensure it's a bool - otherwise if isBuffer is undefined, we get undefined as the final result.

@nlf nlf self-assigned this Oct 20, 2014
nlf added a commit that referenced this pull request Oct 20, 2014
avoid browserifying Buffer, for #39
@nlf nlf merged commit 5ac9df5 into master Oct 20, 2014
@nlf nlf deleted the browserify_tweak branch October 20, 2014 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants